How dano796/all-in-one-fitness-app works
File structure
• Top-level:
• public/ – static assets, service-worker, manifest (PWA setup)
• src/ – main frontend code
– assets/ – audio files for timers
– components/ – reusable UI widgets (buttons, calculators, lists, loaders, chatbot, etc.)
– layouts/ – page wrappers (AuthLayout, DashboardLayout, CalculatorLayouts, etc.)
– pages/ – route-level views (Landing, Dashboard, FoodDashboard, Routines, Login, Register, etc.)
– lib/ – supabaseClient.ts (initializes Supabase connection), utils.ts
– store/ – global state management (probably Zustand)
– theme.ts / types/ / css files / main.tsx – entrypoint
• Config & tooling: tailwind.config.js, postcss.config.js, vite.config.ts, tsconfigs, eslint.config.js, vercel.json (deployment).
README for additional insights
• Frontend: React + Vite + TypeScript, Tailwind, Framer Motion, Swal
• Backend: Supabase (Auth, DB), Node/Express mentioned (but code not in this repo).
• Features: auth, calorie tracker, exercise & hydration logging, custom routines, calculators.
a. Main components:
• Browser / Mobile Client (React SPA)
• UI Layer: Components → Layouts → Pages
• State Layer: store (authStore, other global state)
• Data Layer: supabaseClient + utils
• Static Hosting: Vercel (serves index.html, JS bundle, assets, service-worker)
• Supabase Services:
• Authentication (signup, login, password recovery)
• Database (users, foods, exercises, routines, hydration logs)
• Storage (optional for image uploads via ImageUploadDragDrop)
• External Libraries: Tailwind CSS, Framer Motion, Swal, ChatBot AI API (if any)
b. Relationships & interactions:
• User interacts with the React SPA in their browser.
• SPA fetches & mutates data through supabaseClient → Supabase REST/Gotrue/PostgREST endpoints.
• State store holds user/session data and caches lists (foods, routines).
• Components dispatch actions to the store or call supabaseClient directly.
• Service-worker intercepts requests for offline support / caching.
• Hosting layer delivers the static bundle.
c. Architectural patterns / design principles:
• Single-Page Application (SPA) with client-side routing.
• Component-driven UI (atomic/reusable components).
• Layout-based page composition.
• Global state via lightweight store.
• BaaS for backend to reduce custom server code.
• PWA features (service-worker, manifest).
d. Relevant technologies:
• React, Vite, TypeScript, Tailwind CSS, Framer Motion, Swal
• Zustand (assumed) or similar for state
• Supabase (Auth, Database, Storage)
• Vercel (deployment)