How aniruddhabagal/mentormind works
Main Components
• Backend Service (FastAPI):
• Entry point (main.py) initializing the FastAPI application.
• Configuration (config.py) for environment variables and API keys.
• API routes and dependencies (app/api/): These define endpoints handling user requests and AI communication.
• Activity Modules (app/activities/): Different stages of the tutoring flow (introduction, practice, assessment, review).
• Graph Management (app/graph/): Organizes the structured flow of learning activities (nodes, builder, assistant).
• AI and Learning Tools:
• Models (app/models/) for managing student state and AI configuration (e.g., llm_setup.py).
• Tools (app/tools/) that tailor subject-specific operations (math, science, language, assessment).
• Prompts (app/prompts/): Predefined prompts for guiding the AI tutor.
• Frontend Service (React):
• Main Application component (App.jsx) and entry point (index.jsx).
• UI components (under src/components/) for different interfaces like chat, dashboard, student profile, and layout.
• Service Layer (src/services/): For managing API calls to the backend.
• Supporting elements (hooks, contexts, utilities, and styles using Tailwind CSS) to manage the UI logic and global state.
Relationships and Interactions
• The frontend interacts with the backend via API endpoints represented in the app/api/routes module.
• The backend’s API layer orchestrates the flow using different activity modules and the graph structure to decide which activity to serve next.
• Student progress is managed in the models, and interactions are enhanced by the tools which use various subject-specific logic.
• The AI component (Google Gemini integration in llm_setup.py) is utilized to generate responses/feedback based on prompts and user input.
Important Architectural Patterns
• Modular Design: The separation of concerns into distinct folders (activities, graph, tools, models, and prompts).
• API Gateway/Microservices-Style for the backend using FastAPI.
• Separation of Concerns between Frontend and Backend.
• Component-Based Design on the frontend (React) that encapsulates UI elements and state management (contexts, hooks, services).
• Graph-Based Learning Flow: Using nodes and a builder to manage the sequence of tutoring interactions.
Relevant Technologies, Frameworks, and Libraries
• Backend: FastAPI (for API endpoints), Python modules for activity management, graph building, and student model tracking.
• AI Integration: Google Gemini (as configured in the llm_setup module and via environment variables).
• Frontend: React (for building the interactive UI) with Tailwind CSS for styling, along with npm-managed packages.
• Utilization of common tools such as ESLint for code quality and Vite as the build tool for the frontend.
Detail and Clarity
• Be as granular as possible—don’t hesitate to separate the backend into its defining parts (config, API, activities, graph, tools, models, prompts) and the frontend into its shared components, pages, and service layers.
Happy diagramming!