# sparshagarwal0411/pixel-perfect-pixels architecture

> Architecture diagram of the GitHub repository sparshagarwal0411/pixel-perfect-pixels, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sparshagarwal0411/pixel-perfect-pixels
- Repository: https://github.com/sparshagarwal0411/pixel-perfect-pixels

## Overview

MargDarshak is a Delhi-NCR campus-opportunity discovery and planning app. Students browse and compare events, assess travel and feasibility, then save and track opportunities through a calendar and dashboard; personalized ranking and society collaboration are additional product branches. The README documents the scraper-to-Supabase sync and Google authentication. Some route implementations and the scraper were not sampled, so those capabilities and relationships are represented only where the README or source index supports them.

Main entry points: [`src/lib/store.tsx`](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/lib/store.tsx) (App state and tracking), [`src/routes/events.$id.tsx`](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/events.%24id.tsx) (Event details), [`src/routes/nearby.tsx`](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/nearby.tsx) (Transit radar), [`src/lib/logic.ts`](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/lib/logic.ts) (Matching and priority logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Event discovery"]
  node_landing["Landing and hero<br/>[index.tsx]"]
  node_explore["Explore events<br/>[explore.tsx]"]
  node_event_detail["Event details<br/>[events.$id.tsx]"]
  node_event_data["Event and campus data<br/>[data.ts]"]
  node_event_rank["Personalized ranking<br/>[rank.tsx]"]
end

subgraph group_planning["Travel and planning"]
  node_scoring["Matching and priority logic<br/>[logic.ts]"]
  node_transit["Transit radar<br/>[nearby.tsx]"]
  node_transit_map["Leaflet transit map<br/>[RealTransitMap.tsx]"]
  node_feasibility["Can-I-Make-It check<br/>[CanIMakeIt.tsx]"]
  node_dashboard["Saved-event dashboard<br/>[dashboard.tsx]"]
  node_calendar["Tracked-event calendar<br/>[calendar.tsx]"]
  node_history["Event history<br/>[history.tsx]"]
end

subgraph group_community["Campus community"]
  node_campus_connect["Society collaboration<br/>[campus.tsx]"]
end

subgraph group_identity["Identity and persistence"]
  node_settings["Profile and preferences<br/>[settings.tsx]"]
  node_auth_ui["Google sign-in"]
  node_auth_gate["Access gate<br/>[AuthGate.tsx]"]
  node_store["App state and tracking<br/>[store.tsx]"]
  node_remote_events["Remote event loader<br/>[remote-events.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_supabase[("Supabase database and auth")]
end

subgraph group_ingestion["Event ingestion"]
  node_sync_script["Unstop event sync"]
end

node_student(("Student"))
node_unstop["Unstop opportunities API"]

node_student -->|"opens"| node_landing
node_student -->|"searches"| node_explore
node_student -->|"requests matches"| node_event_rank
node_student -->|"checks travel"| node_transit
node_student -->|"reviews saved events"| node_dashboard
node_student -->|"finds collaborators"| node_campus_connect
node_student -->|"reviews schedule"| node_calendar
node_student -->|"edits preferences"| node_settings
node_student -.->|"views history"| node_history
node_landing -->|"shows events"| node_event_data
node_landing -->|"offers sign-in"| node_auth_ui
node_explore -->|"searches events"| node_event_data
node_explore -->|"reads app state"| node_store
node_event_detail -->|"uses event data"| node_event_data
node_event_detail -->|"reads tracking state"| node_store
node_event_detail -->|"renders checker"| node_feasibility
node_event_detail -->|"renders route map"| node_transit_map
node_event_rank -->|"reads preferences"| node_store
node_event_rank -->|"uses scoring"| node_scoring
node_transit -->|"renders map"| node_transit_map
node_transit -->|"renders checker"| node_feasibility
node_transit -->|"reads app state"| node_store
node_transit_map -->|"estimates travel"| node_scoring
node_feasibility -->|"checks feasibility"| node_scoring
node_dashboard -->|"reads tracked events"| node_store
node_dashboard -->|"formats travel"| node_scoring
node_calendar -->|"reads tracked events"| node_store
node_campus_connect -->|"uses app state"| node_store
node_settings -->|"updates preferences"| node_store
node_auth_gate -->|"checks session"| node_store
node_auth_gate -->|"opens sign-in"| node_auth_ui
node_auth_ui -->|"starts login"| node_store
node_store -->|"loads events"| node_remote_events
node_remote_events -->|"uses client"| node_supabase_client
node_store -->|"uses auth client"| node_supabase_client
node_supabase_client -.->|"connects"| node_supabase
node_sync_script -->|"fetches opportunities"| node_unstop
node_sync_script -->|"upserts events"| node_supabase

click node_landing "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/index.tsx"
click node_explore "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/explore.tsx"
click node_event_detail "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/events.%24id.tsx"
click node_event_data "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/lib/data.ts"
click node_event_rank "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/rank.tsx"
click node_scoring "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/lib/logic.ts"
click node_transit "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/nearby.tsx"
click node_transit_map "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/components/RealTransitMap.tsx"
click node_feasibility "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/components/CanIMakeIt.tsx"
click node_dashboard "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/dashboard.tsx"
click node_calendar "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/calendar.tsx"
click node_history "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/history.tsx"
click node_campus_connect "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/campus.tsx"
click node_settings "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/settings.tsx"
click node_auth_ui "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/components/GoogleAuthModal.tsx"
click node_auth_gate "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/components/AuthGate.tsx"
click node_store "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/lib/store.tsx"
click node_remote_events "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/lib/remote-events.ts"
click node_supabase_client "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/lib/supabase.ts"
click node_sync_script "https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/scripts/sync_unstop_events.py"

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_landing,node_explore,node_event_detail,node_event_data,node_event_rank toneBlue
class node_scoring,node_transit,node_transit_map,node_feasibility,node_dashboard,node_calendar,node_history toneAmber
class node_campus_connect,node_unstop toneMint
class node_settings,node_auth_ui,node_auth_gate,node_store,node_remote_events,node_supabase_client,node_supabase toneRose
class node_sync_script,node_student toneIndigo
```

## Components

### Event discovery

- [Landing and hero](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Explore events](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/explore.tsx): `src/routes/explore.tsx`
- [Event details](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/events.%24id.tsx): `src/routes/events.$id.tsx`
- [Event and campus data](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/lib/data.ts): `src/lib/data.ts`
- [Personalized ranking](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/rank.tsx): `src/routes/rank.tsx`

### Travel and planning

- [Matching and priority logic](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/lib/logic.ts): `src/lib/logic.ts`
- [Transit radar](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/nearby.tsx): `src/routes/nearby.tsx`
- [Leaflet transit map](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/components/RealTransitMap.tsx): `src/components/RealTransitMap.tsx`
- [Can-I-Make-It check](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/components/CanIMakeIt.tsx): `src/components/CanIMakeIt.tsx`
- [Saved-event dashboard](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/dashboard.tsx): `src/routes/dashboard.tsx`
- [Tracked-event calendar](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/calendar.tsx): `src/routes/calendar.tsx`
- [Event history](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/history.tsx): `src/routes/history.tsx`

### Campus community

- [Society collaboration](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/campus.tsx): `src/routes/campus.tsx`

### Identity and persistence

- [Profile and preferences](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/routes/settings.tsx): `src/routes/settings.tsx`
- [Google sign-in](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/components/GoogleAuthModal.tsx): `src/components/GoogleAuthModal.tsx`
- [Access gate](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/components/AuthGate.tsx): `src/components/AuthGate.tsx`
- [App state and tracking](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/lib/store.tsx): `src/lib/store.tsx`
- [Remote event loader](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/lib/remote-events.ts): `src/lib/remote-events.ts`
- [Supabase client](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase database and auth**

### Event ingestion

- [Unstop event sync](https://github.com/sparshagarwal0411/pixel-perfect-pixels/blob/main/scripts/sync_unstop_events.py): `scripts/sync_unstop_events.py`

### Other components

- **Student**
- **Unstop opportunities API**

## Connections

- Student → Landing and hero: opens (evidence: `README.md`)
- Student → Explore events: searches (evidence: `README.md`)
- Student → Personalized ranking: requests matches (evidence: `README.md`)
- Student → Transit radar: checks travel (evidence: `README.md`)
- Student → Saved-event dashboard: reviews saved events (evidence: `README.md`)
- Student → Society collaboration: finds collaborators (evidence: `README.md`)
- Student → Tracked-event calendar: reviews schedule (evidence: `README.md`)
- Student → Profile and preferences: edits preferences (evidence: `README.md`)
- Student → Event history: views history
- Landing and hero → Event and campus data: shows events (evidence: `src/routes/index.tsx`)
- Landing and hero → Google sign-in: offers sign-in (evidence: `src/routes/index.tsx`)
- Explore events → Event and campus data: searches events (evidence: `src/routes/explore.tsx`)
- Explore events → App state and tracking: reads app state (evidence: `src/routes/explore.tsx`)
- Event details → Event and campus data: uses event data (evidence: `src/routes/events.$id.tsx`)
- Event details → App state and tracking: reads tracking state (evidence: `src/routes/events.$id.tsx`)
- Event details → Can-I-Make-It check: renders checker (evidence: `src/routes/events.$id.tsx`)
- Event details → Leaflet transit map: renders route map (evidence: `src/routes/events.$id.tsx`)
- Personalized ranking → App state and tracking: reads preferences (evidence: `src/routes/rank.tsx`)
- Personalized ranking → Matching and priority logic: uses scoring (evidence: `src/routes/rank.tsx`)
- Transit radar → Leaflet transit map: renders map (evidence: `src/routes/nearby.tsx`)
- Transit radar → Can-I-Make-It check: renders checker (evidence: `src/routes/nearby.tsx`)
- Transit radar → App state and tracking: reads app state (evidence: `src/routes/nearby.tsx`)
- Leaflet transit map → Matching and priority logic: estimates travel (evidence: `src/components/RealTransitMap.tsx`)
- Can-I-Make-It check → Matching and priority logic: checks feasibility (evidence: `src/components/CanIMakeIt.tsx`)
- Saved-event dashboard → App state and tracking: reads tracked events (evidence: `src/routes/dashboard.tsx`)
- Saved-event dashboard → Matching and priority logic: formats travel (evidence: `src/routes/dashboard.tsx`)
- Tracked-event calendar → App state and tracking: reads tracked events (evidence: `src/routes/calendar.tsx`)
- Society collaboration → App state and tracking: uses app state (evidence: `src/routes/campus.tsx`)
- Profile and preferences → App state and tracking: updates preferences (evidence: `src/routes/settings.tsx`)
- Access gate → App state and tracking: checks session (evidence: `src/components/AuthGate.tsx`)
- Access gate → Google sign-in: opens sign-in (evidence: `src/components/AuthGate.tsx`)
- Google sign-in → App state and tracking: starts login (evidence: `src/components/GoogleAuthModal.tsx`)
- App state and tracking → Remote event loader: loads events (evidence: `src/lib/store.tsx`)
- Remote event loader → Supabase client: uses client (evidence: `src/lib/remote-events.ts`)
- App state and tracking → Supabase client: uses auth client (evidence: `src/lib/store.tsx`)
- Supabase client → Supabase database and auth: connects
- Unstop event sync → Unstop opportunities API: fetches opportunities (evidence: `README.md`)
- Unstop event sync → Supabase database and auth: upserts events (evidence: `README.md`)
