# aayans314/avaylable_locus architecture

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

- Interactive diagram: https://gitdiagram.com/aayans314/avaylable_locus
- Repository: https://github.com/aayans314/avaylable_locus

## Overview

AvayLable is an Expo mobile app prototype focused on campus ride sharing, with campus-email verification, driver discovery, ride booking, and Stripe payment. The main user flow runs from account access to the home/map experience, then ride selection and booking; payment creates a ride record through the API. The README also describes campus trust, rural transportation, and future peer-service expansion. Source excerpts show several client-side calls, but most API implementations and some screens were not sampled, so links to those areas are limited.

Main entry points: [`app/(root)/(tabs)/home.tsx`](https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/(tabs)/home.tsx) (Ride Home), [`components/Map.tsx`](https://github.com/aayans314/avaylable_locus/blob/main/components/Map.tsx) (Driver Map), [`app/(root)/find-ride.tsx`](https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/find-ride.tsx) (Find Ride), [`components/Payment.tsx`](https://github.com/aayans314/avaylable_locus/blob/main/components/Payment.tsx) (Payment Sheet)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and Access"]
  node_signup["Email Sign Up<br/>[sign-up.tsx]"]
  node_oauth["Google OAuth<br/>[OAuth.tsx]"]
  node_authlib["Auth Helpers<br/>[auth.ts]"]
  node_userapi["User API<br/>[user+api.ts]"]
  node_profile["Profile Tab<br/>[profile.tsx]"]
end

subgraph group_ride["Ride Discovery and Booking"]
  node_home["Ride Home<br/>[home.tsx]"]
  node_find["Find Ride<br/>[find-ride.tsx]"]
  node_map["Driver Map<br/>[Map.tsx]"]
  node_driverapi["Driver API<br/>[driver+api.ts]"]
  node_confirm["Confirm Ride<br/>[confirm-ride.tsx]"]
  node_book["Book Ride<br/>[book-ride.tsx]"]
  node_ridecard["Ride Card<br/>[RideCard.tsx]"]
  node_rideview["Ride History<br/>[rides.tsx]"]
  node_chat["Chat Tab<br/>[chat.tsx]"]
end

subgraph group_payments["Payments and Records"]
  node_payment["Payment Sheet<br/>[Payment.tsx]"]
  node_stripecreate["Create Payment API<br/>[create+api.ts]"]
  node_stripepay["Pay API<br/>[pay+api.ts]"]
  node_ridecreate["Create Ride API<br/>[create+api.ts]"]
  node_rideapi["Ride Detail API<br/>[&#91;id&#93;+api.ts]"]
end

subgraph group_shared["Client Services"]
  node_maplib["Map Calculations<br/>[map.ts]"]
  node_fetch["API Fetch<br/>[fetch.ts]"]
  node_locationstate["Location State<br/>[index.ts]"]
  node_places["Place Search"]
end

node_student(("Student"))

node_student -->|"creates account"| node_signup
node_student -->|"signs in"| node_oauth
node_signup -->|"registers user"| node_userapi
node_oauth -->|"starts sign-in"| node_authlib
node_authlib -->|"registers user"| node_userapi
node_student -.->|"opens rides"| node_home
node_home -->|"loads ride history"| node_fetch
node_home -->|"requests rides"| node_rideapi
node_home -->|"renders map"| node_map
node_home -->|"renders recent rides"| node_ridecard
node_home -->|"sets locations"| node_locationstate
node_map -->|"loads drivers"| node_fetch
node_map -->|"requests drivers"| node_driverapi
node_map -->|"calculates routes"| node_maplib
node_map -->|"reads locations"| node_locationstate
node_student -.->|"selects destination"| node_find
node_find -->|"searches places"| node_places
node_find -.->|"stores destination"| node_locationstate
node_find -.->|"continues booking"| node_confirm
node_confirm -.->|"confirms selection"| node_book
node_book -->|"presents payment"| node_payment
node_payment -->|"creates intent"| node_stripecreate
node_payment -->|"confirms payment"| node_stripepay
node_payment -->|"records paid ride"| node_ridecreate
node_rideview -.->|"loads ride history"| node_rideapi
node_home -.->|"opens chat"| node_chat
node_student -.->|"views profile"| node_profile

click node_signup "https://github.com/aayans314/avaylable_locus/blob/main/app/(auth)/sign-up.tsx"
click node_oauth "https://github.com/aayans314/avaylable_locus/blob/main/components/OAuth.tsx"
click node_authlib "https://github.com/aayans314/avaylable_locus/blob/main/lib/auth.ts"
click node_userapi "https://github.com/aayans314/avaylable_locus/blob/main/app/(api)/user%2Bapi.ts"
click node_home "https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/(tabs)/home.tsx"
click node_find "https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/find-ride.tsx"
click node_map "https://github.com/aayans314/avaylable_locus/blob/main/components/Map.tsx"
click node_maplib "https://github.com/aayans314/avaylable_locus/blob/main/lib/map.ts"
click node_driverapi "https://github.com/aayans314/avaylable_locus/blob/main/app/(api)/driver%2Bapi.ts"
click node_confirm "https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/confirm-ride.tsx"
click node_book "https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/book-ride.tsx"
click node_ridecard "https://github.com/aayans314/avaylable_locus/blob/main/components/RideCard.tsx"
click node_rideview "https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/(tabs)/rides.tsx"
click node_payment "https://github.com/aayans314/avaylable_locus/blob/main/components/Payment.tsx"
click node_stripecreate "https://github.com/aayans314/avaylable_locus/blob/main/app/(api)/(stripe)/create%2Bapi.ts"
click node_stripepay "https://github.com/aayans314/avaylable_locus/blob/main/app/(api)/(stripe)/pay%2Bapi.ts"
click node_ridecreate "https://github.com/aayans314/avaylable_locus/blob/main/app/(api)/ride/create%2Bapi.ts"
click node_rideapi "https://github.com/aayans314/avaylable_locus/blob/main/app/(api)/ride/%5Bid%5D%2Bapi.ts"
click node_fetch "https://github.com/aayans314/avaylable_locus/blob/main/lib/fetch.ts"
click node_locationstate "https://github.com/aayans314/avaylable_locus/blob/main/store/index.ts"
click node_places "https://github.com/aayans314/avaylable_locus/blob/main/components/GoogleTextInput.tsx"
click node_chat "https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/(tabs)/chat.tsx"
click node_profile "https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/(tabs)/profile.tsx"

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_signup,node_oauth,node_authlib,node_userapi,node_profile toneBlue
class node_home,node_find,node_map,node_driverapi,node_confirm,node_book,node_ridecard,node_rideview,node_chat toneAmber
class node_payment,node_stripecreate,node_stripepay,node_ridecreate,node_rideapi toneMint
class node_maplib,node_fetch,node_locationstate,node_places toneRose
class node_student toneIndigo
```

## Components

### Identity and Access

- [Email Sign Up](https://github.com/aayans314/avaylable_locus/blob/main/app/(auth)/sign-up.tsx): `app/(auth)/sign-up.tsx`
- [Google OAuth](https://github.com/aayans314/avaylable_locus/blob/main/components/OAuth.tsx): `components/OAuth.tsx`
- [Auth Helpers](https://github.com/aayans314/avaylable_locus/blob/main/lib/auth.ts): `lib/auth.ts`
- [User API](https://github.com/aayans314/avaylable_locus/blob/main/app/(api)/user%2Bapi.ts): `app/(api)/user+api.ts`
- [Profile Tab](https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/(tabs)/profile.tsx): `app/(root)/(tabs)/profile.tsx`

### Ride Discovery and Booking

- [Ride Home](https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/(tabs)/home.tsx): `app/(root)/(tabs)/home.tsx`
- [Find Ride](https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/find-ride.tsx): `app/(root)/find-ride.tsx`
- [Driver Map](https://github.com/aayans314/avaylable_locus/blob/main/components/Map.tsx): `components/Map.tsx`
- [Driver API](https://github.com/aayans314/avaylable_locus/blob/main/app/(api)/driver%2Bapi.ts): `app/(api)/driver+api.ts`
- [Confirm Ride](https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/confirm-ride.tsx): `app/(root)/confirm-ride.tsx`
- [Book Ride](https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/book-ride.tsx): `app/(root)/book-ride.tsx`
- [Ride Card](https://github.com/aayans314/avaylable_locus/blob/main/components/RideCard.tsx): `components/RideCard.tsx`
- [Ride History](https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/(tabs)/rides.tsx): `app/(root)/(tabs)/rides.tsx`
- [Chat Tab](https://github.com/aayans314/avaylable_locus/blob/main/app/(root)/(tabs)/chat.tsx): `app/(root)/(tabs)/chat.tsx`

### Payments and Records

- [Payment Sheet](https://github.com/aayans314/avaylable_locus/blob/main/components/Payment.tsx): `components/Payment.tsx`
- [Create Payment API](https://github.com/aayans314/avaylable_locus/blob/main/app/(api)/(stripe)/create%2Bapi.ts): `app/(api)/(stripe)/create+api.ts`
- [Pay API](https://github.com/aayans314/avaylable_locus/blob/main/app/(api)/(stripe)/pay%2Bapi.ts): `app/(api)/(stripe)/pay+api.ts`
- [Create Ride API](https://github.com/aayans314/avaylable_locus/blob/main/app/(api)/ride/create%2Bapi.ts): `app/(api)/ride/create+api.ts`
- [Ride Detail API](https://github.com/aayans314/avaylable_locus/blob/main/app/(api)/ride/%5Bid%5D%2Bapi.ts): `app/(api)/ride/[id]+api.ts`

### Client Services

- [Map Calculations](https://github.com/aayans314/avaylable_locus/blob/main/lib/map.ts): `lib/map.ts`
- [API Fetch](https://github.com/aayans314/avaylable_locus/blob/main/lib/fetch.ts): `lib/fetch.ts`
- [Location State](https://github.com/aayans314/avaylable_locus/blob/main/store/index.ts): `store/index.ts`
- [Place Search](https://github.com/aayans314/avaylable_locus/blob/main/components/GoogleTextInput.tsx): `components/GoogleTextInput.tsx`

### Other components

- **Student**

## Connections

- Student → Email Sign Up: creates account (evidence: `app/(auth)/sign-up.tsx`)
- Student → Google OAuth: signs in (evidence: `components/OAuth.tsx`)
- Email Sign Up → User API: registers user (evidence: `app/(auth)/sign-up.tsx`)
- Google OAuth → Auth Helpers: starts sign-in (evidence: `components/OAuth.tsx`)
- Auth Helpers → User API: registers user (evidence: `lib/auth.ts`)
- Student → Ride Home: opens rides
- Ride Home → API Fetch: loads ride history (evidence: `app/(root)/(tabs)/home.tsx`)
- Ride Home → Ride Detail API: requests rides (evidence: `app/(root)/(tabs)/home.tsx`)
- Ride Home → Driver Map: renders map (evidence: `app/(root)/(tabs)/home.tsx`)
- Ride Home → Ride Card: renders recent rides (evidence: `app/(root)/(tabs)/home.tsx`)
- Ride Home → Location State: sets locations (evidence: `app/(root)/(tabs)/home.tsx`)
- Driver Map → API Fetch: loads drivers (evidence: `components/Map.tsx`)
- Driver Map → Driver API: requests drivers (evidence: `components/Map.tsx`)
- Driver Map → Map Calculations: calculates routes (evidence: `components/Map.tsx`)
- Driver Map → Location State: reads locations (evidence: `components/Map.tsx`)
- Student → Find Ride: selects destination
- Find Ride → Place Search: searches places (evidence: `app/(root)/find-ride.tsx`)
- Find Ride → Location State: stores destination (evidence: `app/(root)/find-ride.tsx`)
- Find Ride → Confirm Ride: continues booking
- Confirm Ride → Book Ride: confirms selection
- Book Ride → Payment Sheet: presents payment (evidence: `app/(root)/book-ride.tsx`)
- Payment Sheet → Create Payment API: creates intent (evidence: `components/Payment.tsx`)
- Payment Sheet → Pay API: confirms payment (evidence: `components/Payment.tsx`)
- Payment Sheet → Create Ride API: records paid ride (evidence: `components/Payment.tsx`)
- Ride History → Ride Detail API: loads ride history
- Ride Home → Chat Tab: opens chat
- Student → Profile Tab: views profile
