How romeirofernandes/clarityai works
Project type and purpose
• ClarityAI is a full-stack web application that transforms static PDFs into dynamic learning materials (summaries, flashcards, quizzes) and supports active recall via speech-to-text and AI feedback.
File structure
• Top-level “frontend” and “backend” folders indicate a two-tier architecture.
• The backend follows an MVC-style layout:
• config/ (db.js) for database connections
• models/ (User, Deck, Streak)
• controllers/ (userController)
• routes/ (deckRoutes, revision, transcribe, upload, etc.)
• server.js to wire everything up
• The frontend is a React/Vite app with:
• src/pages/ for individual screens
• src/components/ for reusable UI modules
• src/Api/Auth.js and axios util for HTTP calls
• firebase.config.js for Firebase Authentication
• Key config files:
• backend/.nixpacks.toml, package.json, .env references
• frontend/vite.config.js, vercel.json, .env for VITE_API_URL and Firebase variables
README for additional insights
• Tech stack summary confirms: React + Tailwind CSS + Framer Motion + Axios on the front; Node/Express + Mongoose/MongoDB on the back; PDF-parse for parsing; Google Gemini AI for generative tasks; Web Speech API for transcription; Firebase for auth.
• Features map 1:1 to backend routes (upload, transcribe, revision, streaks, decks, users).
Capturing essential architectural elements
• Don’t omit the MVC substructure in the backend.
• Speech-to-text route’s dual interaction: client’s Web Speech API → backend transcribe route → Gemini or local engine.
• If deployed on Vercel or another platform, optionally include a “Deployment” layer showing Vercel for frontend and your hosting provider (e.g., Heroku, AWS) for the backend/API.