AI-powered, multilingual educational platform designed for students in rural India.
Smart Shiksha uses Retrieval-Augmented Generation (RAG) to deliver personalized, curriculum-aligned lessons in 5 Indian languages. It combines real-time web search with a large language model to generate comprehensive study material, quizzes, flashcards, and competitive exam preparation โ all accessible from a Flutter app or a lightweight web portal.
| Feature | Description |
|---|---|
| AI Lesson Generation | Ask any academic question and get a detailed, structured Markdown lesson powered by Groq LLM + Google Search (RAG pipeline) |
| 30 Indian Curricula | CBSE, ICSE, all state boards โ 1,311 subjects and 17,038 chapters pre-seeded |
| 5 Languages | English, Hindi (เคนเคฟเคจเฅเคฆเฅ), Kannada (เฒเฒจเณเฒจเฒก), Telugu (เฐคเฑเฐฒเฑเฐเฑ), Tamil (เฎคเฎฎเฎฟเฎดเฏ) |
| Quizzes | Auto-generated chapter quizzes โ MCQ, multi-select, and numerical questions |
| Flashcards | Quick-review flashcard decks per chapter |
| Competitive Exam Prep | Mock tests for JEE Mains, JEE Advanced, NEET, and Board Exams |
| AI Tutor Chat | Conversational tutoring on any academic topic |
| Offline Revision | Lessons cached locally via SQLite for offline access (desktop/mobile) |
| Dev-Mode Login | Email-based authentication for development; Auth0 Google Sign-In for production |
| Web Portal | Material 3 multi-view SPA with dashboard, AI tutor chat, lesson viewer, and dark mode โ matches the Flutter app UI |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Clients โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ Flutter App โ โ Web Portal โ โ REST Clients โ โ
โ โ (Windows/ โ โ (Material โ โ (Swagger / โ โ
โ โ Android) โ โ 3 SPA) โ โ Postman) โ โ
โ โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโ โ
โโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FastAPI Backend โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โ โ Auth โ โ Lessons โ โ Quiz โ โCompetitiveโ โ
โ โ (Auth0 โ โ (RAG) โ โ Generator โ โ Mock Testsโ โ
โ โ + JWT) โ โ โ โ โ โ โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โ โ Syllabus โ โ Progress โ โ Users โ โ
โ โ Browser โ โ Tracker โ โ Profile โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SQLite / Postgres โ โ External APIs โ
โ (10 tables) โ โ โข Groq (Llama 3.3 70B) โ
โ โ โ โข Serper (Google Search) โ
โ โ โ โข Auth0 (Google OAuth) โ
โโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
smartsiksha/
โโโ .env # API keys & secrets (not committed)
โโโ .env.example # Template for .env
โโโ .gitignore
โโโ README.md # โ you are here
โโโ HOW_TO_RUN.md # Detailed setup & run guide
โ
โโโ backend/ # FastAPI backend
โ โโโ requirements.txt # Python dependencies (pinned)
โ โโโ app/
โ โโโ main.py # App entry point, lifespan, middleware
โ โโโ config.py # Pydantic settings from .env
โ โโโ auth.py # Auth0 JWKS token verification + JWT
โ โโโ database.py # SQLAlchemy async engine + sessions
โ โโโ models.py # 10 ORM models (User, Lesson, Quiz, etc.)
โ โโโ schemas.py # Pydantic request/response schemas
โ โโโ routers/
โ โ โโโ auth.py # POST /api/auth/google, GET /api/auth/me
โ โ โโโ lessons.py # POST /api/ask, save/load lessons
โ โ โโโ quiz.py # Generate & fetch quizzes
โ โ โโโ competitive.py # Mock tests for JEE/NEET
โ โ โโโ syllabus.py # Browse curricula/subjects/chapters
โ โ โโโ progress.py # User progress tracking
โ โ โโโ users.py # User registration & profile
โ โโโ services/
โ โโโ groq_service.py # Groq LLM wrapper
โ โโโ serper_service.py # Google Search via Serper API
โ โโโ rag_pipeline.py # Search โ Context โ LLM โ Response
โ โโโ syllabus_seed.py # Seeds 30 curricula on first boot
โ
โโโ flutter_app/ # Cross-platform Flutter client
โ โโโ pubspec.yaml # Dart dependencies
โ โโโ lib/
โ โโโ main.dart # App entry point
โ โโโ app.dart # MaterialApp with routing
โ โโโ core/ # API client, constants, theme
โ โโโ l10n/ # Localization (5 languages)
โ โโโ models/ # User, Lesson, Syllabus models
โ โโโ services/ # Auth, API, DB, localization services
โ โโโ screens/ # 12 screens (login โ dashboard โ lessons โ quiz)
โ
โโโ web/ # Material 3 web portal (SPA)
โ โโโ index.html # Multi-view SPA: login, dashboard, tutor, lessons
โ โโโ css/style.css # Material 3 CSS with dark mode & responsive grid
โ โโโ js/
โ โ โโโ auth.js # Auth0 + dev-mode email login + JWT
โ โ โโโ app.js # SPA navigation stack, dashboard, AI chat
โ โ โโโ markdown.js # Secure Markdown โ HTML renderer
โ โ โโโ i18n.js # Client-side internationalization
โ โโโ locales/ # en, hi, kn, te, ta JSON files
โ
โโโ tasks/ # Development task tracking
Prerequisites: Python 3.11+, Flutter 3.22+ (optional for Flutter client), Git
git clone <repository-url>
cd smartsiksha
cp .env.example .env
# Edit .env โ add your GROQ_API_KEY and SERPER_API_KEYcd backend
pip install -r requirements.txt
python -m uvicorn app.main:app --host 0.0.0.0 --port 8001The database auto-initializes and seeds 30 curricula on first boot. API docs are at http://localhost:8001/docs.
Web portal:
cd web
python -m http.server 5500
# Open http://localhost:5500Flutter (Windows desktop):
cd flutter_app
flutter pub get
$env:CL = "/FS"
flutter run -d windowsFlutter (Android emulator):
cd flutter_app
flutter pub get
flutter emulators --launch <emulator-name>
flutter run -d <emulator-id>The Android emulator connects to the backend via
http://10.0.2.2:8001/api. Internet permission and cleartext traffic are pre-configured.
See HOW_TO_RUN.md for detailed setup instructions, troubleshooting, and all run options.
| Variable | Required | Description |
|---|---|---|
GROQ_API_KEY |
Yes | API key from console.groq.com |
GROQ_MODEL |
No | LLM model name (default: llama-3.3-70b-versatile) |
SERPER_API_KEY |
Yes | API key from serper.dev |
DATABASE_URL |
No | SQLAlchemy URL (default: local SQLite) |
AUTH0_DOMAIN |
Yes | Auth0 tenant domain (e.g. xxx.us.auth0.com) |
AUTH0_CLIENT_ID |
Yes | Auth0 SPA application client ID |
JWT_SECRET_KEY |
Yes | Random secret for JWT signing โ generate with python -c "import secrets; print(secrets.token_urlsafe(64))" |
JWT_EXPIRE_MINUTES |
No | Token lifetime in minutes (default: 60) |
DEBUG |
No | Enable dev-mode auth bypass (default: false) |
UNSPLASH_ACCESS_KEY |
No | Unsplash API key for lesson images |
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET |
/api/health |
โ | Health check |
GET |
/api/languages |
โ | List supported languages |
POST |
/api/auth/login |
โ | Auth0 Sign-In (ID token โ JWT) |
GET |
/api/auth/me |
JWT | Current user profile |
POST |
/api/auth/onboarding |
JWT | Complete curriculum onboarding |
PATCH |
/api/auth/profile |
JWT | Update profile fields |
POST |
/api/ask |
JWT | Generate AI lesson (RAG pipeline) |
POST |
/api/lessons/save |
JWT | Save a lesson |
GET |
/api/lessons/mine |
JWT | Get current user's saved lessons |
GET |
/api/syllabus/curricula |
โ | List all 30 curricula |
GET |
/api/syllabus/subjects |
โ | Subjects for curriculum/class |
GET |
/api/syllabus/chapters/{subject_id} |
โ | Chapters for a subject |
POST |
/api/quiz/generate |
JWT | Generate quiz for a chapter |
GET |
/api/competitive/exams |
JWT | List competitive exams |
POST |
/api/competitive/mock-test/generate |
JWT | Generate mock test |
Full interactive docs: http://localhost:8001/docs
- Authentication: Auth0 Google Sign-In (RS256 ID token verified via JWKS) โ backend-issued JWT (HS256); dev-mode email login available when
DEBUG=true - Authorization: All user-data endpoints enforce ownership checks
- Rate limiting: slowapi โ 10 req/min for AI generation, 30 req/min default
- Input validation: Pydantic schemas on all request bodies
- XSS protection: Escape-first Markdown renderer, CSP headers on web portal
- CORS: Restricted to explicit localhost origins (no wildcards)
- Secrets:
.envexcluded via.gitignore, no defaults for critical keys
| Layer | Technology |
|---|---|
| Backend | FastAPI ยท Python 3.11 ยท SQLAlchemy (async) ยท Pydantic |
| Database | SQLite (dev) / PostgreSQL (prod) |
| AI / LLM | Groq Cloud โ Llama 3.3 70B Versatile |
| Search | Serper API (Google Search) |
| Auth | Auth0 (JWKS / RS256) ยท python-jose JWT |
| Flutter App | Flutter 3.22+ ยท Dart ยท Provider ยท sqflite |
| Web Portal | Material 3 SPA ยท Vanilla JS ยท Custom Markdown renderer ยท i18n ยท Dark mode |
| Platforms | Windows ยท Web ยท Android ยท iOS |
| Code | Language | Script |
|---|---|---|
en |
English | Latin |
hi |
เคนเคฟเคจเฅเคฆเฅ (Hindi) | Devanagari |
kn |
เฒเฒจเณเฒจเฒก (Kannada) | Kannada |
te |
เฐคเฑเฐฒเฑเฐเฑ (Telugu) | Telugu |
ta |
เฎคเฎฎเฎฟเฎดเฏ (Tamil) | Tamil |
All AI-generated content (lessons, quizzes, flashcards) is produced natively in the selected language. The UI is fully localized across all 5 languages for both the Flutter app and the web portal.
This project was developed as part of an academic research initiative. See Smart_Shiksha_IEEE_Paper.tex for the accompanying IEEE paper.
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit changes (
git commit -m "Add your feature") - Push to the branch (
git push origin feature/your-feature) - Open a Pull Request
Please ensure all API endpoints remain backward-compatible and include tests for new features.