Initial project scaffolding for health tracker app

Set up backend and frontend structure for a health and fitness tracker using Python (FastAPI, SQLModel, DSPy) and React. Includes Docker and Compose configs, authentication, nutrition AI module, health/nutrition/user endpoints, database models, and basic frontend with routing and context. Enables tracking nutrition, health metrics, and user management, with architecture ready for future mobile and cloud deployment.
This commit is contained in:
Carlos Escalante
2026-01-18 10:29:44 -06:00
parent b11e2740ea
commit 5dc6dc88f7
55 changed files with 5751 additions and 0 deletions

73
develop.sh Executable file
View File

@@ -0,0 +1,73 @@
#!/bin/bash
# Exit on error
set -e
# Load environment variables from .env
if [ -f .env ]; then
set -a
source .env
set +a
else
echo "Error: .env file not found"
exit 1
fi
# Start Database container
echo "Starting database container..."
docker compose up -d db
echo "Waiting for database to be ready..."
until docker compose exec -T db pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}; do
echo "Database is unavailable - sleeping"
sleep 1
done
# Set DATABASE_URL for local connection (using mapped port 5435)
export DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5435/${POSTGRES_DB}"
echo "Configured DATABASE_URL for local development"
# Virtual Environment Setup
VENV_DIR="backend/.venv"
if [ ! -d "$VENV_DIR" ]; then
echo "Creating virtual environment in $VENV_DIR..."
python3 -m venv "$VENV_DIR"
fi
echo "Activating virtual environment..."
source "$VENV_DIR/bin/activate"
echo "Installing dependencies..."
pip install -r backend/requirements.txt
# Function to handle shutdown
cleanup() {
echo ""
echo "Stopping services..."
# Kill all child processes of this script
pkill -P $$
exit
}
# Trap signals for cleanup
trap cleanup SIGINT SIGTERM
echo "Starting Backend..."
# Run in background
(cd backend && uvicorn app.main:app --reload --host 0.0.0.0 --port 8000) &
echo "Starting Frontend..."
# Run in background
(cd frontend && npm run dev) &
# Wait for process to settle
sleep 2
echo ""
echo "Development environment running!"
echo "Backend: http://localhost:8000"
echo "Frontend: http://localhost:5173"
echo "Press Ctrl+C to stop"
# Wait indefinitely for background jobs
wait