# dmartins21/myfilms architecture

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

- Interactive diagram: https://gitdiagram.com/dmartins21/myfilms
- Repository: https://github.com/dmartins21/myfilms

## Overview

MyFilms is a film-catalogue and community application: users browse, search and filter films, manage favorites and profiles, and publish or read posts; administrators can manage the catalogue. The browser routes requests through frontend pages and API clients to ASP.NET controllers, which use repositories and an Entity Framework context for persistence. The graph preserves auth, profile/favorites, posts and film discovery as distinct capabilities. Backend controller and repository links are evidenced by the source index and excerpts; frontend-to-API links are shown only where the index or excerpts support them.

Main entry points: [`frontend/myfilms/src/routes/route.jsx`](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/routes/route.jsx) (Route access), [`backend/myfilms/Context/AppDbContext.cs`](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Context/AppDbContext.cs) (Entity context), [`backend/myfilms/Repositories/UnityOfWork.cs`](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Repositories/UnityOfWork.cs) (Unit of work), [`frontend/myfilms/src/pages/Filmes/submitFilm.jsx`](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Filmes/submitFilm.jsx) (Film submission)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_routes["Route access<br/>[route.jsx]"]
  node_film_ui["Film browsing<br/>[index.jsx]"]
  node_film_detail["Film details<br/>[details.jsx]"]
  node_film_submit["Film submission<br/>[submitFilm.jsx]"]
  node_post_ui["Post browsing<br/>[index.jsx]"]
  node_post_detail["Post details<br/>[details.jsx]"]
  node_post_create["Post authoring<br/>[newPost.jsx]"]
  node_account_ui["Account pages<br/>[login.jsx]"]
  node_user_ui["Profile and favorites<br/>[myFavFilms.jsx]"]
  node_film_api_client["Film API client<br/>[filmesApi.jsx]"]
  node_post_api_client["Post API client<br/>[blogPostApi.jsx]"]
  node_account_api_client["Account API client<br/>[loginApi.jsx]"]
  node_user_api_client["User API client<br/>[userApi.jsx]"]
end

subgraph group_api["Backend API"]
  node_film_controller["Film endpoints<br/>[FilmeController.cs]"]
  node_post_controller["Post endpoints"]
  node_client_controller["Client endpoints"]
  node_auth_controller["Authentication endpoints<br/>[AuthController.cs]"]
end

subgraph group_domain["Domain and persistence"]
  node_film_repository["Film queries<br/>[FilmeRepository.cs]"]
  node_post_repository["Post queries"]
  node_client_repository["Client and favorites"]
  node_work["Unit of work<br/>[UnityOfWork.cs]"]
  node_db_context["Entity context<br/>[AppDbContext.cs]"]
  node_db[("Application database<br/>[AppDbContext.cs]")]
  node_film_model["Film records<br/>[Filme.cs]"]
  node_post_model["Post records<br/>[BlogPost.cs]"]
  node_client_model["Client records<br/>[Client.cs]"]
end

subgraph group_identity["Identity"]
  node_user_model["Identity user<br/>[User.cs]"]
  node_token_service["Token service<br/>[TokenService.cs]"]
  node_token_interface["Token contract<br/>[ITokenService.cs]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens routes"| node_routes
node_routes -->|"routes to"| node_film_ui
node_routes -->|"routes to"| node_film_detail
node_routes -->|"role-gates"| node_film_submit
node_routes -->|"routes to"| node_post_ui
node_routes -->|"routes to"| node_post_detail
node_routes -->|"routes to"| node_post_create
node_routes -->|"routes to"| node_account_ui
node_routes -->|"routes to"| node_user_ui
node_film_submit -->|"calls"| node_film_api_client
node_post_detail -->|"calls"| node_post_api_client
node_account_ui -->|"calls"| node_account_api_client
node_user_ui -->|"calls"| node_user_api_client
node_film_api_client -.->|"HTTP requests"| node_film_controller
node_post_api_client -.->|"HTTP requests"| node_post_controller
node_user_api_client -.->|"HTTP requests"| node_client_controller
node_account_api_client -.->|"HTTP requests"| node_auth_controller
node_film_controller -->|"uses repositories"| node_work
node_post_controller -->|"uses repositories"| node_work
node_client_controller -->|"uses repositories"| node_work
node_auth_controller -->|"issues tokens"| node_token_service
node_work -->|"exposes"| node_film_repository
node_work -->|"exposes"| node_post_repository
node_work -->|"exposes"| node_client_repository
node_film_repository -->|"queries"| node_db_context
node_post_repository -->|"queries"| node_db_context
node_client_repository -->|"queries"| node_db_context
node_db_context -.->|"persists entities"| node_db
node_db_context -->|"maps"| node_film_model
node_db_context -->|"maps"| node_post_model
node_db_context -->|"maps"| node_client_model
node_db_context -->|"maps"| node_user_model
node_token_service -->|"implements"| node_token_interface

click node_routes "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/routes/route.jsx"
click node_film_ui "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Filmes/index.jsx"
click node_film_detail "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Filmes/details.jsx"
click node_film_submit "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Filmes/submitFilm.jsx"
click node_post_ui "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Posts/index.jsx"
click node_post_detail "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Posts/details.jsx"
click node_post_create "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Posts/newPost.jsx"
click node_account_ui "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Login/login.jsx"
click node_user_ui "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/User/myFavFilms.jsx"
click node_film_api_client "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/services/filmesApi.jsx"
click node_post_api_client "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/services/blogPostApi.jsx"
click node_account_api_client "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/services/loginApi.jsx"
click node_user_api_client "https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/services/userApi.jsx"
click node_film_controller "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Controllers/FilmeController.cs"
click node_post_controller "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Controllers/BlogPostController.cs"
click node_client_controller "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Controllers/ClientController.cs"
click node_auth_controller "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Controllers/AuthController.cs"
click node_film_repository "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Repositories/FilmeRepository.cs"
click node_post_repository "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Repositories/BlogPostRepository.cs"
click node_client_repository "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Repositories/ClientRepository.cs"
click node_work "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Repositories/UnityOfWork.cs"
click node_db_context "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Context/AppDbContext.cs"
click node_db "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Context/AppDbContext.cs"
click node_film_model "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Models/Filme.cs"
click node_post_model "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Models/BlogPost.cs"
click node_client_model "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Models/Client.cs"
click node_user_model "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Models/User.cs"
click node_token_service "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Services/TokenService.cs"
click node_token_interface "https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Services/ITokenService.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_film_ui,node_film_detail,node_film_submit,node_post_ui,node_post_detail,node_post_create,node_account_ui,node_user_ui,node_film_api_client,node_post_api_client,node_account_api_client,node_user_api_client toneBlue
class node_film_controller,node_post_controller,node_client_controller,node_auth_controller toneAmber
class node_film_repository,node_post_repository,node_client_repository,node_work,node_db_context,node_db,node_film_model,node_post_model,node_client_model toneMint
class node_user_model,node_token_service,node_token_interface toneRose
class node_visitor toneIndigo
```

## Components

### Web application

- [Route access](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/routes/route.jsx): `frontend/myfilms/src/routes/route.jsx`
- [Film browsing](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Filmes/index.jsx): `frontend/myfilms/src/pages/Filmes/index.jsx`
- [Film details](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Filmes/details.jsx): `frontend/myfilms/src/pages/Filmes/details.jsx`
- [Film submission](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Filmes/submitFilm.jsx): `frontend/myfilms/src/pages/Filmes/submitFilm.jsx`
- [Post browsing](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Posts/index.jsx): `frontend/myfilms/src/pages/Posts/index.jsx`
- [Post details](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Posts/details.jsx): `frontend/myfilms/src/pages/Posts/details.jsx`
- [Post authoring](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Posts/newPost.jsx): `frontend/myfilms/src/pages/Posts/newPost.jsx`
- [Account pages](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/Login/login.jsx): `frontend/myfilms/src/pages/Login/login.jsx`
- [Profile and favorites](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/pages/User/myFavFilms.jsx): `frontend/myfilms/src/pages/User/myFavFilms.jsx`
- [Film API client](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/services/filmesApi.jsx): `frontend/myfilms/src/services/filmesApi.jsx`
- [Post API client](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/services/blogPostApi.jsx): `frontend/myfilms/src/services/blogPostApi.jsx`
- [Account API client](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/services/loginApi.jsx): `frontend/myfilms/src/services/loginApi.jsx`
- [User API client](https://github.com/dmartins21/myfilms/blob/main/frontend/myfilms/src/services/userApi.jsx): `frontend/myfilms/src/services/userApi.jsx`

### Backend API

- [Film endpoints](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Controllers/FilmeController.cs): `backend/myfilms/Controllers/FilmeController.cs`
- [Post endpoints](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Controllers/BlogPostController.cs): `backend/myfilms/Controllers/BlogPostController.cs`
- [Client endpoints](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Controllers/ClientController.cs): `backend/myfilms/Controllers/ClientController.cs`
- [Authentication endpoints](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Controllers/AuthController.cs): `backend/myfilms/Controllers/AuthController.cs`

### Domain and persistence

- [Film queries](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Repositories/FilmeRepository.cs): `backend/myfilms/Repositories/FilmeRepository.cs`
- [Post queries](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Repositories/BlogPostRepository.cs): `backend/myfilms/Repositories/BlogPostRepository.cs`
- [Client and favorites](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Repositories/ClientRepository.cs): `backend/myfilms/Repositories/ClientRepository.cs`
- [Unit of work](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Repositories/UnityOfWork.cs): `backend/myfilms/Repositories/UnityOfWork.cs`
- [Entity context](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Context/AppDbContext.cs): `backend/myfilms/Context/AppDbContext.cs`
- [Application database](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Context/AppDbContext.cs): `backend/myfilms/Context/AppDbContext.cs`
- [Film records](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Models/Filme.cs): `backend/myfilms/Models/Filme.cs`
- [Post records](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Models/BlogPost.cs): `backend/myfilms/Models/BlogPost.cs`
- [Client records](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Models/Client.cs): `backend/myfilms/Models/Client.cs`

### Identity

- [Identity user](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Models/User.cs): `backend/myfilms/Models/User.cs`
- [Token service](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Services/TokenService.cs): `backend/myfilms/Services/TokenService.cs`
- [Token contract](https://github.com/dmartins21/myfilms/blob/main/backend/myfilms/Services/ITokenService.cs): `backend/myfilms/Services/ITokenService.cs`

### Other components

- **Visitor**

## Connections

- Visitor → Route access: opens routes (evidence: `frontend/myfilms/src/routes/route.jsx`)
- Route access → Film browsing: routes to (evidence: `frontend/myfilms/src/routes/route.jsx`)
- Route access → Film details: routes to (evidence: `frontend/myfilms/src/routes/route.jsx`)
- Route access → Film submission: role-gates (evidence: `frontend/myfilms/src/routes/route.jsx`)
- Route access → Post browsing: routes to (evidence: `frontend/myfilms/src/routes/route.jsx`)
- Route access → Post details: routes to (evidence: `frontend/myfilms/src/routes/route.jsx`)
- Route access → Post authoring: routes to (evidence: `frontend/myfilms/src/routes/route.jsx`)
- Route access → Account pages: routes to (evidence: `frontend/myfilms/src/routes/route.jsx`)
- Route access → Profile and favorites: routes to (evidence: `frontend/myfilms/src/routes/route.jsx`)
- Film submission → Film API client: calls (evidence: `frontend/myfilms/src/pages/Filmes/submitFilm.jsx`)
- Post details → Post API client: calls (evidence: `frontend/myfilms/src/pages/Posts/details.jsx`)
- Account pages → Account API client: calls
- Profile and favorites → User API client: calls (evidence: `frontend/myfilms/src/pages/User/myFavFilms.jsx`)
- Film API client → Film endpoints: HTTP requests
- Post API client → Post endpoints: HTTP requests
- User API client → Client endpoints: HTTP requests
- Account API client → Authentication endpoints: HTTP requests
- Film endpoints → Unit of work: uses repositories (evidence: `backend/myfilms/Controllers/FilmeController.cs`)
- Post endpoints → Unit of work: uses repositories (evidence: `backend/myfilms/Controllers/BlogPostController.cs`)
- Client endpoints → Unit of work: uses repositories (evidence: `backend/myfilms/Controllers/ClientController.cs`)
- Authentication endpoints → Token service: issues tokens (evidence: `backend/myfilms/Controllers/AuthController.cs`)
- Unit of work → Film queries: exposes
- Unit of work → Post queries: exposes
- Unit of work → Client and favorites: exposes
- Film queries → Entity context: queries (evidence: `backend/myfilms/Repositories/FilmeRepository.cs`)
- Post queries → Entity context: queries (evidence: `backend/myfilms/Repositories/BlogPostRepository.cs`)
- Client and favorites → Entity context: queries (evidence: `backend/myfilms/Repositories/ClientRepository.cs`)
- Entity context → Application database: persists entities (evidence: `backend/myfilms/Context/AppDbContext.cs`)
- Entity context → Film records: maps (evidence: `backend/myfilms/Context/AppDbContext.cs`)
- Entity context → Post records: maps (evidence: `backend/myfilms/Context/AppDbContext.cs`)
- Entity context → Client records: maps (evidence: `backend/myfilms/Context/AppDbContext.cs`)
- Entity context → Identity user: maps (evidence: `backend/myfilms/Context/AppDbContext.cs`)
- Token service → Token contract: implements (evidence: `backend/myfilms/Services/TokenService.cs`)
