# gustavopurkoot/barbearia_csharp architecture

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

- Interactive diagram: https://gitdiagram.com/gustavopurkoot/barbearia_csharp
- Repository: https://github.com/gustavopurkoot/barbearia_csharp

## Overview

Barbearia is a .NET Minimal API for managing barbershop services and appointments. An API client uses the service endpoints to list, retrieve, create, update, or delete services; appointment endpoints provide the same operations for bookings, including future-date and duration-aware conflict checks on creation. Both workflows use Entity Framework Core context sets backed by SQLite. The domain models represent services and appointments, with appointments linked to a service. The README documents these capabilities; the graph’s implementation links are based on the sampled Program.cs and model/context excerpts.

Main entry points: [`Barbearia/Program.cs`](https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Program.cs) (Service endpoints), [`Barbearia/Data/AppDataContext.cs`](https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Data/AppDataContext.cs) (EF context), [`Barbearia/Models/Agendamento.cs`](https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Models/Agendamento.cs) (Appointment), [`Barbearia/Models/Servico.cs`](https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Models/Servico.cs) (Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API workflows"]
  node_service_api["Service endpoints<br/>[Program.cs]"]
  node_booking_api["Appointment endpoints<br/>[Program.cs]"]
end

subgraph group_domain["Barbershop domain"]
  node_service["Service<br/>[Servico.cs]"]
  node_appointment["Appointment<br/>[Agendamento.cs]"]
end

subgraph group_persistence["Persistence"]
  node_context["EF context<br/>[AppDataContext.cs]"]
  node_sqlite[("SQLite database")]
end

node_client(("API client"))

node_client -->|"calls"| node_service_api
node_client -->|"calls"| node_booking_api
node_service_api -->|"reads and writes"| node_context
node_booking_api -->|"reads and writes"| node_context
node_context -->|"tracks"| node_service
node_context -->|"tracks"| node_appointment
node_appointment -->|"references"| node_service
node_service_api -->|"handles"| node_service
node_booking_api -->|"handles"| node_appointment
node_service_api -->|"configures via EF"| node_sqlite
node_booking_api -->|"configures via EF"| node_sqlite

click node_service_api "https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Program.cs"
click node_booking_api "https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Program.cs"
click node_service "https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Models/Servico.cs"
click node_appointment "https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Models/Agendamento.cs"
click node_context "https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Data/AppDataContext.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_service_api,node_booking_api,node_client toneBlue
class node_service,node_appointment toneAmber
class node_context,node_sqlite toneMint
```

## Components

### API workflows

- [Service endpoints](https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Program.cs): `Barbearia/Program.cs`
- [Appointment endpoints](https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Program.cs): `Barbearia/Program.cs`

### Barbershop domain

- [Service](https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Models/Servico.cs): `Barbearia/Models/Servico.cs`
- [Appointment](https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Models/Agendamento.cs): `Barbearia/Models/Agendamento.cs`

### Persistence

- [EF context](https://github.com/gustavopurkoot/barbearia_csharp/blob/main/Barbearia/Data/AppDataContext.cs): `Barbearia/Data/AppDataContext.cs`
- **SQLite database**

### Other components

- **API client**

## Connections

- API client → Service endpoints: calls (evidence: `README.md`)
- API client → Appointment endpoints: calls (evidence: `README.md`)
- Service endpoints → EF context: reads and writes (evidence: `Barbearia/Program.cs`)
- Appointment endpoints → EF context: reads and writes (evidence: `Barbearia/Program.cs`)
- EF context → Service: tracks (evidence: `Barbearia/Data/AppDataContext.cs`)
- EF context → Appointment: tracks (evidence: `Barbearia/Data/AppDataContext.cs`)
- Appointment → Service: references (evidence: `Barbearia/Models/Agendamento.cs`)
- Service endpoints → Service: handles (evidence: `Barbearia/Program.cs`)
- Appointment endpoints → Appointment: handles (evidence: `Barbearia/Program.cs`)
- Service endpoints → SQLite database: configures via EF (evidence: `Barbearia/Program.cs`)
- Appointment endpoints → SQLite database: configures via EF (evidence: `Barbearia/Program.cs`)
