# adityaghate66-sketch/crowdliftt architecture

> Architecture diagram of the GitHub repository adityaghate66-sketch/crowdliftt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adityaghate66-sketch/crowdliftt
- Repository: https://github.com/adityaghate66-sketch/crowdliftt

## Overview

1. **Overall shape**
   - This repo is a **static, browser-only frontend** made of multiple HTML pages, each paired with its own CSS and JavaScript file.
   - There is **no custom backend in the repo**; backend-like behavior is outsourced to **Supabase** for realtime data and **Open-Meteo** for weather.

2. **Page-level architecture**
   - The app is split into distinct user journeys:
     - `index.html` / `index.js` / `index.css`: landing page
     - `login.html` / `login.js` / `login.css`: sign-in
     - `signup.html` / `signup.js` / `signup.css`: onboarding and account creation
     - `home.html` / `home.js` / `home.css`: main dashboard
     - `exLibrary.html` / `exLibrary.js` / `exLibrary.css`: exercise library
     - `biteclub.html` / `biteclub.js` / `biteclub.css`: diet and nutrition tools
     - `about.html`: informational page
   - This is a **multi-page app**, not a single bundled SPA.

3. **Primary interaction boundary**
   - The core product boundary is the **gym crowd dashboard** on `home.html`.
   - Users check in/out, pick a muscle group, and view live crowd state for that gym segment.
   - The dashboard is the central place where realtime crowd data, predictions, attendance history, and weather-derived advice come together.

4. **Realtime data layer**
   - **Supabase** is the main external state store and sync layer.
   - Crowd updates are written to Supabase when users check in/out, then broadcast back to all clients via **realtime subscriptions**.
   - This creates a shared live view across users without any repository-hosted server code.

5. **Weather integration**
   - `home.js` also calls the **Open-Meteo API** for Bengaluru weather.
   - Weather data is combined with gym crowd information to generate a practical “gym crowd tip” or contextual suggestion.
   - This is a separate external dependency from the crowd data path, so the dashboard has two independent async sources.

6. **Derived analytics on the client**
   - Several features appear to be computed in the browser from user activity and/or stored records:
     - crowd predictor for day/time
     - weekly heatmap
     - workout calendar
     - streak tracker
     - personalized 7-day workout plan
   - These are likely **client-side derived views**, not separate services.

7. **Onboarding and identity flow**
   - `login.html` and `signup.html` handle user entry into the app.
   - The README says signup includes **2-step onboarding** collecting age, weight, height, goal, and activity level.
   - Those profile inputs feed later personalization in the dashboard and diet tools, making onboarding a key data-collection boundary.

8. **Exercise library subsystem**
   - `exLibrary.*` is a self-contained content and discovery area for workouts.
   - It covers 30+ exercises across six muscle groups and supports search/filter behavior.
   - The search box uses debouncing, so this page is optimized for client-side filtering rather than server queries.

9. **Nutrition / BiteClub subsystem**
   - `biteclub.*` is a separate nutrition module branded as **BiteClub**.
   - It provides BMI, BMR, and TDEE calculators plus meal-plan content.
   - This feature set is independent from the crowd dashboard, but it likely uses the same onboarding profile inputs for personalization.

10. **Navigation and shared presentation**
   - Each page has its own stylesheet, which suggests **page-scoped styling** rather than a shared component system.
   - The architecture is intentionally simple: page-specific JS drives DOM behavior, page-specific CSS controls layout and theme, and HTML provides the entry point for each subsystem.

11. **Runtime model**
   - The entire app runs in the **browser** using vanilla JavaScript, `fetch`, async/await, DOM events, and standard client-side state.
   - There is no evidence of a framework, bundler, or compiled frontend layer.
   - Deployment is via **Netlify**, which fits the static-site model.

12. **Key data flows for an architecture diagram**
   - **User → login/signup → profile/onboarding data**
   - **User → home dashboard → Supabase write → realtime broadcast → other clients**
   - **Home dashboard → Open-Meteo → weather/tip UI**
   - **User activity/attendance → client-side derived analytics → calendar/streak/predictor**
   - **User inputs → BiteClub calculators → nutrition outputs**
   - **Search/filter input → exercise library → filtered exercise cards**

13. **Architectural takeaway**
   - CrowdLift is best understood as a **static multi-page frontend with BaaS-backed realtime sync**.
   - Its main separation is by feature area: crowd tracking, exercise reference, nutrition tools, and onboarding/landing pages.
   - The only external system-level dependencies are **Supabase** for shared state and **Open-Meteo** for weather enrichment.

Main entry points: [`home.html`](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.html) (Dashboard), [`index.html`](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/index.html) (Landing), [`home.js`](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.js) (Check-in flow), [`login.html`](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/login.html) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry & auth"]
  node_index_page["Landing<br/>page<br/>[index.html]"]
  node_login_page["Login<br/>page<br/>[login.html]"]
  node_signup_page["Signup<br/>page<br/>[signup.html]"]
  node_about_page["About<br/>page<br/>[about.html]"]
  node_profile_inputs[("Profile data<br/>onboarding data")]
end

subgraph group_dashboard["Crowd dashboard"]
  node_home_page["Dashboard<br/>page<br/>[home.html]"]
  node_crowd_actions["Check-in flow<br/>crowd logic<br/>[home.js]"]
  node_live_sync["Realtime sync<br/>state sync<br/>[home.js]"]
  node_weather_fetch["Weather fetch<br/>integration<br/>[home.js]"]
  node_crowd_tip{{"Crowd tip<br/>derived advice<br/>[home.js]"}}
  node_derived_analytics["Derived views<br/>client analytics<br/>[home.js]"]
end

subgraph group_tools["Reference tools"]
  node_exlibrary_page["Exercise library<br/>page<br/>[exLibrary.html]"]
  node_exercise_filter["Search filter<br/>client filtering<br/>[exLibrary.js]"]
  node_exercise_catalog[("Exercise catalog<br/>content set<br/>[exLibrary.js]")]
  node_biteclub_page["BiteClub<br/>page<br/>[biteclub.html]"]
  node_nutrition_calc["Calculators<br/>nutrition logic<br/>[biteclub.js]"]
  node_meal_plans["Meal plans<br/>nutrition content<br/>[biteclub.js]"]
end

subgraph group_external["External services"]
  node_supabase[("Supabase<br/>external BaaS")]
  node_open_meteo[("Open-Meteo<br/>weather API")]
end

node_index_page -->|"sign in"| node_login_page
node_index_page -->|"join"| node_signup_page
node_index_page -->|"enter"| node_home_page
node_index_page -->|"about"| node_about_page
node_login_page -->|"authenticated"| node_home_page
node_signup_page -->|"collects"| node_profile_inputs
node_profile_inputs -->|"personalizes"| node_home_page
node_profile_inputs -->|"personalizes"| node_biteclub_page
node_home_page -->|"controls"| node_crowd_actions
node_crowd_actions -->|"write"| node_supabase
node_supabase -->|"broadcast"| node_live_sync
node_live_sync -->|"refreshes"| node_home_page
node_home_page -->|"requests"| node_weather_fetch
node_weather_fetch -->|"query"| node_open_meteo
node_weather_fetch -->|"feeds"| node_crowd_tip
node_crowd_actions -->|"inputs"| node_derived_analytics
node_derived_analytics -->|"renders"| node_home_page
node_home_page -->|"shows"| node_crowd_tip
node_exlibrary_page -->|"drives"| node_exercise_filter
node_exercise_filter -->|"filters"| node_exercise_catalog
node_biteclub_page -->|"runs"| node_nutrition_calc
node_nutrition_calc -->|"produces"| node_meal_plans

click node_index_page "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/index.html"
click node_login_page "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/login.html"
click node_signup_page "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/signup.html"
click node_about_page "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/about.html"
click node_home_page "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.html"
click node_crowd_actions "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.js"
click node_live_sync "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.js"
click node_weather_fetch "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.js"
click node_crowd_tip "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.js"
click node_derived_analytics "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.js"
click node_exlibrary_page "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/exLibrary.html"
click node_exercise_filter "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/exLibrary.js"
click node_exercise_catalog "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/exLibrary.js"
click node_biteclub_page "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/biteclub.html"
click node_nutrition_calc "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/biteclub.js"
click node_meal_plans "https://github.com/adityaghate66-sketch/crowdliftt/blob/main/biteclub.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_index_page,node_login_page,node_signup_page,node_about_page,node_profile_inputs toneBlue
class node_home_page,node_crowd_actions,node_live_sync,node_weather_fetch,node_crowd_tip,node_derived_analytics toneAmber
class node_exlibrary_page,node_exercise_filter,node_exercise_catalog,node_biteclub_page,node_nutrition_calc,node_meal_plans toneMint
class node_supabase,node_open_meteo toneRose
```

## Components

### Entry & auth

Landing, sign-in, signup, and about pages

- [Landing](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/index.html): page · Static entry page · `index.html`
- [Login](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/login.html): page · Sign-in page · `login.html`
- [Signup](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/signup.html): page · Two-step onboarding and account creation · `signup.html`
- [About](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/about.html): page · Informational page · `about.html`
- **Profile data**: onboarding data · Age, weight, height, goal, and activity level collected during signup

### Crowd dashboard

Main gym crowd experience and live data flow

- [Dashboard](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.html): page · Main crowd dashboard · `home.html`
- [Check-in flow](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.js): crowd logic · User check-in/out and muscle-group selection · `home.js`
- [Realtime sync](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.js): state sync · Supabase-backed live updates across clients · `home.js`
- [Weather fetch](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.js): integration · Open-Meteo lookup for Bengaluru weather · `home.js`
- [Crowd tip](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.js): derived advice · Weather-aware gym crowd suggestion · `home.js`
- [Derived views](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/home.js): client analytics · Predictions, heatmap, calendar, streaks, and workout plan · `home.js`

### Reference tools

Exercise library and nutrition utilities

- [Exercise library](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/exLibrary.html): page · Workout reference and discovery page · `exLibrary.html`
- [Search filter](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/exLibrary.js): client filtering · Debounced search and muscle-group filtering · `exLibrary.js`
- [Exercise catalog](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/exLibrary.js): content set · 30+ exercises across six muscle groups · `exLibrary.js`
- [BiteClub](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/biteclub.html): page · Nutrition and diet tools · `biteclub.html`
- [Calculators](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/biteclub.js): nutrition logic · BMI, BMR, and TDEE calculations · `biteclub.js`
- [Meal plans](https://github.com/adityaghate66-sketch/crowdliftt/blob/main/biteclub.js): nutrition content · Diet guidance and meal-plan outputs · `biteclub.js`

### External services

BaaS and weather dependencies

- **Supabase**: external BaaS · Shared state store and realtime backend substitute
- **Open-Meteo**: weather API · External weather data provider

## Connections

- Landing → Login: sign in · Landing page routes users into authentication
- Landing → Signup: join · Landing page routes users into account creation
- Landing → Dashboard: enter · Landing page can route to the main app
- Landing → About: about · Landing page routes to product information
- Login → Dashboard: authenticated · Successful login enters the dashboard
- Signup → Profile data: collects · Signup captures onboarding profile data
- Profile data → Dashboard: personalizes · Profile data influences dashboard guidance
- Profile data → BiteClub: personalizes · Profile data feeds nutrition tools
- Dashboard → Check-in flow: controls · Dashboard UI drives check-in and muscle-group selection
- Check-in flow → Supabase: write · Crowd changes are persisted externally
- Supabase → Realtime sync: broadcast · Realtime updates are delivered to connected clients
- Realtime sync → Dashboard: refreshes · Dashboard state updates from realtime events
- Dashboard → Weather fetch: requests · Dashboard fetches local weather
- Weather fetch → Open-Meteo: query · Weather data comes from Open-Meteo
- Weather fetch → Crowd tip: feeds · Weather data contributes to contextual advice
- Check-in flow → Derived views: inputs · Attendance and activity inform client-side analytics
- Derived views → Dashboard: renders · Predictions and history views are shown on the dashboard
- Dashboard → Crowd tip: shows · Dashboard presents the combined crowd tip
- Exercise library → Search filter: drives · Exercise library search and filters run in the browser
- Search filter → Exercise catalog: filters · Filtering narrows the exercise set
- BiteClub → Calculators: runs · Nutrition page performs body-metric calculations
- Calculators → Meal plans: produces · Calculator outputs inform meal-plan content
