How pranay-dommati/thestudent works
1. Repository shape
- This is a monorepo for an AI learning ecosystem with one shared Django backend and several independently deployed React frontends.
- The frontends correspond to different product surfaces: the main marketing/product site, the courses platform, Scrib notes generator, and the code visualizer.
2. Top-level boundary: UI layer vs backend layer
- The React apps handle routing, presentation, client-side state, local caching, and some offline behavior.
- The Django backend is the system of record for authentication, courses, AI content generation, analytics/tracking, payments, feedback, and file/media storage.
3. Backend core
- backend/backend is the Django project shell: settings, URL routing, WSGI/ASGI entrypoints, middleware, Celery setup, DB helpers, and security layers.
- App-level routing is split by domain so each product area can evolve independently while still sharing the same runtime and database.
4. Identity and user lifecycle
- backend/authentication owns the custom user model, OTP/email verification, login pipelines, rate limiting, and onboarding flags.
- This auth layer is consumed by all frontends through shared API calls and context/state wrappers, so user identity is centralized even though the UI surfaces are separate.
5. Courses domain
- backend/courses is the largest business domain: course models, chapters/sections/lessons, quizzes, resources, certifications, drafts, and admin tooling.
- It supports both school-style and engineering-style course structures, which is why there are parallel serializers, views, validators, and multiple admin/edit forms on the frontend.
- Media-heavy outputs such as certificates and lesson resources are stored under backend/media, while sample data and exports live in backend/fixtures_export and data/.
6. AI content generation layer
- backend/backend/ai contains the content-generation services for reading, summaries, quizzes, topics, resources, videos, and YouTube-backed enrichment.
- This layer also includes sanitization and rate limiting, indicating that model output is treated as untrusted and must be constrained before it reaches the UI.
- The README’s Gemini/LLM integration is reflected here, and the architecture suggests AI calls are made server-side rather than directly from the browser.
7. Scrib subsystem
- backend/scrib implements the AI notes-generation product: topic input, PDF/image generation, promo/coupon logic, payment hooks, cohort toggles, caching, and tasks.
- The Scrib frontend is a separate web app that talks to this backend for generation workflows and user billing/access state.
- Generated artifacts are persisted as files in media storage, and the app appears to use background processing for heavier generation steps.
8. Code visualizer subsystem
- backend/code_visualizer is a distinct backend domain for execution tracing, sandboxed runs, narration, and “why” explanations.
- The corresponding frontend contains a dedicated visualization engine with step parsing, timeline orchestration, rendering, and input generation, so most of the visualization logic lives client-side.
- The backend side appears to store execution/session data and provide AI-assisted explanations rather than doing the full visualization itself.
9. Learning assistant / chatbot retrieval
- backend/chatbotcourse adds a retrieval-based educational bot backed by a local vector_store.index.
- This is a separate knowledge-serving path from the general LLM content generation stack: instead of generating from scratch, it retrieves from indexed course content.
10. Operational and product-support subsystems
- backend/tracking, backend/feedback, backend/newsletter, and backend/payments are support domains around engagement, forms, subscriptions, and monetization.
- These are smaller than courses/auth but important because they feed analytics, user feedback loops, and payment state back into the product surfaces.
11. Shared frontend architecture
- The React frontends reuse many cross-cutting modules: auth context, API wrappers, axios clients, markdown rendering, offline handling, toast/notification utilities, and mobile layouts.
- There is significant shared UI logic across apps, but each deployed frontend still has product-specific page trees and workflows.
- The code visualizer frontend is the most specialized, with its own rendering engine; the other frontends are more content- and workflow-oriented.
12. Data and infrastructure boundaries
- The primary persistence layer is MySQL per the README, with migration-heavy Django models and tooling for exports/imports and DB checks; some scripts indicate Postgres migration/export support in certain environments.
- Files, certificates, PDFs, thumbnails, and generated artifacts live in the filesystem-backed media tree, while code-visualizer and chatbot subsystems also rely on local assets such as indexes and cached outputs.
- Celery is present for asynchronous jobs, and the repo includes deployment scripts and platform-specific entrypoints for hosting on web infrastructure like Render/Hostinger.
13. End-to-end request flow
- A typical flow is: browser UI → frontend service layer (axios/API helpers) → Django app route → model/DB and/or AI provider → media/file output or JSON response → frontend rendering and caching.
- For generation-heavy features, the flow can extend into background tasks and then back to the UI via polling, refreshed state, or download links.
14. How to draw the architecture
- Model this repo as a central Django platform with several domain apps, surrounded by multiple thin-to-medium React clients.
- Show shared backend services for auth, courses, AI generation, payments, tracking, and feedback.
- Show separate product-specific client surfaces for Courses, Scrib, Code Visualizer, and the main platform, each consuming the same core backend but with different local logic and UI complexity.
Main entry points: backend Django shell · start_server.sh Deploy tooling · authentication Authentication · courses Courses domain
Components 18
React frontends
Independent client surfaces that share backend APIs and cross-cutting UI services.
- Main site · Primary marketing and product surface with shared auth, courses, learning hub, and admin entry points.
frontend - Courses app · Dedicated courses and learning experience with AI-assisted learning workflows and course browsing.
courses-frontend - Scrib app · Notes-generation product UI for topic input, previews, PDFs, billing, and user access state.
scrib-frontend - Code visualizer · Specialized visualization client with a rich client-side engine for step parsing and rendering.
codevisualizer-frontend
Django platform
Shared backend runtime with domain apps, AI services, and request routing.
- Django shell · Project-level settings, routing, middleware, Celery, WSGI/ASGI entrypoints, and DB utilities.
backend/backend - Authentication · Custom users, OTP/email verification, login pipeline, onboarding flags, and rate limiting.
backend/authentication - Courses domain · Course content, chapters, lessons, quizzes, resources, certifications, drafts, validators, and admin workflows.
backend/courses - AI services · Server-side generation for reading, summaries, quizzes, topics, resources, videos, YouTube enrichment, and sanitization.
backend/backend/ai - Scrib backend · Notes generation, PDF/image output, promo/coupon logic, payments hooks, cohort toggles, caching, and tasks.
backend/scrib - Visualizer backend · Execution sessions, sandboxed runs, tracing, narration, and AI-assisted 'why' explanations.
backend/code_visualizer - Chatbot retrieval · Course-aware retrieval bot backed by a local vector index for educational lookup.
backend/chatbotcourse - Support domains · Tracking, feedback, newsletter, and payments domains that feed product engagement and monetization.
- Async jobs · Background task execution for generation-heavy workflows and deferred processing.
backend/backend/celery.py
Data and runtime assets
Persistent files, exports, and operational artifacts used by backend services.
- Media store · Certificates, lesson resources, Scrib packs, thumbnails, and other generated artifacts.
backend/media - Fixture exports · Exported datasets for auth, courses, feedback, tracking, and newsletter state.
backend/fixtures_export - Sample data · Engineering and school course samples plus importable seed datasets used by tooling.
data - Vector index · Local index used by the chatbot retrieval path.
backend/chatbotcourse/vector_store.index
Deployment and tooling
Repository-level scripts and hosting glue for local and production environments.
- Deploy tooling · Startup, migration, export/import, Render/Hostinger entrypoints, and server bootstrap scripts.
backend/start_server.sh
Connections 27
- Main site → Django shell: API calls · Main site talks to shared backend routes for auth, courses, learning hub, and admin actions.
- Courses app → Django shell: API calls · Courses app consumes the shared backend for catalog, learning, progress, and profile data.
- Scrib app → Django shell: API calls · Scrib app uses the backend for generation workflows, billing, and access checks.
- Code visualizer → Django shell: API calls · Visualizer client uses backend services for sessions, tracing, and explanations.
- Django shell → Authentication: routes auth · Central project routes identity and session-related endpoints to the auth app.
- Django shell → Courses domain: routes courses · Course-related endpoints are split into the courses domain.
- Django shell → AI services: routes ai · AI generation endpoints are exposed through the shared AI module.
- Django shell → Scrib backend: routes scrib · Scrib-specific endpoints are mounted from the shared project shell.
- Django shell → Visualizer backend: routes visualizer · Execution and explanation endpoints are mounted for the code visualizer domain.
- Django shell → Chatbot retrieval: routes chatbot · Retrieval bot endpoints are exposed as a separate knowledge-serving path.
- Django shell → Support domains: routes support · Tracking, feedback, newsletter, and payments are exposed as shared support domains.
- Authentication → Main site: shared identity · All frontends rely on the centralized user model and auth flows.
- Authentication → Courses app: shared identity · Courses UI uses the same auth and onboarding state.
- Authentication → Scrib app: shared identity · Scrib UI shares the same account and OTP flows.
- Authentication → Code visualizer: shared identity · Visualizer UI uses centralized auth context and API wrappers.
- Courses domain → Media store: stores files · Course certificates and lesson resources are persisted to media storage.
- Scrib backend → Media store: stores packs · Generated PDFs and note packs are written to media storage.
- Chatbot retrieval → Vector index: retrieves from · The chatbot serves answers from the local vector index.
- Scrib backend → Async jobs: background work · Heavier Scrib generation tasks can be delegated to async workers.
- AI services → Async jobs: background work · Generation-heavy AI workflows can be deferred to background execution.
- Deploy tooling → Django shell: starts · Scripts and entrypoints launch the Django runtime in different environments.
- Deploy tooling → Main site: builds · Repository tooling also serves the main React app for deployment.
- Deploy tooling → Courses app: builds · Deployment scripts target the courses frontend as a separate client.
- Deploy tooling → Scrib app: builds · Deployment scripts target the Scrib frontend as a separate client.
- Deploy tooling → Code visualizer: builds · Deployment scripts target the visualizer frontend as a separate client.
- Courses domain → Fixture exports: exports data · Course and auth state are exported for seeding and migration support.
- Courses domain → Sample data: imports samples · Course admin and testing flows use sample school and engineering data.