AI-powered, agentic habit coach for college students
Meal planning, budget intelligence, productivity coaching, and cross-domain reasoning in one full-stack app.
DeltaAI is a full-stack platform built for Indian college students to help them manage everyday decisions across three connected domains:
Eat Smart: AI meal planning within a daily INR budget, personalized to diet, fitness goals, and calorie needsSpend Smart: expense tracking, budget analysis, recurring spend detection, and spending alertsDo Smart: task management, AI-based prioritization, streak tracking, and Pomodoro logging
What makes the project different is the agentic layer: the assistant does not only answer chat prompts. It builds context from meals, habits, expenses, profile, and tasks, then produces proactive suggestions such as:
- flagging overspending before the month ends
- warning that a streak is at risk
- suggesting cheaper meals when the budget is tight
- surfacing overdue academic work with urgency-aware recommendations
- Features
- Architecture
- Tech Stack
- Repository Structure
- Getting Started
- Environment Variables
- API Overview
- AI System
- Seed Data
- Deployment
- Documentation
- Notes
Eat Smart: generates budget-aware Indian meal plans with calorie and protein estimatesSpend Smart: tracks spending by category, shows summaries, budget alerts, semester planning, and recurring subscription detectionDo Smart: manages tasks, deadlines, urgency scoring, and focus-session metrics
- Autonomous morning briefings
- Cross-domain chat assistant with context from profile, meals, expenses, habits, and tasks
- Expense analysis and weekly performance reports
- AI-assisted task prioritization and onboarding baseline generation
- JWT-based auth with bcrypt password hashing
- Password reset with OTP flow
- Onboarding flow that generates initial habits and a first meal plan
- Dashboard aggregation endpoint for efficient frontend loading
- Calendar support for academic events and study recommendations
flowchart LR
U[User] --> FE[Next.js Frontend]
FE -->|/api/* rewrite| BE[FastAPI Backend]
BE --> DB[(MongoDB Atlas)]
BE --> AG[DeltaAgent]
AG --> GW[AI Gateway]
GW --> AN[Anthropic API]
GW --> OR[OpenRouter API]
- The frontend calls
/api/*through Next.js rewrites. - FastAPI authenticates the request using JWT.
- Routers access MongoDB collections directly for CRUD and analytics.
- AI-powered endpoints call
DeltaAgent, which builds a context snapshot from multiple domains. - The AI gateway chooses Anthropic or OpenRouter based on available API keys.
| Layer | Technologies |
|---|---|
| Frontend | Next.js 14, React 18, TypeScript, Tailwind CSS, Framer Motion, Recharts |
| Backend | FastAPI, Python 3.13+, pymongo, httpx, pydantic-settings, slowapi, cachetools |
| Database | MongoDB Atlas |
| AI | Anthropic Claude and OpenRouter fallback chain |
| Auth | JWT (HS256), bcrypt |
| Tooling | uv, npm |
| Deployment | Vercel (frontend), Railway (backend) |
project_delta/
├── backend/
│ ├── app/
│ │ ├── agent/ # Agent engine, AI gateway, prompts
│ │ ├── models/ # Pydantic request/response schemas
│ │ ├── routers/ # FastAPI route modules by domain
│ │ ├── auth.py # JWT and password utilities
│ │ ├── cache.py # In-memory TTL caching helpers
│ │ ├── config.py # Settings and env loading
│ │ ├── database.py # MongoDB connection and indexes
│ │ ├── dependencies.py # Shared app dependencies
│ │ └── main.py # FastAPI app entrypoint
│ ├── run.py # Local backend runner
│ ├── seed.py # Demo data seeding script
│ └── Procfile
├── frontend/
│ ├── app/ # Next.js App Router pages/layouts
│ ├── components/ # Reusable UI components
│ ├── hooks/ # Client hooks
│ └── lib/ # Auth context and API client
├── .env.example
├── CODE_WIKI.md
├── pyproject.toml
└── railway.json
- Python
3.13+ - uv
- Node.js
18+ - npm
- MongoDB Atlas connection string
- At least one AI provider key:
OPENROUTER_API_KEYfor local testingANTHROPIC_API_KEYfor production-oriented setup
git clone https://github.com/D9292S/project_delta.git
cd project_deltacp .env.example .envEdit .env and provide your values:
MONGODB_URI=your-mongodb-uri
JWT_SECRET=your-random-secret
OPENROUTER_API_KEY=sk-or-v1-your-key-here
ANTHROPIC_API_KEY=
ANTHROPIC_MODEL=claude-sonnet-4-20250514
AI_MODEL=google/gemma-4-31b-it:free
DB_NAME=deltaai
CORS_ORIGINS=http://localhost:3000uv synccd backend
uv run run.pyBackend URLs:
- API:
http://localhost:8000 - Swagger docs:
http://localhost:8000/docs
Create frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000cd frontend
npm install
npm run devFrontend URL:
- App:
http://localhost:3000
| Variable | Required | Purpose |
|---|---|---|
MONGODB_URI |
Yes | MongoDB Atlas connection string |
JWT_SECRET |
Yes | JWT signing secret |
DB_NAME |
No | Database name, default deltaai |
CORS_ORIGINS |
No | Comma-separated allowed origins |
OPENROUTER_API_KEY |
Recommended for local | OpenRouter API access |
AI_MODEL |
No | Preferred OpenRouter model |
ANTHROPIC_API_KEY |
Recommended for production | Anthropic API access |
ANTHROPIC_MODEL |
No | Anthropic model name |
The backend auto-selects the AI provider based on which keys are configured:
ANTHROPIC_API_KEY |
OPENROUTER_API_KEY |
Provider Behavior |
|---|---|---|
| empty | set | OpenRouter only |
| set | empty | Anthropic only |
| set | set | Anthropic primary, OpenRouter fallback |
NEXT_PUBLIC_API_URL=http://localhost:8000POST /api/auth/signupPOST /api/auth/loginGET /api/auth/mePOST /api/auth/forgot-passwordPOST /api/auth/reset-password
POST /api/onboardingGET /api/profilePUT /api/profile
POST /api/chatGET /api/chat/historyDELETE /api/chat/historyGET /api/chat/briefingGET /api/chat/analyze-expensesGET /api/chat/weekly-report
GET /api/habitsPOST /api/habitsPATCH /api/habits/{id}/toggleDELETE /api/habits/{id}GET /api/habits/stats
POST /api/meals/generateGET /api/meals/todayGET /api/meals/historyGET /api/meals/analyticsDELETE /api/meals/{id}
GET /api/expensesPOST /api/expensesDELETE /api/expenses/{id}GET /api/expenses/summaryGET /api/expenses/alertsGET /api/expenses/subscriptionsGET /api/expenses/semester-plan
GET /api/tasksPOST /api/tasksPATCH /api/tasks/{id}/toggleDELETE /api/tasks/{id}POST /api/tasks/prioritizePOST /api/tasks/pomodoroGET /api/tasks/pomodoro/stats
GET /api/dashboardGET /api/dashboard/fullGET /api/dashboard/briefingGET /api/dashboard/nudgesGET /api/dashboard/weekly-reportGET /api/dashboard/exportGET /api/delta-scoreGET /api/calendarPOST /api/calendarGET /api/calendar/upcomingDELETE /api/calendar/{id}GET /api/healthGET /api/status
DeltaAI uses a ReAct-style agentic pattern:
- Build context from profile, habits, meals, expenses, tasks, and health indicators
- Detect issues such as overspending, overdue tasks, missing meal plans, or streak risk
- Reason across domains, for example budget pressure influencing meal recommendations
- Respond with concrete actions, priorities, and explanations
Core AI modules:
backend/app/agent/engine.py:DeltaAgentcore workflowsbackend/app/agent/openrouter.py: provider routing and fallback behaviorbackend/app/agent/prompts.py: prompt templates
Optional seeding script:
cd backend
uv run seed.pyThe demo seed includes:
- habits with streak history
- recent meal plans
- categorized expenses
- tasks with different urgency levels
- sample chat history
- Designed for Railway
- Configured through
railway.json - Start command runs
uvicorn app.main:app
- Designed for Vercel
- Set
NEXT_PUBLIC_API_URLto the deployed backend origin - Next.js rewrites proxy
/api/*to the backend
- Developer-facing code documentation: CODE_WIKI.md
- Root backend app entry:
backend/app/main.py - Frontend API client:
frontend/lib/api.ts
- Currency is modeled in
INR - Default monthly budget fallback is
₹8,000 - Default daily meal budget logic uses roughly
40%of monthly budget spread across the month - College is auto-detected from email domain when possible
- Auth endpoints are rate-limited
- JWT tokens expire after
30 days