How utshobbose/fittrack works
Project type and purpose
• FitTrack is a full-stack fitness management web application. Its goal is to help users manage accounts, calculate BMI/calorie needs, plan meals, track water intake, browse recipes, purchase products, log workouts (including AI-generated yoga and workout routines), view nearby gyms on a map, and monitor progress over time.
File structure
• Top-level directories
– frontend: React + Tailwind SPA
– backend: Express.js REST API
• Backend layers (MVC)
– controllers: HTTP handlers for each domain (User, Product, Order, Recipe, Progress, WorkoutAI, YogaAI)
– models: Mongoose schemas for MongoDB
– routes: Route definitions mapping URLs to controllers
– middleware: Authentication (AuthMiddleware)
– server.js: App setup, middleware registration, route mounting, DB connection
• Frontend structure
– public: static assets (audio files)
– src/components: reusable UI pieces (BMI calculator, trackers, lists, forms, cards, AI generators, video/music grids)
– src/pages: top-level routes/views (home, dashboard, shop, checkout, trackers, AI pages, 404)
– src/context: React Context providers for API calls and authentication state
– build/config: Vite, Tailwind, ESLint, PostCSS, Vercel config
README insights
• Tech stack: React, Tailwind CSS, Express.js, MongoDB
• External integrations: Open Street Maps API (gym locator), Groq AI API (yoga/workout routine generation)
a. Main components
1. Client (Browser) – React SPA served via Vite/production build
2. API Gateway / Web Server – Express.js app in Node.js
3. Database – MongoDB (self-hosted or Atlas)
4. External Services –
• Open Street Maps API
• Groq AI API
5. Static Asset Storage – CDN or Node static server for public/music files
b. Relationships & interactions
• Browser ↔︎ Express API over HTTPS (REST endpoints)
• Express → MongoDB via Mongoose driver
• Express → Open Street Maps API for gym location lookups
• Express → Groq AI API for yoga/workout routine generation
• Browser state management via React Context for auth and API layer
• Static assets served from /public or CDN
c. Architectural patterns
• Backend: Monolithic RESTful service following MVC (Models/Controllers/Routes) + middleware for auth
• Frontend: Component-based SPA, client-side routing, context for cross-cutting concerns
• Separation of concerns: UI, business logic, data layer separated across tiers
d. Key technologies & libraries
• Frontend: React, React Router, Tailwind CSS, Vite, PostCSS
• Backend: Node.js, Express.js, Mongoose, JSON Web Tokens (AuthMiddleware)
• Database: MongoDB
• External APIs: Open Street Maps, Groq AI
Detail
• Break the backend into its modules: AuthMiddleware intercepts → Route handlers dispatch to Controller → Controller uses Models → Models talk to MongoDB
• On the frontend, illustrate how Context wraps the App, how pages import components, and how API calls flow through the context layer
• Edge-case flows: public vs. protected routes, error handling paths