How dharshan2208/examgenius works
Project Type & Purpose
• ExamGenius is a full-stack web application designed for assisting students in exam preparation through automatic syllabus analysis, resource curation, and personalized study plan generation.
• The system uses AI integrations (Gemini, Tavily, Langchain) to analyze documents and provide recommendations.
• The frontend is built with React/TypeScript and the backend with FastAPI (Python), containerized using Docker and Docker Compose.
Analyzing the File Structure
• The file tree shows distinct folders for “backend” and “frontend”, indicating a clear separation of concerns.
• In the backend, look at the “app/api/routes” which holds various endpoints (exam papers, study plans, syllabus, and resources). This layers the API controller part of the architecture.
• The “services” directory includes key files like gemini_service.py, langchain_service.py, and study_plan_generator.py, which encapsulate business logic and interactions with external APIs.
• The “models” directory holds domain entities (exam paper, study plan, syllabus, etc.) and illustrates the data aspect of the application.
• The frontend contains a typical React/Vite application structure with components (UI features, layout), context, hooks, and pages for different functionalities.
a. Main Components:
• Frontend Application:
• Built with React & TypeScript.
• Contains UI components, routing (React Router), theme (Material UI), and context/hook layers.
• Acts as the presentation layer from which users interact with the system.
• Backend API Server:
• Built using FastAPI.
• API Routes: Endpoints for exam papers, study plans, syllabus processing, resources.
• Core Business Logic: Organized into “services” (Gemini, Tavily, Langchain, study plan generator) and “utils” (file processing, Pareto analysis, etc.).
• Models and Config: Represent the domain and configuration for the application (security, config settings).
• External AI Services:
• Gemini API and Tavily API are integrated via the backend services.
• Containerization:
• Dockerfiles for both frontend and backend.
• Docker Compose configuration that orchestrates the multi-container setup.
b. Relationships & Interactions:
• The Frontend communicates with the Backend API over HTTP(s) (via defined endpoints).
• The Backend API routes delegate tasks to various services (e.g., language processing, resource curation).
• Business logic modules in the services layer invoke external APIs (Gemini, Tavily) and use utility functions for processing.
• The containerization layer (Docker/Docker Compose) coordinates starting both parts and linking them in a network.
Architectural Patterns & Key Technologies
• MVC / API Controller Pattern: Clear separation between API routes (controllers), models (domain entities), and services (business logic).
• Containerized Deployment: Both frontend and backend are built into separate Docker images and managed with Docker Compose.
• Microservice-Like Service Layer: Even though contained in one backend, the separation of services (Gemini, Langchain, etc.) hints at loosely-coupled functionalities.
• Use of modern web technologies such as Vite for frontend bundling and FastAPI (with Uvicorn) for async backend processing.
• Under the Backend section, subdivide it into:
• API Routes: Represent routes like exam papers, study plans, etc.
• Service Layer: Represent Gemini Service, Langchain Service, Resource Curation, and Study Plan Generator.
• Utility Module: Include supportive roles such as file processing and outline any core configurations (security, config).
• Docker and Docker Compose as an encompassing layer managing both the frontend and backend deployment.