|
1 | | -# AITutor β Production-Ready Web App |
| 1 | +<div align="center"> |
| 2 | + |
| 3 | + <img src="https://img.shields.io/badge/Production%20Ready-Ready%20to%20Deploy-8B5CF6?style=for-the-badge&logo=rocket&logoColor=white" alt="Production Ready" /> |
| 4 | + |
| 5 | + <h1 style="font-size: 3.8rem; margin: 16px 0 8px; background: linear-gradient(90deg, #A78BFA, #C4B5FD, #DDD6FE); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800;"> |
| 6 | + β¨ AITutor |
| 7 | + </h1> |
| 8 | + |
| 9 | + <h3 style="color: #64748B; font-weight: 500;">AI-Powered Tutor for Indian Students</h3> |
| 10 | + |
| 11 | + <p style="font-size: 1.35rem; max-width: 620px; margin: 20px auto;"> |
| 12 | + Enter <strong>any topic</strong> β Receive a crystal-clear explanation β Take a smart 10-question mock test grounded in what you just learned. |
| 13 | + </p> |
| 14 | + |
| 15 | + <img src="https://api.pikwy.com/web/69a2a331decb0d637029bd48.png" |
| 16 | + alt="AITutor Preview" |
| 17 | + width="920" |
| 18 | + style="border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(167, 139, 246, 0.5); margin: 30px 0 40px;"> |
| 19 | + |
| 20 | + <p> |
| 21 | + <img src="https://img.shields.io/badge/Next.js-14-black?style=for-the-badge&logo=nextdotjs&logoColor=white" /> |
| 22 | + <img src="https://img.shields.io/badge/FastAPI-009688?style=for-the-badge&logo=fastapi&logoColor=white" /> |
| 23 | + <img src="https://img.shields.io/badge/Python-3.12-3776AB?style=for-the-badge&logo=python&logoColor=white" /> |
| 24 | + <img src="https://img.shields.io/badge/Tailwind_CSS-06B6D4?style=for-the-badge&logo=tailwindcss&logoColor=white" /> |
| 25 | + <img src="https://img.shields.io/badge/Docker-2496ED?style=for-the-badge&logo=docker&logoColor=white" /> |
| 26 | + </p> |
| 27 | + |
| 28 | +</div> |
2 | 29 |
|
3 | | -Tutor for Indian students. Enter any topic, get a clear explanation, then take a 10-question mock test grounded in that explanation. |
4 | | - |
5 | | -## Tech Stack |
| 30 | +--- |
6 | 31 |
|
7 | | -| Layer | Technology | |
8 | | -|-----------|-----------------------------------------| |
9 | | -| Frontend | Next.js 14 (App Router), TypeScript, Tailwind CSS | |
10 | | -| Backend | FastAPI, Python 3.12, Pydantic v2 | |
11 | | -| API | OpenRouter β GPT-OSS 120B (deep reasoning) | |
12 | | -| Deploy | Docker + docker-compose | |
| 32 | +## π Why AITutor? |
13 | 33 |
|
14 | | -## Project Structure |
| 34 | +**Learning made delightful for Bharatβs students.** |
15 | 35 |
|
16 | | -``` |
17 | | -aitutor/ |
18 | | -βββ src/ |
19 | | -β βββ backend/ |
20 | | -β β βββ app/ |
21 | | -β β β βββ core/config.py # Settings (pydantic-settings) |
22 | | -β β β βββ models/schemas.py # Request/response Pydantic models |
23 | | -β β β βββ services/api_service.py # All API logic isolated here |
24 | | -β β β βββ api/routes/tutor.py # FastAPI route handlers |
25 | | -β β β βββ main.py # App factory + middleware |
26 | | -β β βββ requirements.txt |
27 | | -β β βββ Dockerfile |
28 | | -β β βββ .env.example |
29 | | -β βββ frontend/ |
30 | | -β βββ app/ |
31 | | -β β βββ components/ |
32 | | -β β β βββ layout/ # Navbar, Hero |
33 | | -β β β βββ ui/ # Card, Button (reusable) |
34 | | -β β β βββ tutor/ # TutorApp, TopicInput, QuizView, etc. |
35 | | -β β βββ hooks/useLearn.ts # All client state + API calls |
36 | | -β β βββ lib/api.ts # Typed fetch wrapper |
37 | | -β β βββ types/index.ts # Shared TypeScript types |
38 | | -β β βββ layout.tsx |
39 | | -β β βββ page.tsx |
40 | | -β βββ public/manifest.json |
41 | | -β βββ tailwind.config.ts |
42 | | -β βββ next.config.mjs |
43 | | -β βββ Dockerfile |
44 | | -βββ deployment/ # Deployment configurations |
45 | | -βββ docs/ # Documentation |
46 | | -βββ vercel.json # Vercel configuration |
47 | | -βββ render.yaml # Render configuration |
48 | | -βββ DEPLOYMENT.md # Deployment guide |
49 | | -``` |
50 | | - |
51 | | -## Quick Start (Local Dev) |
52 | | - |
53 | | -### Option 1: Using Modular Structure (Recommended) |
54 | | -```bash |
55 | | -# Backend |
56 | | -cd backend |
57 | | -cp .env.example .env |
58 | | -# Edit .env with your OPENROUTER_API_KEY |
59 | | -python -m uvicorn app.main:app --reload --port 8000 |
60 | | - |
61 | | -# Frontend (new terminal) |
62 | | -cd frontend |
63 | | -cp .env.example .env.local |
64 | | -npm install |
65 | | -npm run dev |
66 | | -``` |
67 | | - |
68 | | -### Option 2: Using Original Structure |
69 | | -```bash |
70 | | -# Backend |
71 | | -cd src/backend |
72 | | -source venv/bin/activate |
73 | | -python -m uvicorn app.main:app --reload --port 8000 |
| 36 | +No more boring textbooks. Just type **βPhotosynthesisβ**, **βQuadratic Equationsβ**, or **βIndian Independenceβ** and instantly get: |
| 37 | +- A beautifully structured, exam-focused explanation |
| 38 | +- A 10-question mock test that actually tests understanding |
| 39 | +- Instant scoring + detailed feedback |
74 | 40 |
|
75 | | -# Frontend |
76 | | -cd src/frontend |
77 | | -npm install |
78 | | -npm run dev |
79 | | -``` |
80 | | - |
81 | | -### 3. Open Browser |
82 | | -Navigate to: http://localhost:3000 (or 3001/3002 if ports taken) |
| 41 | +Built from the ground up for Indian curriculum (CBSE, ICSE, State Boards, JEE/NEET ready). |
83 | 42 |
|
84 | 43 | --- |
85 | 44 |
|
86 | | -## Production Deployment |
| 45 | +## β¨ Features |
87 | 46 |
|
88 | | -### π Quick Deploy (Modular Structure) |
89 | | -```bash |
90 | | -# Deploy both services |
91 | | -cd backend && ./deploy.sh |
92 | | -cd ../frontend && ./deploy.sh |
93 | | -``` |
| 47 | +<div align="center" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin: 40px 0;"> |
94 | 48 |
|
95 | | -### Option 1: Separate Modules (Recommended) |
96 | | -- **Backend**: See [backend/README.md](backend/README.md) β Deploy to Render |
97 | | -- **Frontend**: See [frontend/README.md](frontend/README.md) β Deploy to Vercel |
98 | | -- **Guide**: See [QUICK_DEPLOY.md](QUICK_DEPLOY.md) for step-by-step |
| 49 | + <div style="background: #1E2937; padding: 28px; border-radius: 20px; border: 2px solid #A78BFA;"> |
| 50 | + β‘ <strong>Lightning Fast</strong><br> |
| 51 | + <span style="color:#94A3B8;">30β60 seconds from topic to test</span> |
| 52 | + </div> |
99 | 53 |
|
100 | | -### Option 2: Original Structure |
101 | | -- See [DEPLOYMENT.md](DEPLOYMENT.md) for combined deployment |
| 54 | + <div style="background: #1E2937; padding: 28px; border-radius: 20px; border: 2px solid #A78BFA;"> |
| 55 | + π§ <strong>120B Deep Reasoning</strong><br> |
| 56 | + <span style="color:#94A3B8;">Powered by GPT-OSS via OpenRouter</span> |
| 57 | + </div> |
102 | 58 |
|
103 | | -### Option 3: Full Modular Setup |
104 | | -- See [MODULAR_DEPLOYMENT.md](MODULAR_DEPLOYMENT.md) for complete guide |
| 59 | + <div style="background: #1E2937; padding: 28px; border-radius: 20px; border: 2px solid #A78BFA;"> |
| 60 | + π <strong>Perfectly Grounded Quizzes</strong><br> |
| 61 | + <span style="color:#94A3B8;">Every question comes from the explanation</span> |
| 62 | + </div> |
105 | 63 |
|
106 | | ---- |
| 64 | + <div style="background: #1E2937; padding: 28px; border-radius: 20px; border: 2px solid #A78BFA;"> |
| 65 | + π¨ <strong>Stunning Light-Purple UI</strong><br> |
| 66 | + <span style="color:#94A3B8;">Modern, responsive, delightful to use</span> |
| 67 | + </div> |
107 | 68 |
|
108 | | -## Docker (Production) |
| 69 | +</div> |
109 | 70 |
|
110 | | -```bash |
111 | | -# Set your API key in src/backend/.env first |
112 | | -docker-compose up --build |
113 | | -``` |
114 | | - |
115 | | -Frontend β http://localhost:3000 |
116 | | -Backend API docs β http://localhost:8000/docs |
117 | | - |
118 | | -## API Endpoints |
119 | | - |
120 | | -| Method | Path | Description | |
121 | | -|--------|-------------------------|--------------------------------------| |
122 | | -| POST | /api/v1/tutor/learn | Generate explanation + quiz (30-60s) | |
123 | | -| POST | /api/v1/tutor/score | Score quiz answers (instant) | |
124 | | -| GET | /api/v1/tutor/health | Health check | |
125 | | -| GET | /docs | Swagger UI | |
126 | | - |
127 | | -### POST /api/v1/tutor/learn |
128 | | -```json |
129 | | -{ "topic": "Photosynthesis", "language": "en" } |
130 | | -``` |
131 | | - |
132 | | -**Response:** |
133 | | -```json |
134 | | -{ |
135 | | - "topic": "Photosynthesis", |
136 | | - "explanation": "Photosynthesis is the process by which...", |
137 | | - "quiz": [ |
138 | | - { |
139 | | - "question": "According to the explanation...", |
140 | | - "options": ["A) ...", "B) ...", "C) ...", "D) ..."], |
141 | | - "answer": 0, |
142 | | - "explanation": "...", |
143 | | - "difficulty": 1 |
144 | | - } |
145 | | - ] |
146 | | -} |
147 | | -``` |
148 | | - |
149 | | -## Environment Variables |
150 | | - |
151 | | -Create `.env.local` from `.env.example`: |
| 71 | +--- |
152 | 72 |
|
153 | | -```bash |
154 | | -# Required |
155 | | -OPENROUTER_API_KEY=sk-or-v1-your-key-here |
156 | | -NEXT_PUBLIC_API_URL=http://localhost:8000 |
| 73 | +## π Tech Stack |
157 | 74 |
|
158 | | -# Optional |
159 | | -NODE_ENV=development |
160 | | -``` |
| 75 | +| Layer | Technology | |
| 76 | +|-------------|-------------------------------------------------| |
| 77 | +| **Frontend** | Next.js 14 (App Router), TypeScript, Tailwind CSS | |
| 78 | +| **Backend** | FastAPI, Python 3.12, Pydantic v2 | |
| 79 | +| **AI** | OpenRouter β **GPT-OSS 120B** | |
| 80 | +| **Deploy** | Docker + docker-compose (production ready) | |
161 | 81 |
|
162 | | -## Development |
| 82 | +--- |
163 | 83 |
|
164 | | -### Code Quality |
165 | | -- TypeScript strict mode |
166 | | -- ESLint + Prettier |
167 | | -- Pre-commit hooks |
168 | | -- Docker support |
| 84 | +## π Project Structure |
169 | 85 |
|
170 | | -### Testing |
171 | 86 | ```bash |
172 | | -# Backend tests |
173 | | -cd src/backend && python -m pytest |
174 | | - |
175 | | -# Frontend tests |
176 | | -cd src/frontend && npm test |
177 | | -``` |
178 | | - |
179 | | -## Production Features |
180 | | - |
181 | | -- Production-ready code |
182 | | -- Environment-based configuration |
183 | | -- Health checks |
184 | | -- Error handling |
185 | | -- CORS support |
186 | | -- Docker deployment |
187 | | -- Vercel + Render deployment guides |
188 | | -- Emoji-free UI (professional) |
189 | | -- Responsive design |
190 | | -- Three quiz modes (Standard, Adaptive, Swipe Cards) |
191 | | - |
192 | | -## License |
193 | | - |
194 | | -MIT License - see [LICENSE](LICENSE) for details. |
| 87 | +aitutor/ |
| 88 | +βββ backend/ |
| 89 | +β βββ app/ |
| 90 | +β β βββ core/config.py # Settings (Pydantic) |
| 91 | +β β βββ models/schemas.py # Request / Response models |
| 92 | +β β βββ services/ai_service.py # All LLM logic |
| 93 | +β β βββ api/routes/tutor.py # FastAPI endpoints |
| 94 | +β β βββ main.py # App factory |
| 95 | +β βββ requirements.txt |
| 96 | +β βββ Dockerfile |
| 97 | +β βββ .env.example |
| 98 | +β |
| 99 | +βββ frontend/ |
| 100 | + βββ app/ |
| 101 | + β βββ components/tutor/ # TopicInput, QuizView... |
| 102 | + β βββ hooks/useLearn.ts # Client state + API |
| 103 | + β βββ lib/api.ts # Typed fetch |
| 104 | + β βββ page.tsx |
| 105 | + βββ tailwind.config.ts |
| 106 | + βββ next.config.mjs |
| 107 | + βββ Dockerfile |
0 commit comments