# marouenkadri/4horses architecture

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

- Interactive diagram: https://gitdiagram.com/marouenkadri/4horses
- Repository: https://github.com/marouenkadri/4horses

## Overview

BYRSA is a Flutter marketplace connecting clients with service providers. The intended user journey spans account access, service discovery, mission creation or proposal, fulfillment, and payment; messaging, profiles, reviews, stories, and notifications support that journey. The README documents Flutter/Provider, Supabase authentication and data/realtime, and Stripe payments, but the excerpts contain no Dart application code. Accordingly, business-flow links are unverified and shown dashed without evidence paths; platform bootstrap and build files are omitted.

Main entry points: [`lib/app/navigation`](https://github.com/marouenkadri/4horses/tree/main/lib/app/navigation) (Role navigation), [`lib/features/mission`](https://github.com/marouenkadri/4horses/tree/main/lib/features/mission) (Mission lifecycle), [`lib/main.dart`](https://github.com/marouenkadri/4horses/blob/main/lib/main.dart) (Flutter app), [`lib/features/messaging`](https://github.com/marouenkadri/4horses/tree/main/lib/features/messaging) (Realtime messaging)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App foundation"]
  node_app_entry["Flutter app<br/>[main.dart]"]
  node_navigation["Role navigation"]
end

subgraph group_market["Marketplace workflow"]
  node_auth["Accounts"]
  node_discovery["Service discovery"]
  node_public_profiles["Public profiles"]
  node_missions["Mission lifecycle"]
  node_mission_data[("Mission data")]
end

subgraph group_support["Marketplace support"]
  node_messaging["Realtime messaging"]
  node_notifications["Notifications"]
  node_profiles_finance["Profiles and finance"]
  node_reviews["Reviews"]
  node_stories["Stories"]
end

subgraph group_services["External services"]
  node_supabase[("Supabase")]
  node_stripe["Stripe payments"]
  node_payment_functions["Payment functions"]
end

node_clients(("Clients"))
node_providers(("Service providers"))

node_clients -.->|"use"| node_app_entry
node_providers -.->|"use"| node_app_entry
node_app_entry -.->|"opens"| node_navigation
node_navigation -.->|"routes"| node_auth
node_navigation -.->|"routes"| node_discovery
node_navigation -.->|"routes"| node_missions
node_discovery -.->|"opens"| node_public_profiles
node_clients -.->|"create missions"| node_missions
node_providers -.->|"propose work"| node_missions
node_missions -.->|"persists"| node_mission_data
node_mission_data -.->|"stores data"| node_supabase
node_clients -.->|"message"| node_messaging
node_providers -.->|"message"| node_messaging
node_messaging -.->|"realtime data"| node_supabase
node_notifications -.->|"uses"| node_supabase
node_profiles_finance -.->|"uses"| node_supabase
node_reviews -.->|"uses"| node_supabase
node_stories -.->|"uses"| node_supabase
node_profiles_finance -.->|"payments"| node_stripe
node_stripe -.->|"integrates"| node_payment_functions

click node_app_entry "https://github.com/marouenkadri/4horses/blob/main/lib/main.dart"
click node_navigation "https://github.com/marouenkadri/4horses/tree/main/lib/app/navigation"
click node_auth "https://github.com/marouenkadri/4horses/tree/main/lib/features/auth"
click node_discovery "https://github.com/marouenkadri/4horses/blob/main/lib/features/client/presentation/pages/client_discover_content.dart"
click node_public_profiles "https://github.com/marouenkadri/4horses/blob/main/lib/features/client/presentation/pages/freelancer_profile_view.dart"
click node_missions "https://github.com/marouenkadri/4horses/tree/main/lib/features/mission"
click node_mission_data "https://github.com/marouenkadri/4horses/blob/main/lib/features/mission/data/repositories/supabase_mission_repository.dart"
click node_messaging "https://github.com/marouenkadri/4horses/tree/main/lib/features/messaging"
click node_notifications "https://github.com/marouenkadri/4horses/tree/main/lib/features/notifications"
click node_profiles_finance "https://github.com/marouenkadri/4horses/tree/main/lib/features/profile"
click node_reviews "https://github.com/marouenkadri/4horses/tree/main/lib/features/reviews"
click node_stories "https://github.com/marouenkadri/4horses/tree/main/lib/features/story"
click node_payment_functions "https://github.com/marouenkadri/4horses/tree/main/supabase/functions"

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_entry,node_navigation,node_clients toneBlue
class node_auth,node_discovery,node_public_profiles,node_missions,node_mission_data toneAmber
class node_messaging,node_notifications,node_profiles_finance,node_reviews,node_stories toneMint
class node_supabase,node_stripe,node_payment_functions toneRose
class node_providers toneIndigo
```

## Components

### App foundation

- [Flutter app](https://github.com/marouenkadri/4horses/blob/main/lib/main.dart): `lib/main.dart`
- [Role navigation](https://github.com/marouenkadri/4horses/tree/main/lib/app/navigation): `lib/app/navigation`

### Marketplace workflow

- [Accounts](https://github.com/marouenkadri/4horses/tree/main/lib/features/auth): `lib/features/auth`
- [Service discovery](https://github.com/marouenkadri/4horses/blob/main/lib/features/client/presentation/pages/client_discover_content.dart): `lib/features/client/presentation/pages/client_discover_content.dart`
- [Public profiles](https://github.com/marouenkadri/4horses/blob/main/lib/features/client/presentation/pages/freelancer_profile_view.dart): `lib/features/client/presentation/pages/freelancer_profile_view.dart`
- [Mission lifecycle](https://github.com/marouenkadri/4horses/tree/main/lib/features/mission): `lib/features/mission`
- [Mission data](https://github.com/marouenkadri/4horses/blob/main/lib/features/mission/data/repositories/supabase_mission_repository.dart): `lib/features/mission/data/repositories/supabase_mission_repository.dart`

### Marketplace support

- [Realtime messaging](https://github.com/marouenkadri/4horses/tree/main/lib/features/messaging): `lib/features/messaging`
- [Notifications](https://github.com/marouenkadri/4horses/tree/main/lib/features/notifications): `lib/features/notifications`
- [Profiles and finance](https://github.com/marouenkadri/4horses/tree/main/lib/features/profile): `lib/features/profile`
- [Reviews](https://github.com/marouenkadri/4horses/tree/main/lib/features/reviews): `lib/features/reviews`
- [Stories](https://github.com/marouenkadri/4horses/tree/main/lib/features/story): `lib/features/story`

### External services

- **Supabase**
- **Stripe payments**
- [Payment functions](https://github.com/marouenkadri/4horses/tree/main/supabase/functions): `supabase/functions`

### Other components

- **Clients**
- **Service providers**

## Connections

- Clients → Flutter app: use
- Service providers → Flutter app: use
- Flutter app → Role navigation: opens
- Role navigation → Accounts: routes
- Role navigation → Service discovery: routes
- Role navigation → Mission lifecycle: routes
- Service discovery → Public profiles: opens
- Clients → Mission lifecycle: create missions
- Service providers → Mission lifecycle: propose work
- Mission lifecycle → Mission data: persists
- Mission data → Supabase: stores data
- Clients → Realtime messaging: message
- Service providers → Realtime messaging: message
- Realtime messaging → Supabase: realtime data
- Notifications → Supabase: uses
- Profiles and finance → Supabase: uses
- Reviews → Supabase: uses
- Stories → Supabase: uses
- Profiles and finance → Stripe payments: payments
- Stripe payments → Payment functions: integrates
