# anastasia095/horse-betting-app architecture

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

- Interactive diagram: https://gitdiagram.com/anastasia095/horse-betting-app
- Repository: https://github.com/anastasia095/horse-betting-app

## Overview

Orlando Bookies is a horse-race betting web app. Users sign up or log in, browse races and horses, select a bet, and use the payment flow; authenticated users can also view and edit profile information and billing details. The React client routes screens and issues GraphQL operations to an Apollo/Express server, whose resolvers access MongoDB-backed models. Stripe is an additional payment integration. Some client screens and integrations are documented in the README or SOURCE INDEX but were not excerpted, so those links are omitted or marked unverified.

Main entry points: [`client/src/App.js`](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/App.js) (React routes), [`server/models/index.js`](https://github.com/anastasia095/horse-betting-app/blob/main/server/models/index.js) (Domain models), [`server/server.js`](https://github.com/anastasia095/horse-betting-app/blob/main/server/server.js) (HTTP and Apollo), [`client/src/pages/Home.js`](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Home.js) (Home screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client navigation"]
  node_app["React routes<br/>[App.js]"]
  node_home["Home screen<br/>[Home.js]"]
  node_client_queries["GraphQL queries<br/>[queries.js]"]
  node_client_mutations["GraphQL mutations<br/>[mutations.js]"]
end

subgraph group_racing["Race and betting"]
  node_races["Race browser<br/>[Races.js]"]
  node_one_race["Race details<br/>[OneRace.js]"]
  node_place_bet["Place bet<br/>[PlaceBet.js]"]
  node_race_schedule["Race schedule<br/>[index.js]"]
  node_single_schedule["Single schedule<br/>[index.js]"]
  node_upcoming["Upcoming races<br/>[index.js]"]
  node_payment_page["Payment page<br/>[Payment.js]"]
  node_stripe_client["Stripe client form<br/>[StripeContainer.js]"]
  node_checkout["Checkout<br/>[index.js]"]
end

subgraph group_account["Identity and profile"]
  node_login["Login<br/>[Login.js]"]
  node_signup["Sign up<br/>[Signup.js]"]
  node_profile["Profile screen<br/>[Profile.js]"]
  node_profile_nav["Profile navigation<br/>[index.js]"]
  node_sidebar["Profile sidebar<br/>[index.js]"]
  node_edit_form["Profile editor<br/>[index.js]"]
  node_billing["Billing details<br/>[index.js]"]
  node_client_auth["Token handling<br/>[auth.js]"]
end

subgraph group_api["GraphQL service"]
  node_server["HTTP and Apollo<br/>[server.js]"]
  node_schema["GraphQL schema<br/>[index.js]"]
  node_resolvers["Query resolvers<br/>[resolvers.js]"]
  node_server_auth["JWT middleware<br/>[auth.js]"]
end

subgraph group_domain["Data and payments"]
  node_models["Domain models<br/>[index.js]"]
  node_profiles_model["Profile model<br/>[Profile.js]"]
  node_races_model["Race model<br/>[Races.js]"]
  node_horses_model["Horse model<br/>[Horses.js]"]
  node_bets_model["Bet model<br/>[Bets.js]"]
  node_orders_model["Order model<br/>[Order.js]"]
  node_database[("MongoDB<br/>database")]
end

node_user(("Bettor"))
node_stripe["Stripe<br/>external service"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_races
node_app -->|"routes to"| node_one_race
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_signup
node_app -->|"routes to"| node_payment_page
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_place_bet
node_app -->|"sends GraphQL"| node_server
node_home -->|"renders"| node_race_schedule
node_home -->|"renders"| node_upcoming
node_home -->|"uses queries"| node_client_queries
node_one_race -->|"renders"| node_single_schedule
node_place_bet -->|"uses queries"| node_client_queries
node_place_bet -->|"uses mutations"| node_client_mutations
node_place_bet -->|"uses payment form"| node_stripe_client
node_payment_page -->|"renders"| node_stripe_client
node_signup -->|"uses mutations"| node_client_mutations
node_signup -->|"stores token"| node_client_auth
node_login -->|"uses mutations"| node_client_mutations
node_login -->|"stores token"| node_client_auth
node_profile -->|"renders"| node_profile_nav
node_profile -->|"renders"| node_sidebar
node_profile -->|"uses queries"| node_client_queries
node_profile_nav -->|"loads profile"| node_client_queries
node_profile_nav -->|"renders"| node_sidebar
node_sidebar -->|"renders"| node_edit_form
node_sidebar -->|"renders"| node_billing
node_billing -->|"uses checkout"| node_checkout
node_server -->|"loads schema"| node_schema
node_server -->|"configures auth"| node_server_auth
node_schema -->|"exports resolvers"| node_resolvers
node_resolvers -->|"calls models"| node_models
node_resolvers -->|"signs tokens"| node_server_auth
node_server -->|"connects"| node_database
node_models -->|"exports"| node_profiles_model
node_models -->|"exports"| node_races_model
node_models -->|"exports"| node_horses_model
node_models -->|"exports"| node_bets_model
node_models -->|"exports"| node_orders_model
node_server -->|"creates payment intent"| node_stripe

click node_app "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/App.js"
click node_home "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Home.js"
click node_races "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Races.js"
click node_one_race "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/OneRace.js"
click node_place_bet "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/PlaceBet.js"
click node_race_schedule "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/MainSchedule/index.js"
click node_single_schedule "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/SingleSchedule/index.js"
click node_upcoming "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/UpcomingRaces/index.js"
click node_payment_page "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Payment.js"
click node_stripe_client "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/StripeContainer.js"
click node_checkout "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/Checkout/index.js"
click node_login "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Login.js"
click node_signup "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Signup.js"
click node_profile "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Profile.js"
click node_profile_nav "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/ProfileNav/index.js"
click node_sidebar "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/SideBar/index.js"
click node_edit_form "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/EditForm/index.js"
click node_billing "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/Billing/index.js"
click node_client_auth "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/utils/auth.js"
click node_client_queries "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/utils/queries.js"
click node_client_mutations "https://github.com/anastasia095/horse-betting-app/blob/main/client/src/utils/mutations.js"
click node_server "https://github.com/anastasia095/horse-betting-app/blob/main/server/server.js"
click node_schema "https://github.com/anastasia095/horse-betting-app/blob/main/server/schemas/index.js"
click node_resolvers "https://github.com/anastasia095/horse-betting-app/blob/main/server/schemas/resolvers.js"
click node_server_auth "https://github.com/anastasia095/horse-betting-app/blob/main/server/utils/auth.js"
click node_models "https://github.com/anastasia095/horse-betting-app/blob/main/server/models/index.js"
click node_profiles_model "https://github.com/anastasia095/horse-betting-app/blob/main/server/models/Profile.js"
click node_races_model "https://github.com/anastasia095/horse-betting-app/blob/main/server/models/Races.js"
click node_horses_model "https://github.com/anastasia095/horse-betting-app/blob/main/server/models/Horses.js"
click node_bets_model "https://github.com/anastasia095/horse-betting-app/blob/main/server/models/Bets.js"
click node_orders_model "https://github.com/anastasia095/horse-betting-app/blob/main/server/models/Order.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_app,node_home,node_client_queries,node_client_mutations toneBlue
class node_races,node_one_race,node_place_bet,node_race_schedule,node_single_schedule,node_upcoming,node_payment_page,node_stripe_client,node_checkout toneAmber
class node_login,node_signup,node_profile,node_profile_nav,node_sidebar,node_edit_form,node_billing,node_client_auth toneMint
class node_server,node_schema,node_resolvers,node_server_auth toneRose
class node_models,node_profiles_model,node_races_model,node_horses_model,node_bets_model,node_orders_model,node_database,node_user,node_stripe toneIndigo
```

## Components

### Client navigation

- [React routes](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/App.js): `client/src/App.js`
- [Home screen](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Home.js): `client/src/pages/Home.js`
- [GraphQL queries](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/utils/queries.js): `client/src/utils/queries.js`
- [GraphQL mutations](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/utils/mutations.js): `client/src/utils/mutations.js`

### Race and betting

- [Race browser](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Races.js): `client/src/pages/Races.js`
- [Race details](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/OneRace.js): `client/src/pages/OneRace.js`
- [Place bet](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/PlaceBet.js): `client/src/pages/PlaceBet.js`
- [Race schedule](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/MainSchedule/index.js): `client/src/components/MainSchedule/index.js`
- [Single schedule](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/SingleSchedule/index.js): `client/src/components/SingleSchedule/index.js`
- [Upcoming races](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/UpcomingRaces/index.js): `client/src/components/UpcomingRaces/index.js`
- [Payment page](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Payment.js): `client/src/pages/Payment.js`
- [Stripe client form](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/StripeContainer.js): `client/src/components/StripeContainer.js`
- [Checkout](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/Checkout/index.js): `client/src/components/Checkout/index.js`

### Identity and profile

- [Login](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Login.js): `client/src/pages/Login.js`
- [Sign up](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Signup.js): `client/src/pages/Signup.js`
- [Profile screen](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/pages/Profile.js): `client/src/pages/Profile.js`
- [Profile navigation](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/ProfileNav/index.js): `client/src/components/ProfileNav/index.js`
- [Profile sidebar](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/SideBar/index.js): `client/src/components/SideBar/index.js`
- [Profile editor](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/EditForm/index.js): `client/src/components/EditForm/index.js`
- [Billing details](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/components/Billing/index.js): `client/src/components/Billing/index.js`
- [Token handling](https://github.com/anastasia095/horse-betting-app/blob/main/client/src/utils/auth.js): `client/src/utils/auth.js`

### GraphQL service

- [HTTP and Apollo](https://github.com/anastasia095/horse-betting-app/blob/main/server/server.js): `server/server.js`
- [GraphQL schema](https://github.com/anastasia095/horse-betting-app/blob/main/server/schemas/index.js): `server/schemas/index.js`
- [Query resolvers](https://github.com/anastasia095/horse-betting-app/blob/main/server/schemas/resolvers.js): `server/schemas/resolvers.js`
- [JWT middleware](https://github.com/anastasia095/horse-betting-app/blob/main/server/utils/auth.js): `server/utils/auth.js`

### Data and payments

- [Domain models](https://github.com/anastasia095/horse-betting-app/blob/main/server/models/index.js): `server/models/index.js`
- [Profile model](https://github.com/anastasia095/horse-betting-app/blob/main/server/models/Profile.js): `server/models/Profile.js`
- [Race model](https://github.com/anastasia095/horse-betting-app/blob/main/server/models/Races.js): `server/models/Races.js`
- [Horse model](https://github.com/anastasia095/horse-betting-app/blob/main/server/models/Horses.js): `server/models/Horses.js`
- [Bet model](https://github.com/anastasia095/horse-betting-app/blob/main/server/models/Bets.js): `server/models/Bets.js`
- [Order model](https://github.com/anastasia095/horse-betting-app/blob/main/server/models/Order.js): `server/models/Order.js`
- **MongoDB**: database

### Other components

- **Bettor**
- **Stripe**: external service

## Connections

- Bettor → React routes: uses (evidence: `client/src/App.js`)
- React routes → Home screen: routes to (evidence: `client/src/App.js`)
- React routes → Race browser: routes to (evidence: `client/src/App.js`)
- React routes → Race details: routes to (evidence: `client/src/App.js`)
- React routes → Login: routes to (evidence: `client/src/App.js`)
- React routes → Sign up: routes to (evidence: `client/src/App.js`)
- React routes → Payment page: routes to (evidence: `client/src/App.js`)
- React routes → Profile screen: routes to (evidence: `client/src/App.js`)
- React routes → Place bet: routes to (evidence: `client/src/App.js`)
- React routes → HTTP and Apollo: sends GraphQL (evidence: `client/src/App.js`)
- Home screen → Race schedule: renders (evidence: `client/src/pages/Home.js`)
- Home screen → Upcoming races: renders (evidence: `client/src/pages/Home.js`)
- Home screen → GraphQL queries: uses queries (evidence: `client/src/pages/Home.js`)
- Race details → Single schedule: renders (evidence: `client/src/pages/OneRace.js`)
- Place bet → GraphQL queries: uses queries (evidence: `client/src/pages/PlaceBet.js`)
- Place bet → GraphQL mutations: uses mutations (evidence: `client/src/pages/PlaceBet.js`)
- Place bet → Stripe client form: uses payment form (evidence: `client/src/pages/PlaceBet.js`)
- Payment page → Stripe client form: renders (evidence: `client/src/pages/Payment.js`)
- Sign up → GraphQL mutations: uses mutations (evidence: `client/src/pages/Signup.js`)
- Sign up → Token handling: stores token (evidence: `client/src/pages/Signup.js`)
- Login → GraphQL mutations: uses mutations (evidence: `client/src/pages/Login.js`)
- Login → Token handling: stores token (evidence: `client/src/pages/Login.js`)
- Profile screen → Profile navigation: renders (evidence: `client/src/pages/Profile.js`)
- Profile screen → Profile sidebar: renders (evidence: `client/src/pages/Profile.js`)
- Profile screen → GraphQL queries: uses queries (evidence: `client/src/pages/Profile.js`)
- Profile navigation → GraphQL queries: loads profile (evidence: `client/src/components/ProfileNav/index.js`)
- Profile navigation → Profile sidebar: renders (evidence: `client/src/components/ProfileNav/index.js`)
- Profile sidebar → Profile editor: renders (evidence: `client/src/components/SideBar/index.js`)
- Profile sidebar → Billing details: renders (evidence: `client/src/components/SideBar/index.js`)
- Billing details → Checkout: uses checkout (evidence: `client/src/components/Billing/index.js`)
- HTTP and Apollo → GraphQL schema: loads schema (evidence: `server/server.js`)
- HTTP and Apollo → JWT middleware: configures auth (evidence: `server/server.js`)
- GraphQL schema → Query resolvers: exports resolvers (evidence: `server/schemas/index.js`)
- Query resolvers → Domain models: calls models (evidence: `server/schemas/resolvers.js`)
- Query resolvers → JWT middleware: signs tokens (evidence: `server/schemas/resolvers.js`)
- HTTP and Apollo → MongoDB: connects (evidence: `server/server.js`)
- Domain models → Profile model: exports (evidence: `server/models/index.js`)
- Domain models → Race model: exports (evidence: `server/models/index.js`)
- Domain models → Horse model: exports (evidence: `server/models/index.js`)
- Domain models → Bet model: exports (evidence: `server/models/index.js`)
- Domain models → Order model: exports (evidence: `server/models/index.js`)
- HTTP and Apollo → Stripe: creates payment intent (evidence: `server/server.js`)
