How amarnathss/prepstack_ai_assistent works
Project type and purpose
• This is a full-stack web application acting as an AI-powered study assistant.
• Frontend: React + Vite + TypeScript + Tailwind/shadcn UI
• Backend: Node.js + Express + TypeScript
• Core functionality: Retrieval-Augmented Generation (RAG) pipeline, GitHub repo analysis, note management, authentication, placement prep.
File structure
• Top-level directories:
• client/ – React frontend
• server/ – Express backend
• shared/ – Shared TypeScript types/schema
• attached_assets/ – Static assets
• Config & build scripts: tsconfig.json, vite.config.ts, drizzle.config.ts, tailwind.config.ts, package.json, .env.example
• Deployment docs: VERCEL_DEPLOYMENT.md, RENDER_DEPLOYMENT.md, AZURE_DEPLOYMENT.md, etc.
Key README insights
• Tech stack calls out external services: Groq API, OpenAI embeddings, GitHub API, PostgreSQL (Neon), Drizzle ORM.
• Features: file uploads (PDF/DOCX/TXT), intelligent search & indexing, JWT auth, role-based access, real-time chat.
Main components and relationships
a. Components
– Client Application (React SPA)
– Backend API Server (Express/Node)
– Database (PostgreSQL via Drizzle ORM)
– File Storage (local or cloud storage for uploads)
– Shared Schema Layer
– External AI Services:
• Groq AI inference
• OpenAI Embeddings API
– External Integration: GitHub API
– Authentication Layer (JWT)
b. Interactions
– User’s browser ↔ React app (HTTP/WebSocket for chat)
– React app ↔ Backend API (REST/HTTP)
– Backend ↔ Database (Drizzle ORM)
– Backend ↔ File storage (Multer + disk/cloud)
– Backend ↔ External AI Services (Groq, OpenAI) for RAG pipeline
– Backend ↔ GitHub API for repo analysis
– Backend enforces JWT-based auth for protected routes
c. Architectural patterns
– Separation of concerns: UI layer vs. API layer vs. data layer
– Service-oriented modules in server/services (fileProcessor, ragService, githubService, groqService)
– Shared types for consistency (shared/schema.ts)
– TanStack Query for data-fetch caching
d. Key technologies
– Vite dev server & build
– React 18 + TypeScript + Tailwind + shadcn/ui
– Express.js with TypeScript
– PostgreSQL + Drizzle ORM
– JWT, bcrypt, Multer
– Groq API, OpenAI Embeddings
– GitHub OAuth/Personal Access Token
Detailed capture of architectural elements
• Don’t just lump “Server”: break it into Layers
• Routes (server/routes.ts)
• Services (fileProcessor, ragService, githubService, groqService, groqService)
• Storage (server/storage.ts + Drizzle ORM)
• Authentication flow:
• LoginForm.tsx → /api/auth/login → JWT issued → stored in client
• Chat subsystem:
• Deployment considerations:
• Separate deployment of frontend (Vercel) and backend (Render/Azure)