Skip to content

Studify, a free-for-all education platform using generative AI to create dynamic learning content.

License

Notifications You must be signed in to change notification settings

ghchen99/studify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

193 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Studify Logo Studify

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.


🧭 How It Works (End-to-End Experience)

πŸ” Secure Login with Microsoft Entra ID

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.

πŸ“š Create AI-Generated Courses in Seconds

Users can create a new course by specifying:

  • Subject
  • Subtopics
  • Difficulty level

Demo GIF

After login, users land on their dashboard, where they can view all existing courses or start a new one.


🧠 AI-Generated Lessons with an Interactive Tutor

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

Demo GIF


πŸ“ Adaptive Quizzes to Test Understanding

After completing a lesson, users can generate a quiz to test their understanding.
Questions are dynamically created based on lesson content and learning objectives.

Demo GIF


βœ… AI Grading with Actionable Feedback

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

Demo GIF


✨ Features

  • 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

πŸ“ Repository Structure

.
β”œβ”€β”€ 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

🧠 Architecture Overview

System Architecture

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

Environment Variables (Backend)

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>

Environment Variables (Frontend)

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>

πŸš€ Local Development Setup

Prerequisites

  • Node.js 18+
  • Python 3.14+
  • Azure Entra External ID tenant
  • Azure Cosmos DB
  • OpenAI API key

Backend Setup

cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn api:app --reload --port 8000

API will be available at:

http://localhost:8000
http://localhost:8000/docs

Frontend Setup

cd frontend
npm install
npm run dev

Frontend will be available at:

http://localhost:3000

πŸ§ͺ API Testing

  • Swagger UI: /docs
  • Postman notes: backend/documentation/postman.md

⚠️ Production Notes

  • 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

πŸ“œ Licence

This project is licensed under the terms of the MIT Licence.

About

Studify, a free-for-all education platform using generative AI to create dynamic learning content.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published