# mad-dcoder/matchflix architecture

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

- Interactive diagram: https://gitdiagram.com/mad-dcoder/matchflix
- Repository: https://github.com/mad-dcoder/matchflix

## Overview

MatchFlix is a movie-voting product: people browse a film catalog, form groups, open a session, vote, and see a match when everyone likes the same film. The backend exposes REST controllers over EF Core/MySQL; the frontend provides routing, login, and a dashboard, though group creation is currently only a UI placeholder. Edges reflect README-described capabilities or shown code references; unsampled group, genre, and catalog behavior is summarized from the README rather than treated as inspected implementation.

Main entry points: [`MatchFlix/AppDbContext.cs`](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/AppDbContext.cs) (EF data context), [`matchflix-front/src/App.jsx`](https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/App.jsx) (Page routing), [`matchflix-front/src/pages/services/api.js`](https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/pages/services/api.js) (HTTP client), [`MatchFlix/Controllers/SessoesController.cs`](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/SessoesController.cs) (Voting sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_routes["Page routing<br/>[App.jsx]"]
  node_login["Login UI<br/>[Login.jsx]"]
  node_dashboard["Dashboard<br/>[Home.jsx]"]
  node_api_client["HTTP client<br/>[api.js]"]
  node_signup["User signup UI<br/>[Cadastro.jsx]"]
  node_film_form["Film entry UI<br/>[CadastroFilme.jsx]"]
end

subgraph group_api["REST API"]
  node_user_api["Accounts and login"]
  node_film_api["Film catalog"]
  node_genre_api["Genre catalog"]
  node_group_api["Group membership"]
  node_session_api["Voting sessions"]
end

subgraph group_domain["Voting domain"]
  node_session_stage["Session setup"]
  node_film_selection["Session film selection<br/>[SessaoFilme.cs]"]
  node_votes["Vote recording<br/>[Avaliacao.cs]"]
  node_match_logic["Unanimous match"]
  node_domain_models["User and group records<br/>[Usuarios.cs]"]
  node_film_models["Film and genre records<br/>[Filme.cs]"]
  node_match_model["Match record<br/>[Match.cs]"]
end

subgraph group_storage["Persistence"]
  node_ef_context["EF data context<br/>[AppDbContext.cs]"]
  node_mysql[("MySQL database")]
end

node_user(("Movie group user"))

node_user -->|"opens"| node_routes
node_routes -->|"routes to"| node_login
node_routes -->|"routes to"| node_signup
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_film_form
node_login -->|"uses"| node_api_client
node_dashboard -->|"fetches films"| node_api_client
node_user -->|"signs in"| node_login
node_user -->|"registers"| node_signup
node_user -->|"browses"| node_dashboard
node_api_client -->|"requests catalog"| node_film_api
node_film_form -.->|"submits film"| node_api_client
node_api_client -.->|"calls account routes"| node_user_api
node_user_api -->|"queries and saves"| node_ef_context
node_film_api -->|"queries and saves"| node_ef_context
node_genre_api -->|"queries and saves"| node_ef_context
node_group_api -->|"queries and saves"| node_ef_context
node_session_api -->|"handles requests"| node_session_stage
node_session_api -->|"queries and saves"| node_ef_context
node_session_stage -->|"adds session films"| node_film_selection
node_session_api -->|"records votes"| node_votes
node_session_api -->|"checks unanimity"| node_match_logic
node_match_logic -->|"creates match"| node_match_model
node_ef_context -->|"persists entities"| node_mysql
node_ef_context -->|"maps users"| node_domain_models
node_ef_context -->|"maps catalog"| node_film_models
node_ef_context -->|"maps session films"| node_film_selection
node_ef_context -->|"maps evaluations"| node_votes
node_ef_context -->|"maps matches"| node_match_model

click node_routes "https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/App.jsx"
click node_login "https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/pages/Login/Login.jsx"
click node_dashboard "https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/pages/Home/Home.jsx"
click node_api_client "https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/pages/services/api.js"
click node_signup "https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/pages/cadastro/Cadastro.jsx"
click node_film_form "https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/pages/cadastro/CadastroFilme.jsx"
click node_user_api "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/UsuariosController.cs"
click node_film_api "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/FilmesController.cs"
click node_genre_api "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/GenerosController.cs"
click node_group_api "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/GruposController.cs"
click node_session_api "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/SessoesController.cs"
click node_session_stage "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/SessoesController.cs"
click node_film_selection "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Models/SessaoFilme.cs"
click node_votes "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Models/Avaliacao.cs"
click node_match_logic "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/SessoesController.cs"
click node_domain_models "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Models/Usuarios.cs"
click node_film_models "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Models/Filme.cs"
click node_match_model "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Models/Match.cs"
click node_ef_context "https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/AppDbContext.cs"

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_routes,node_login,node_dashboard,node_api_client,node_signup,node_film_form,node_user toneBlue
class node_user_api,node_film_api,node_genre_api,node_group_api,node_session_api toneAmber
class node_session_stage,node_film_selection,node_votes,node_match_logic,node_domain_models,node_film_models,node_match_model toneMint
class node_ef_context,node_mysql toneRose
```

## Components

### Web client

- [Page routing](https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/App.jsx): `matchflix-front/src/App.jsx`
- [Login UI](https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/pages/Login/Login.jsx): `matchflix-front/src/pages/Login/Login.jsx`
- [Dashboard](https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/pages/Home/Home.jsx): `matchflix-front/src/pages/Home/Home.jsx`
- [HTTP client](https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/pages/services/api.js): `matchflix-front/src/pages/services/api.js`
- [User signup UI](https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/pages/cadastro/Cadastro.jsx): `matchflix-front/src/pages/cadastro/Cadastro.jsx`
- [Film entry UI](https://github.com/mad-dcoder/matchflix/blob/master/matchflix-front/src/pages/cadastro/CadastroFilme.jsx): `matchflix-front/src/pages/cadastro/CadastroFilme.jsx`

### REST API

- [Accounts and login](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/UsuariosController.cs): `MatchFlix/Controllers/UsuariosController.cs`
- [Film catalog](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/FilmesController.cs): `MatchFlix/Controllers/FilmesController.cs`
- [Genre catalog](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/GenerosController.cs): `MatchFlix/Controllers/GenerosController.cs`
- [Group membership](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/GruposController.cs): `MatchFlix/Controllers/GruposController.cs`
- [Voting sessions](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/SessoesController.cs): `MatchFlix/Controllers/SessoesController.cs`

### Voting domain

- [Session setup](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/SessoesController.cs): `MatchFlix/Controllers/SessoesController.cs`
- [Session film selection](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Models/SessaoFilme.cs): `MatchFlix/Models/SessaoFilme.cs`
- [Vote recording](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Models/Avaliacao.cs): `MatchFlix/Models/Avaliacao.cs`
- [Unanimous match](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Controllers/SessoesController.cs): `MatchFlix/Controllers/SessoesController.cs`
- [User and group records](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Models/Usuarios.cs): `MatchFlix/Models/Usuarios.cs`
- [Film and genre records](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Models/Filme.cs): `MatchFlix/Models/Filme.cs`
- [Match record](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/Models/Match.cs): `MatchFlix/Models/Match.cs`

### Persistence

- [EF data context](https://github.com/mad-dcoder/matchflix/blob/master/MatchFlix/AppDbContext.cs): `MatchFlix/AppDbContext.cs`
- **MySQL database**

### Other components

- **Movie group user**

## Connections

- Movie group user → Page routing: opens (evidence: `matchflix-front/src/App.jsx`)
- Page routing → Login UI: routes to (evidence: `matchflix-front/src/App.jsx`)
- Page routing → User signup UI: routes to (evidence: `matchflix-front/src/App.jsx`)
- Page routing → Dashboard: routes to (evidence: `matchflix-front/src/App.jsx`)
- Page routing → Film entry UI: routes to (evidence: `matchflix-front/src/App.jsx`)
- Login UI → HTTP client: uses (evidence: `matchflix-front/src/pages/Login/Login.jsx`)
- Dashboard → HTTP client: fetches films (evidence: `matchflix-front/src/pages/Home/Home.jsx`)
- Movie group user → Login UI: signs in (evidence: `matchflix-front/src/pages/Login/Login.jsx`)
- Movie group user → User signup UI: registers (evidence: `matchflix-front/src/pages/cadastro/Cadastro.jsx`)
- Movie group user → Dashboard: browses (evidence: `matchflix-front/src/pages/Home/Home.jsx`)
- HTTP client → Film catalog: requests catalog
- Film entry UI → HTTP client: submits film
- HTTP client → Accounts and login: calls account routes
- Accounts and login → EF data context: queries and saves (evidence: `MatchFlix/Controllers/UsuariosController.cs`)
- Film catalog → EF data context: queries and saves (evidence: `MatchFlix/Controllers/FilmesController.cs`)
- Genre catalog → EF data context: queries and saves (evidence: `MatchFlix/Controllers/GenerosController.cs`)
- Group membership → EF data context: queries and saves (evidence: `MatchFlix/Controllers/GruposController.cs`)
- Voting sessions → Session setup: handles requests (evidence: `MatchFlix/Controllers/SessoesController.cs`)
- Voting sessions → EF data context: queries and saves (evidence: `MatchFlix/Controllers/SessoesController.cs`)
- Session setup → Session film selection: adds session films (evidence: `MatchFlix/Controllers/SessoesController.cs`)
- Voting sessions → Vote recording: records votes (evidence: `MatchFlix/Controllers/SessoesController.cs`)
- Voting sessions → Unanimous match: checks unanimity (evidence: `MatchFlix/Controllers/SessoesController.cs`)
- Unanimous match → Match record: creates match (evidence: `MatchFlix/Controllers/SessoesController.cs`)
- EF data context → MySQL database: persists entities (evidence: `MatchFlix/AppDbContext.cs`)
- EF data context → User and group records: maps users (evidence: `MatchFlix/AppDbContext.cs`)
- EF data context → Film and genre records: maps catalog (evidence: `MatchFlix/AppDbContext.cs`)
- EF data context → Session film selection: maps session films (evidence: `MatchFlix/AppDbContext.cs`)
- EF data context → Vote recording: maps evaluations (evidence: `MatchFlix/AppDbContext.cs`)
- EF data context → Match record: maps matches (evidence: `MatchFlix/AppDbContext.cs`)
