How ankitsharma-at/teachmeai works
Project Type and Purpose
• TeachMe is a full-stack web application:
• Frontend: React + TypeScript SPA (Vite, Tailwind CSS)
• Backend: Node.js + Express API
• AI Integration: Gemini LLM for summarization and quiz generation
• Purpose: Allow users to upload PDFs, extract text, generate summaries and quizzes, and display results interactively.
File Structure
• Frontend/
• src/pages: Chat, Quiz, Scorecard, Upload flows
• src/components: UI building blocks (Navbar, PdfUploader, ChatSummary, MarkdownRenderer)
• src/hooks & context: state management (PDF context, chat logic, dark mode)
• src/services/api.ts: HTTP client to backend
• backend/
• src/server.js & index.js: Express application entry points
• src/routes: aiRoutes, chatRoutes, pdfRoutes, quizRoutes—maps HTTP endpoints
• src/services: business logic layers (chatService, pdfService, summaryService, quizService)
• src/utils: errorHandler, promptTemplates, resSplit – utilities and templates
• src/config/gemini.js: LLM client configuration
README Insights
• User → Frontend → PDF extraction → Backend → Gemini → summary/quiz → Frontend → User
• Technology stack and key features confirm core components and interactions.
a. Main Components
1. User (Web Browser)
2. Frontend SPA (React + Vite + Tailwind)
3. PDF Extraction Module (react-pdftotext in browser)
4. Backend API (Express)
5. AI Service (Gemini LLM)
6. Data Flow: Summary, Quiz Questions, User Answers, Feedback
b. Relationships & Data Flow
c. Architectural Patterns & Design Principles
• Layered Architecture:
• Presentation Layer (React components & pages)
• Application Layer (frontend services & hooks)
• API Layer (Express routes → controllers)
• Business Logic Layer (service modules: pdfService, chatService, quizService)
• Integration Layer (Gemini LLM client)
• Separation of Concerns: distinct folders for config, routes, services, utils
• Stateless RESTful API design
d. Key Technologies
• Frontend: React, TypeScript, Vite, Tailwind CSS, react-pdftotext, MARKDOWNRENDER
• Backend: Node.js, Express.js, Gemini LLM client
• Dev Tools: ESLint, PostCSS, Tailwind config
Detailed Capture of Architectural Elements
• Express route and the service it invokes
• Frontend page flow: Upload → Chat → Quiz → Scorecard
• Context providers and custom hooks managing state
• Config files (vite.config.ts, gemini.js) to indicate build & integration points