# papirico32/the_watchlist architecture

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

- Interactive diagram: https://gitdiagram.com/papirico32/the_watchlist
- Repository: https://github.com/papirico32/the_watchlist

## Overview

The Watchlist is a Flutter community-and-commerce app backed by a FastAPI service and MySQL. Users register or sign in, browse and publish film/series posts, interact through comments and ratings, message other users, and shop through a simulated checkout; profiles and orders remain available afterward. Administration is a role-gated capability. The README documents the app/API/database relationship and these product features. Flutter implementation details were not sampled, so feature-specific client calls are not asserted; backend domain nodes share the route implementation in `main.py`.

Main entry points: [`backend_API/main.py`](https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py) (FastAPI routes), [`the_watchlist/lib/screens`](https://github.com/papirico32/the_watchlist/tree/main/the_watchlist/lib/screens) (Feature screens), [`backend_API/database.py`](https://github.com/papirico32/the_watchlist/blob/main/backend_API/database.py) (DB sessions), [`the_watchlist/lib/main.dart`](https://github.com/papirico32/the_watchlist/blob/main/the_watchlist/lib/main.dart) (Watchlist app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Flutter app"]
  node_flutter["Watchlist app<br/>[main.dart]"]
  node_client_screens["Feature screens"]
  node_client_api["API client<br/>[api_service.dart]"]
  node_client_auth["Auth state<br/>[auth_provider.dart]"]
  node_client_models["App models<br/>[models.dart]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth_api["Authentication<br/>[main.py]"]
  node_profile_api["Profile management<br/>[main.py]"]
end

subgraph group_community["Community and messaging"]
  node_posts_api["Posts and ratings<br/>[main.py]"]
  node_comments_api["Comments and reactions<br/>[main.py]"]
  node_messages_api["Conversations<br/>[main.py]"]
  node_admin_api["Administration<br/>[main.py]"]
end

subgraph group_commerce["Store and orders"]
  node_catalog_api["Product catalog<br/>[main.py]"]
  node_cart_api["Cart and checkout<br/>[main.py]"]
  node_orders_api["Orders and payment<br/>[main.py]"]
end

subgraph group_platform["API and persistence"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_schemas["Request schemas<br/>[schemas.py]"]
  node_models["ORM models<br/>[models.py]"]
  node_database["DB sessions<br/>[database.py]"]
  node_mysql[("MySQL database")]
end

node_user(("App user"))
node_php_web["Separate PHP web"]

node_user -->|"uses"| node_flutter
node_flutter -.->|"presents"| node_client_screens
node_client_screens -.->|"requests data"| node_client_api
node_client_screens -.->|"uses session"| node_client_auth
node_client_screens -.->|"displays data"| node_client_models
node_client_api -->|"HTTP requests"| node_api
node_client_auth -.->|"authenticates via"| node_auth_api
node_client_screens -.->|"manages profile via"| node_profile_api
node_client_screens -.->|"publishes and browses via"| node_posts_api
node_client_screens -.->|"interacts via"| node_comments_api
node_client_screens -.->|"messages via"| node_messages_api
node_client_screens -.->|"shops via"| node_catalog_api
node_client_screens -.->|"checks out via"| node_cart_api
node_client_screens -.->|"views orders via"| node_orders_api
node_client_screens -.->|"administers via"| node_admin_api
node_api -->|"routes"| node_auth_api
node_api -->|"routes"| node_profile_api
node_api -->|"routes"| node_posts_api
node_api -->|"routes"| node_comments_api
node_api -->|"routes"| node_messages_api
node_api -.->|"routes"| node_catalog_api
node_api -->|"routes"| node_cart_api
node_api -->|"routes"| node_orders_api
node_api -->|"routes"| node_admin_api
node_api -->|"validates with"| node_schemas
node_api -->|"queries"| node_models
node_api -->|"gets sessions"| node_database
node_models -->|"uses base"| node_database
node_database -->|"connects to"| node_mysql
node_php_web -.->|"shares database"| node_mysql

click node_flutter "https://github.com/papirico32/the_watchlist/blob/main/the_watchlist/lib/main.dart"
click node_client_screens "https://github.com/papirico32/the_watchlist/tree/main/the_watchlist/lib/screens"
click node_client_api "https://github.com/papirico32/the_watchlist/blob/main/the_watchlist/lib/services/api_service.dart"
click node_client_auth "https://github.com/papirico32/the_watchlist/blob/main/the_watchlist/lib/state/auth_provider.dart"
click node_client_models "https://github.com/papirico32/the_watchlist/blob/main/the_watchlist/lib/models/models.dart"
click node_auth_api "https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py"
click node_profile_api "https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py"
click node_posts_api "https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py"
click node_comments_api "https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py"
click node_messages_api "https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py"
click node_admin_api "https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py"
click node_catalog_api "https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py"
click node_cart_api "https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py"
click node_orders_api "https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py"
click node_api "https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py"
click node_schemas "https://github.com/papirico32/the_watchlist/blob/main/backend_API/schemas.py"
click node_models "https://github.com/papirico32/the_watchlist/blob/main/backend_API/models.py"
click node_database "https://github.com/papirico32/the_watchlist/blob/main/backend_API/database.py"

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_flutter,node_client_screens,node_client_api,node_client_auth,node_client_models,node_user toneBlue
class node_auth_api,node_profile_api toneAmber
class node_posts_api,node_comments_api,node_messages_api,node_admin_api toneMint
class node_catalog_api,node_cart_api,node_orders_api toneRose
class node_api,node_schemas,node_models,node_database,node_mysql,node_php_web toneIndigo
```

## Components

### Flutter app

- [Watchlist app](https://github.com/papirico32/the_watchlist/blob/main/the_watchlist/lib/main.dart): `the_watchlist/lib/main.dart`
- [Feature screens](https://github.com/papirico32/the_watchlist/tree/main/the_watchlist/lib/screens): `the_watchlist/lib/screens`
- [API client](https://github.com/papirico32/the_watchlist/blob/main/the_watchlist/lib/services/api_service.dart): `the_watchlist/lib/services/api_service.dart`
- [Auth state](https://github.com/papirico32/the_watchlist/blob/main/the_watchlist/lib/state/auth_provider.dart): `the_watchlist/lib/state/auth_provider.dart`
- [App models](https://github.com/papirico32/the_watchlist/blob/main/the_watchlist/lib/models/models.dart): `the_watchlist/lib/models/models.dart`

### Identity and profiles

- [Authentication](https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py): `backend_API/main.py`
- [Profile management](https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py): `backend_API/main.py`

### Community and messaging

- [Posts and ratings](https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py): `backend_API/main.py`
- [Comments and reactions](https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py): `backend_API/main.py`
- [Conversations](https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py): `backend_API/main.py`
- [Administration](https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py): `backend_API/main.py`

### Store and orders

- [Product catalog](https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py): `backend_API/main.py`
- [Cart and checkout](https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py): `backend_API/main.py`
- [Orders and payment](https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py): `backend_API/main.py`

### API and persistence

- [FastAPI routes](https://github.com/papirico32/the_watchlist/blob/main/backend_API/main.py): `backend_API/main.py`
- [Request schemas](https://github.com/papirico32/the_watchlist/blob/main/backend_API/schemas.py): `backend_API/schemas.py`
- [ORM models](https://github.com/papirico32/the_watchlist/blob/main/backend_API/models.py): `backend_API/models.py`
- [DB sessions](https://github.com/papirico32/the_watchlist/blob/main/backend_API/database.py): `backend_API/database.py`
- **MySQL database**

### Other components

- **App user**
- **Separate PHP web**

## Connections

- App user → Watchlist app: uses (evidence: `README.md`)
- Watchlist app → Feature screens: presents
- Feature screens → API client: requests data
- Feature screens → Auth state: uses session
- Feature screens → App models: displays data
- API client → FastAPI routes: HTTP requests (evidence: `README.md`)
- Auth state → Authentication: authenticates via
- Feature screens → Profile management: manages profile via
- Feature screens → Posts and ratings: publishes and browses via
- Feature screens → Comments and reactions: interacts via
- Feature screens → Conversations: messages via
- Feature screens → Product catalog: shops via
- Feature screens → Cart and checkout: checks out via
- Feature screens → Orders and payment: views orders via
- Feature screens → Administration: administers via
- FastAPI routes → Authentication: routes (evidence: `backend_API/main.py`)
- FastAPI routes → Profile management: routes (evidence: `backend_API/main.py`)
- FastAPI routes → Posts and ratings: routes (evidence: `backend_API/main.py`)
- FastAPI routes → Comments and reactions: routes (evidence: `backend_API/main.py`)
- FastAPI routes → Conversations: routes (evidence: `backend_API/main.py`)
- FastAPI routes → Product catalog: routes (evidence: `backend_API/main.py`)
- FastAPI routes → Cart and checkout: routes (evidence: `backend_API/main.py`)
- FastAPI routes → Orders and payment: routes (evidence: `backend_API/main.py`)
- FastAPI routes → Administration: routes (evidence: `backend_API/main.py`)
- FastAPI routes → Request schemas: validates with (evidence: `backend_API/main.py`)
- FastAPI routes → ORM models: queries (evidence: `backend_API/main.py`)
- FastAPI routes → DB sessions: gets sessions (evidence: `backend_API/main.py`)
- ORM models → DB sessions: uses base (evidence: `backend_API/models.py`)
- DB sessions → MySQL database: connects to (evidence: `README.md`)
- Separate PHP web → MySQL database: shares database (evidence: `README.md`)
