Studify is an end-to-end AI learning platform that helps learners go from zero to mastery in any subject through structured courses, AI-generated lessons, adaptive quizzes, and an optional interactive AI tutor β all secured with Microsoft Entra ID External (CIAM) authentication.
It is designed to feel like a personalised digital classroom: you define what you want to learn, and the platform builds, teaches, tests, and guides you step-by-step.
Users sign in using Microsoft Entra External ID (CIAM). Authentication is handled via OAuth 2.0 / OpenID Connect, ensuring enterprise-grade security from the very first interaction.
Users can create a new course by specifying:
- Subject
- Subtopics
- Difficulty level
After login, users land on their dashboard, where they can view all existing courses or start a new one.
Studify uses AI to generate a structured curriculum tailored to the learner's intent and skill level.
Learners can optionally enable an AI Tutor, which opens in a split-screen layout. The tutor can:
- Answer questions about the lesson
- Clarify confusing concepts
- Accept text and image input
After completing a lesson, users can generate a quiz to test their understanding.
Questions are dynamically created based on lesson content and learning objectives.
Once submitted, quizzes are:
- Automatically graded by AI
- Evaluated for correctness and reasoning
- Annotated with helpful feedback and improvement advice
For incorrect answers, Studify explains:
- Why the answer is wrong
- What the correct approach is
- How to avoid similar mistakes in the future
- AI-generated lesson plans and structured curricula
- Dynamic lesson generation and section expansion
- Adaptive quizzes with AI grading
- Progress tracking
- Optional AI Tutor chat (text + image input)
- Secure authentication & authorisation with Microsoft Entra External ID
.
βββ backend/
β βββ api.py # FastAPI entry point
β βββ learning_platform.py # Core orchestration layer
β βββ requirements.txt
β βββ documentation/
β β βββ postman.md # API collection notes
β βββ lesson_plans/
β β βββ lesson_plan_service.py
β βββ lessons/
β β βββ lesson_service.py
β βββ quizzes/
β β βββ quiz_service.py
β βββ progress/
β β βββ progress_service.py
β βββ users/
β β βββ auth.py # Entra ID JWT validation
β β βββ user_creation.py
β βββ shared/
β βββ models.py # Pydantic models
β βββ cosmos_client.py # Azure Cosmos DB client
β βββ openai_client.py # OpenAI wrapper
β βββ cosmos-rbac-guide.md
β
βββ frontend/
β βββ README.md
β βββ next.config.ts
β βββ next-env.d.ts
β βββ public/
β βββ src/
β βββ app/
β β βββ api/tutor-chat/route.ts
β β βββ layout.tsx
β β βββ ClientLayout.tsx
β β βββ page.tsx
β βββ components/
β β βββ Platform.tsx # Main app UI
β β βββ AITutorChat.tsx
β β βββ LoginPage.tsx
β β βββ views/
β β βββ CreateCourseView.tsx
β β βββ LessonView.tsx
β β βββ QuizView.tsx
β β βββ QuizResultView.tsx
β βββ lib/
β β βββ authConfig.ts # MSAL configuration
β β βββ msalInstance.ts
β βββ types/
β βββ api.ts
β
βββ README.md
The system consists of a FastAPI backend and a Next.js (App Router) frontend, secured using Microsoft Entra ID External (CIAM).
- Frontend: Next.js (React, App Router) using
@azure/msal-react - Backend: FastAPI with JWT validation via Microsoft Entra External ID
- Auth: OAuth2 / OpenID Connect (Authorisation Code + PKCE)
- Storage: Azure Cosmos DB
- AI: Azure OpenAI APIs for content generation and grading
COSMOS_DB_ENDPOINT=<endpoint-name>
AZURE_OPENAI_ENDPOINT=https://<endpoint-name>.cognitiveservices.azure.com/
AZURE_OPENAI_KEY=<api-key>
DEPLOYMENT_NAME=<deployment-name>
TENANT_ID=<your-tenant-id>
CLIENT_ID=<backend-app-client-id>NEXT_PUBLIC_AZURE_CLIENT_ID=<frontend-client-id>
NEXT_PUBLIC_AZURE_AUTHORITY=https://<TENANT_ID>.ciamlogin.com/<TENANT_ID>
NEXT_PUBLIC_AZURE_KNOWN_AUTHORITY=<TENANT_ID>.ciamlogin.com
NEXT_PUBLIC_AZURE_REDIRECT_URI=http://localhost:3000
NEXT_PUBLIC_API_SCOPE=api://<BACKEND_CLIENT_ID>/access_as_user
AZURE_OPENAI_ENDPOINT=<openai-api-endpoint>
AZURE_OPENAI_KEY=<api-key>
DEPLOYMENT_NAME=<deployment-name>- Node.js 18+
- Python 3.14+
- Azure Entra External ID tenant
- Azure Cosmos DB
- OpenAI API key
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn api:app --reload --port 8000API will be available at:
http://localhost:8000
http://localhost:8000/docs
cd frontend
npm install
npm run devFrontend will be available at:
http://localhost:3000
- Swagger UI:
/docs - Postman notes:
backend/documentation/postman.md
- Restrict CORS origins
- Cache JWKS keys with rotation support
- Use HTTPS everywhere
- Store secrets in Azure Key Vault
- Enable conditional access policies in Entra ID
This project is licensed under the terms of the MIT Licence.




