An AI-powered productivity application that helps users achieve their goals through intelligent task scheduling and progress tracking.
Production: https://livebetter-frontend-ave9ddbac5bcdxgf.westeurope-01.azurewebsites.net
Try it now, no setup required.
Live Better combines goal management, AI-driven task generation, and photo validation to help users stay productive and accountable. Set your goals, let AI create your daily schedule, and track your progress with visual feedback.
- Goal Management - Create, track, and manage personal goals
- AI Task Generation - Automatically generate daily schedules using OpenAI GPT-4
- Task Tracking - Organize tasks by time slots (morning/afternoon/night)
- Photo Validation - Verify task completion with photos
- Secure Authentication - JWT-based auth with bcrypt password hashing
- 3D Visualizations - Interactive WebGL backgrounds with Three.js
- Progress Tracking - Monitor goal completion and productivity
- Prometheus Monitoring - Comprehensive metrics collection and visualization with Grafana
Visit: https://livebetter-frontend-ave9ddbac5bcdxgf.westeurope-01.azurewebsites.net
cp .env.example .env # Add your OPENAI_API_KEY
docker-compose up -dAccess: http://localhost:3001
- Bun v1.2.21+ (Install Bun)
- PostgreSQL 14+
- OpenAI API Key (Get one here)
# Clone the repository
git clone https://github.com/leaabj/live-better.git
cd lb
# Install backend dependencies
cd backend
bun install
# Install frontend dependencies
cd ../frontend
bun installCreate a .env file in the backend/ directory:
DATABASE_URL=postgresql://username:password@localhost:5432/live_better
JWT_SECRET=your-super-secret-jwt-key-min-32-chars
OPENAI_API_KEY=sk-your-openai-api-keyStep 1: Create the PostgreSQL database
# Create PostgreSQL database
podman run --name livebetter-postgres \
-e POSTGRES_USER=livebetter \
-e POSTGRES_PASSWORD=livebetter \
-e POSTGRES_DB=livebetter \
-p 5432:5432 \
-d postgres:17
Step 2: Run migrations
cd backend
# Generate migration files from schema
bunx drizzle-kit generate
# Apply migrations to database
bunx drizzle-kit migrateVerify database setup:
# Check tables were created
psql -U postgres -d live_better -c "\dt"
# Should show: users, goals, tasks tablesTerminal 1 - Backend:
cd backend
bun run dev # http://localhost:3000Terminal 2 - Frontend:
cd frontend
bun run dev # http://localhost:3001Visit http://localhost:3001 to use the app!
Pre-built images available on Docker Hub:
docker pull leaaboujaoude/livebetter-backend:latest
docker pull leaaboujaoude/livebetter-frontend:latestGitHub Actions automatically:
- Runs 375 tests on every push
- Builds Docker images
- Pushes to Docker Hub
Workflow: .github/workflows/ci-cd.yml
- Frontend: Azure Web App (Container)
- Backend: Azure Web App (Container)
- Database: Azure PostgreSQL Flexible Server
- Runtime: Bun 1.2.21
- Framework: Hono 4.9.6
- Database: PostgreSQL + Drizzle ORM
- Authentication: JWT + bcryptjs
- AI: OpenAI GPT-4
- Validation: Zod
- Testing: Bun Test (375 tests, 82% coverage)
- Framework: React 19
- Router: TanStack Router 1.132
- Styling: Tailwind CSS 4.0
- 3D Graphics: Three.js 0.180
- Build Tool: Vite 6.3
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/profile- Get user profile (protected)PUT /api/auth/profile- Update profile (protected)
GET /api/goals- Get all goals (protected)POST /api/goals- Create goal (protected)GET /api/goals/:id- Get specific goal (protected)PUT /api/goals/:id- Update goal (protected)DELETE /api/goals/:id- Delete goal (protected)
GET /api/tasks- Get today's tasks (protected)GET /api/tasks/all- Get all tasks (protected)POST /api/tasks- Create task (protected)PUT /api/tasks/:id- Update task (protected)DELETE /api/tasks/:id- Delete task (protected)POST /api/tasks/:id/validate-photo- Validate with photo (protected)
POST /api/goals/tasks/ai-create-all- Generate daily schedule (protected)GET /api/goals/tasks/daily-limit-check- Check AI usage limit (protected)
GET /- Basic health checkGET /metrics/health- Health status with timestampGET /metrics- Prometheus metrics endpoint
Full API documentation: See backend/README.md
cd backend
# Run all tests
bun test
# Run with coverage
bun test --coverage
# Watch mode
bun test --watchTest Coverage:
- 375 tests across 11 files (100% pass rate)
- 82% line coverage
- 80% function coverage
- 100% coverage: Auth middleware, Time utilities
- 95% coverage: Auth utilities
- Email, password (hashed), name
- User context for AI personalization
- Preferred time slots
- AI generation tracking
- Title, description, target date
- Completion status
- User association
- Title, description, time slot
- Specific time, duration
- Completion status, photo URL
- AI-generated flag
- Goal association
Full schema: See backend/README.md
The AI service analyzes your goals and user context to create a personalized daily schedule:
- Respects preferred time slots
- Considers task duration (5-480 minutes)
- Balances workload across the day
- Provides reasoning for scheduling decisions
Verify task completion by uploading photos:
- Stores photo URLs
- Links photos to specific tasks
- Visual progress tracking
Tasks are organized into three time periods:
- Morning: 4:30 AM - 12:00 PM
- Afternoon: 12:01 PM - 6:00 PM
- Night: 6:01 PM - 12:00 AM
- Backend README - API reference, testing, deployment
- Frontend README - Component docs, routing, styling
# Start backend (Terminal 1)
cd backend && bun run dev
# Start frontend (Terminal 2)
cd frontend && bun run dev
# Start monitoring stack (Terminal 3) - Optional
docker compose -f docker-compose.monitoring.yml up
# Run tests (Terminal 4)
cd backend && bun test --watchWhen running with the monitoring stack:
- App: http://localhost:3001
- Backend: http://localhost:3000
- Metrics: http://localhost:3000/metrics
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3002 (admin/admin)
Port 3000 already in use:
# Find and kill process using port 3000
lsof -ti:3000 | xargs kill -9Database connection error:
# Verify PostgreSQL is running
psql -U postgres -c "SELECT version();"
# Check if database exists
psql -U postgres -l | grep live_better
# Test connection with your DATABASE_URL
psql "postgresql://username:password@localhost:5432/live_better"Migration errors:
# Reset migrations (WARNING: destroys data)
cd backend
bunx drizzle-kit drop
bunx drizzle-kit generate
bunx drizzle-kit migrateJWT_SECRET too short:
- Must be at least 32 characters
- Use a strong random string:
openssl rand -base64 32
OpenAI API errors:
- Verify API key is valid at platform.openai.com
- Check your API quota and billing
- Ensure you have access to GPT-4 model
"Module not found" errors:
# Reinstall dependencies
cd backend && rm -rf node_modules && bun install
cd frontend && rm -rf node_modules && bun installTypeScript errors:
# Check TypeScript version compatibility
bun --version # Should be 1.2.21+Backend can't connect to database:
- Add backend IPs to PostgreSQL firewall rules
- Verify connection string includes
?sslmode=require
CORS errors:
- Backend → Settings → CORS → Add frontend URL
Container won't start:
- Check: Web App → Log stream