# lynch-byte/sportsbookingapp architecture

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

- Interactive diagram: https://gitdiagram.com/lynch-byte/sportsbookingapp
- Repository: https://github.com/lynch-byte/sportsbookingapp

## Overview

This Expo app helps people find sports venues in Tagum City, inspect local availability, and create, reschedule, or cancel bookings. The main flow is browsing/filtering courts, viewing a court, then submitting a time slot through a shared form; booking lists and the home screen show saved reservations. SQLite persists venue and booking records, seeded from the bundled court catalog. Source excerpts establish the listed calls; the README only describes the generic Expo starter, so no additional product capabilities or external booking-service integrations are inferred.

Main entry points: [`src/database/db.ts`](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/database/db.ts) (Booking and court data), [`src/app/(tabs)/_layout.tsx`](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/(tabs)/_layout.tsx) (Tab navigation), [`src/app/(tabs)/my-bookings.tsx`](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/(tabs)/my-bookings.tsx) (My bookings), [`src/app/book/[courtId].tsx`](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/book/%5BcourtId%5D.tsx) (Create booking route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_screens["App Screens"]
  node_navigation["Tab navigation<br/>[_layout.tsx]"]
  node_home["Home overview<br/>[index.tsx]"]
  node_courtlist["Court browser<br/>[courts.tsx]"]
  node_courtview["Court details<br/>[&#91;id&#93;.tsx]"]
  node_bookingslist["My bookings<br/>[my-bookings.tsx]"]
end

subgraph group_booking["Booking Flow"]
  node_bookroute["Create booking route<br/>[&#91;courtId&#93;.tsx]"]
  node_editroute["Edit booking route<br/>[&#91;id&#93;.tsx]"]
  node_form["Booking form<br/>[BookingForm.tsx]"]
end

subgraph group_persistence["Local Data"]
  node_databaseinit["Database startup<br/>[_layout.tsx]"]
  node_dbapi["Booking and court data<br/>[db.ts]"]
  node_sqlite[("SQLite database")]
  node_courtseed["Court catalog seed<br/>[courtsData.ts]"]
end

node_user(("App user"))

node_user -->|"opens app"| node_navigation
node_navigation -->|"shows tab"| node_home
node_navigation -->|"shows tab"| node_courtlist
node_navigation -->|"shows tab"| node_bookingslist
node_home -->|"loads bookings"| node_dbapi
node_courtlist -->|"filters courts"| node_dbapi
node_courtlist -->|"opens details"| node_courtview
node_courtview -->|"loads court data"| node_dbapi
node_courtview -->|"opens booking"| node_bookroute
node_bookroute -->|"loads court"| node_dbapi
node_bookroute -->|"renders form"| node_form
node_form -->|"checks availability"| node_dbapi
node_bookroute -->|"saves booking"| node_dbapi
node_bookingslist -->|"loads bookings"| node_dbapi
node_bookingslist -->|"opens edit"| node_editroute
node_bookingslist -->|"deletes booking"| node_dbapi
node_editroute -->|"loads records"| node_dbapi
node_editroute -->|"renders form"| node_form
node_editroute -->|"updates booking"| node_dbapi
node_databaseinit -->|"initializes"| node_dbapi
node_dbapi -->|"reads and writes"| node_sqlite
node_dbapi -->|"seeds catalog"| node_courtseed

click node_navigation "https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/(tabs)/_layout.tsx"
click node_home "https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/(tabs)/index.tsx"
click node_courtlist "https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/(tabs)/courts.tsx"
click node_courtview "https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/court/%5Bid%5D.tsx"
click node_bookingslist "https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/(tabs)/my-bookings.tsx"
click node_bookroute "https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/book/%5BcourtId%5D.tsx"
click node_editroute "https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/edit-booking/%5Bid%5D.tsx"
click node_form "https://github.com/lynch-byte/sportsbookingapp/blob/main/src/components/BookingForm.tsx"
click node_databaseinit "https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/_layout.tsx"
click node_dbapi "https://github.com/lynch-byte/sportsbookingapp/blob/main/src/database/db.ts"
click node_courtseed "https://github.com/lynch-byte/sportsbookingapp/blob/main/src/database/courtsData.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_navigation,node_home,node_courtlist,node_courtview,node_bookingslist,node_user toneBlue
class node_bookroute,node_editroute,node_form toneAmber
class node_databaseinit,node_dbapi,node_sqlite,node_courtseed toneMint
```

## Components

### App Screens

- [Tab navigation](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/(tabs)/_layout.tsx): `src/app/(tabs)/_layout.tsx`
- [Home overview](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/(tabs)/index.tsx): `src/app/(tabs)/index.tsx`
- [Court browser](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/(tabs)/courts.tsx): `src/app/(tabs)/courts.tsx`
- [Court details](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/court/%5Bid%5D.tsx): `src/app/court/[id].tsx`
- [My bookings](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/(tabs)/my-bookings.tsx): `src/app/(tabs)/my-bookings.tsx`

### Booking Flow

- [Create booking route](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/book/%5BcourtId%5D.tsx): `src/app/book/[courtId].tsx`
- [Edit booking route](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/edit-booking/%5Bid%5D.tsx): `src/app/edit-booking/[id].tsx`
- [Booking form](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/components/BookingForm.tsx): `src/components/BookingForm.tsx`

### Local Data

- [Database startup](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/app/_layout.tsx): `src/app/_layout.tsx`
- [Booking and court data](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/database/db.ts): `src/database/db.ts`
- **SQLite database**
- [Court catalog seed](https://github.com/lynch-byte/sportsbookingapp/blob/main/src/database/courtsData.ts): `src/database/courtsData.ts`

### Other components

- **App user**

## Connections

- App user → Tab navigation: opens app (evidence: `src/app/(tabs)/_layout.tsx`)
- Tab navigation → Home overview: shows tab (evidence: `src/app/(tabs)/_layout.tsx`)
- Tab navigation → Court browser: shows tab (evidence: `src/app/(tabs)/_layout.tsx`)
- Tab navigation → My bookings: shows tab (evidence: `src/app/(tabs)/_layout.tsx`)
- Home overview → Booking and court data: loads bookings (evidence: `src/app/(tabs)/index.tsx`)
- Court browser → Booking and court data: filters courts (evidence: `src/app/(tabs)/courts.tsx`)
- Court browser → Court details: opens details (evidence: `src/app/(tabs)/courts.tsx`)
- Court details → Booking and court data: loads court data (evidence: `src/app/court/[id].tsx`)
- Court details → Create booking route: opens booking (evidence: `src/app/court/[id].tsx`)
- Create booking route → Booking and court data: loads court (evidence: `src/app/book/[courtId].tsx`)
- Create booking route → Booking form: renders form (evidence: `src/app/book/[courtId].tsx`)
- Booking form → Booking and court data: checks availability (evidence: `src/components/BookingForm.tsx`)
- Create booking route → Booking and court data: saves booking (evidence: `src/app/book/[courtId].tsx`)
- My bookings → Booking and court data: loads bookings (evidence: `src/app/(tabs)/my-bookings.tsx`)
- My bookings → Edit booking route: opens edit (evidence: `src/app/(tabs)/my-bookings.tsx`)
- My bookings → Booking and court data: deletes booking (evidence: `src/app/(tabs)/my-bookings.tsx`)
- Edit booking route → Booking and court data: loads records (evidence: `src/app/edit-booking/[id].tsx`)
- Edit booking route → Booking form: renders form (evidence: `src/app/edit-booking/[id].tsx`)
- Edit booking route → Booking and court data: updates booking (evidence: `src/app/edit-booking/[id].tsx`)
- Database startup → Booking and court data: initializes (evidence: `src/app/_layout.tsx`)
- Booking and court data → SQLite database: reads and writes (evidence: `src/database/db.ts`)
- Booking and court data → Court catalog seed: seeds catalog (evidence: `src/database/db.ts`)
