# sriram-731/pedal-pulse architecture

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

- Interactive diagram: https://gitdiagram.com/sriram-731/pedal-pulse
- Repository: https://github.com/sriram-731/pedal-pulse

## Overview

Pedal Pulse is a mobile cycling app for account-based ride planning and tracking, rider groups, community events, messaging, and safety alerts. The main workflow initializes a Supabase-backed session, routes authenticated riders into the app, and lets them join groups, share ride locations, and use map and ride features; community, chat, activity, profile, and notification features are parallel branches. The graph reflects documented imports and sampled calls; unsampled screens are represented by their exact tree paths, with uncertain connections omitted.

Main entry points: [`pedal-pulse-master/src/navigation/AppNavigator.tsx`](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/navigation/AppNavigator.tsx) (Navigation), [`pedal-pulse-master/src/config/supabase.ts`](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/config/supabase.ts) (Supabase client), [`pedal-pulse-master/App.tsx`](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/App.tsx) (App bootstrap), [`pedal-pulse-master/src/screens/map/MapScreen.tsx`](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/map/MapScreen.tsx) (Ride map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and identity"]
  node_app["App bootstrap<br/>[App.tsx]"]
  node_navigation["Navigation<br/>[AppNavigator.tsx]"]
  node_auth["Session and profile<br/>[useAuthStore.ts]"]
  node_backend["Supabase client<br/>[supabase.ts]"]
  node_dashboard["Rider dashboard"]
end

subgraph group_rides["Rides and safety"]
  node_ridegroups["Ride groups<br/>[useGroupStore.ts]"]
  node_ridegroupui["Group screens"]
  node_rideinfo["Ride details"]
  node_map["Ride map<br/>[MapScreen.tsx]"]
  node_locations["Live group locations"]
  node_accident["Accident detection"]
  node_emergency["Emergency overlay"]
end

subgraph group_community["Community and chat"]
  node_communities["Community screens"]
  node_communitydata["Community state"]
  node_events["Community events"]
  node_chat["Chat screens<br/>[ChatRoomScreen.tsx]"]
  node_messages["Message handling<br/>[useMessages.ts]"]
end

subgraph group_engagement["Activities and alerts"]
  node_activity["Daily activities"]
  node_notifications["Notification state"]
  node_notificationui["Notification display"]
end

node_rider(("Rider"))
node_sms["Emergency SMS service<br/>[index.ts]"]

node_rider -->|"opens"| node_app
node_app -->|"initializes"| node_backend
node_app -->|"sets session"| node_auth
node_app -->|"renders"| node_navigation
node_navigation -->|"reads session"| node_auth
node_navigation -->|"routes to"| node_dashboard
node_auth -->|"fetches profile"| node_backend
node_navigation -->|"starts listener"| node_notifications
node_dashboard -->|"reads data"| node_backend
node_navigation -->|"routes to"| node_ridegroupui
node_ridegroupui -->|"uses group state"| node_ridegroups
node_ridegroups -->|"manages groups"| node_backend
node_navigation -->|"routes to"| node_rideinfo
node_rideinfo -->|"loads ride data"| node_backend
node_navigation -->|"routes to"| node_map
node_map -->|"tracks group"| node_locations
node_locations -->|"syncs locations"| node_backend
node_map -->|"checks accidents"| node_accident
node_map -->|"shows overlay"| node_emergency
node_navigation -->|"routes to"| node_communities
node_communities -->|"uses community state"| node_communitydata
node_communitydata -->|"loads membership"| node_backend
node_navigation -->|"routes to"| node_events
node_events -->|"loads events"| node_backend
node_navigation -->|"routes to"| node_chat
node_chat -->|"uses message hook"| node_messages
node_messages -->|"reads and writes"| node_backend
node_navigation -->|"routes to"| node_activity
node_activity -->|"loads activities"| node_backend
node_notifications -->|"syncs alerts"| node_backend
node_navigation -->|"routes to"| node_notificationui
node_notificationui -->|"uses alert state"| node_notifications
node_emergency -.->|"may dispatch"| node_sms

click node_app "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/App.tsx"
click node_navigation "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/navigation/AppNavigator.tsx"
click node_auth "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/store/useAuthStore.ts"
click node_backend "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/config/supabase.ts"
click node_dashboard "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/dashboard/DashboardScreen.tsx"
click node_ridegroups "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/store/useGroupStore.ts"
click node_ridegroupui "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/ride/RideGroupsScreen.tsx"
click node_rideinfo "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/ride/RideDetailScreen.tsx"
click node_map "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/map/MapScreen.tsx"
click node_locations "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/hooks/useGroupLocationSync.ts"
click node_accident "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/hooks/useAccidentDetection.ts"
click node_emergency "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/components/safety/EmergencyOverlay.tsx"
click node_communities "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/community/CommunityListScreen.tsx"
click node_communitydata "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/store/useCommunityStore.ts"
click node_events "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/community/EventListScreen.tsx"
click node_chat "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/chat/ChatRoomScreen.tsx"
click node_messages "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/hooks/useMessages.ts"
click node_activity "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/activity/DailyActivitiesScreen.tsx"
click node_notifications "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/store/useNotificationStore.ts"
click node_notificationui "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/notifications/NotificationsScreen.tsx"
click node_sms "https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/supabase/functions/send-emergency-sms/index.ts"

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_app,node_navigation,node_auth,node_backend,node_dashboard toneBlue
class node_ridegroups,node_ridegroupui,node_rideinfo,node_map,node_locations,node_accident,node_emergency toneAmber
class node_communities,node_communitydata,node_events,node_chat,node_messages toneMint
class node_activity,node_notifications,node_notificationui toneRose
class node_rider toneIndigo
class node_sms toneTeal
```

## Components

### App and identity

- [App bootstrap](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/App.tsx): `pedal-pulse-master/App.tsx`
- [Navigation](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/navigation/AppNavigator.tsx): `pedal-pulse-master/src/navigation/AppNavigator.tsx`
- [Session and profile](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/store/useAuthStore.ts): `pedal-pulse-master/src/store/useAuthStore.ts`
- [Supabase client](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/config/supabase.ts): `pedal-pulse-master/src/config/supabase.ts`
- [Rider dashboard](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/dashboard/DashboardScreen.tsx): `pedal-pulse-master/src/screens/dashboard/DashboardScreen.tsx`

### Rides and safety

- [Ride groups](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/store/useGroupStore.ts): `pedal-pulse-master/src/store/useGroupStore.ts`
- [Group screens](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/ride/RideGroupsScreen.tsx): `pedal-pulse-master/src/screens/ride/RideGroupsScreen.tsx`
- [Ride details](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/ride/RideDetailScreen.tsx): `pedal-pulse-master/src/screens/ride/RideDetailScreen.tsx`
- [Ride map](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/map/MapScreen.tsx): `pedal-pulse-master/src/screens/map/MapScreen.tsx`
- [Live group locations](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/hooks/useGroupLocationSync.ts): `pedal-pulse-master/src/hooks/useGroupLocationSync.ts`
- [Accident detection](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/hooks/useAccidentDetection.ts): `pedal-pulse-master/src/hooks/useAccidentDetection.ts`
- [Emergency overlay](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/components/safety/EmergencyOverlay.tsx): `pedal-pulse-master/src/components/safety/EmergencyOverlay.tsx`

### Community and chat

- [Community screens](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/community/CommunityListScreen.tsx): `pedal-pulse-master/src/screens/community/CommunityListScreen.tsx`
- [Community state](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/store/useCommunityStore.ts): `pedal-pulse-master/src/store/useCommunityStore.ts`
- [Community events](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/community/EventListScreen.tsx): `pedal-pulse-master/src/screens/community/EventListScreen.tsx`
- [Chat screens](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/chat/ChatRoomScreen.tsx): `pedal-pulse-master/src/screens/chat/ChatRoomScreen.tsx`
- [Message handling](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/hooks/useMessages.ts): `pedal-pulse-master/src/hooks/useMessages.ts`

### Activities and alerts

- [Daily activities](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/activity/DailyActivitiesScreen.tsx): `pedal-pulse-master/src/screens/activity/DailyActivitiesScreen.tsx`
- [Notification state](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/store/useNotificationStore.ts): `pedal-pulse-master/src/store/useNotificationStore.ts`
- [Notification display](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/src/screens/notifications/NotificationsScreen.tsx): `pedal-pulse-master/src/screens/notifications/NotificationsScreen.tsx`

### Other components

- **Rider**
- [Emergency SMS service](https://github.com/sriram-731/pedal-pulse/blob/main/pedal-pulse-master/supabase/functions/send-emergency-sms/index.ts): `pedal-pulse-master/supabase/functions/send-emergency-sms/index.ts`

## Connections

- Rider → App bootstrap: opens
- App bootstrap → Supabase client: initializes (evidence: `pedal-pulse-master/App.tsx`)
- App bootstrap → Session and profile: sets session (evidence: `pedal-pulse-master/App.tsx`)
- App bootstrap → Navigation: renders (evidence: `pedal-pulse-master/App.tsx`)
- Navigation → Session and profile: reads session (evidence: `pedal-pulse-master/src/navigation/AppNavigator.tsx`)
- Navigation → Rider dashboard: routes to (evidence: `pedal-pulse-master/src/navigation/AppNavigator.tsx`)
- Session and profile → Supabase client: fetches profile (evidence: `pedal-pulse-master/src/store/useAuthStore.ts`)
- Navigation → Notification state: starts listener (evidence: `pedal-pulse-master/src/navigation/AppNavigator.tsx`)
- Rider dashboard → Supabase client: reads data (evidence: `pedal-pulse-master/src/screens/dashboard/DashboardScreen.tsx`)
- Navigation → Group screens: routes to (evidence: `pedal-pulse-master/src/navigation/AppNavigator.tsx`)
- Group screens → Ride groups: uses group state (evidence: `pedal-pulse-master/src/screens/ride/RideGroupsScreen.tsx`)
- Ride groups → Supabase client: manages groups (evidence: `pedal-pulse-master/src/store/useGroupStore.ts`)
- Navigation → Ride details: routes to (evidence: `pedal-pulse-master/src/navigation/AppNavigator.tsx`)
- Ride details → Supabase client: loads ride data (evidence: `pedal-pulse-master/src/screens/ride/RideDetailScreen.tsx`)
- Navigation → Ride map: routes to (evidence: `pedal-pulse-master/src/navigation/AppNavigator.tsx`)
- Ride map → Live group locations: tracks group (evidence: `pedal-pulse-master/src/screens/map/MapScreen.tsx`)
- Live group locations → Supabase client: syncs locations (evidence: `pedal-pulse-master/src/hooks/useGroupLocationSync.ts`)
- Ride map → Accident detection: checks accidents (evidence: `pedal-pulse-master/src/screens/map/MapScreen.tsx`)
- Ride map → Emergency overlay: shows overlay (evidence: `pedal-pulse-master/src/screens/map/MapScreen.tsx`)
- Navigation → Community screens: routes to (evidence: `pedal-pulse-master/src/navigation/AppNavigator.tsx`)
- Community screens → Community state: uses community state
- Community state → Supabase client: loads membership (evidence: `pedal-pulse-master/src/store/useCommunityStore.ts`)
- Navigation → Community events: routes to (evidence: `pedal-pulse-master/src/navigation/AppNavigator.tsx`)
- Community events → Supabase client: loads events (evidence: `pedal-pulse-master/src/screens/community/EventListScreen.tsx`)
- Navigation → Chat screens: routes to (evidence: `pedal-pulse-master/src/navigation/AppNavigator.tsx`)
- Chat screens → Message handling: uses message hook
- Message handling → Supabase client: reads and writes (evidence: `pedal-pulse-master/src/hooks/useMessages.ts`)
- Navigation → Daily activities: routes to (evidence: `pedal-pulse-master/src/navigation/AppNavigator.tsx`)
- Daily activities → Supabase client: loads activities (evidence: `pedal-pulse-master/src/screens/activity/DailyActivitiesScreen.tsx`)
- Notification state → Supabase client: syncs alerts (evidence: `pedal-pulse-master/src/store/useNotificationStore.ts`)
- Navigation → Notification display: routes to (evidence: `pedal-pulse-master/src/navigation/AppNavigator.tsx`)
- Notification display → Notification state: uses alert state (evidence: `pedal-pulse-master/src/screens/notifications/NotificationsScreen.tsx`)
- Emergency overlay → Emergency SMS service: may dispatch
