# devmauriciojunior/projeto-uninter-raizesdonorderste architecture

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

- Interactive diagram: https://gitdiagram.com/devmauriciojunior/projeto-uninter-raizesdonorderste
- Repository: https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste

## Overview

A FastAPI API for user registration/authentication and order creation, payment, and channel-filtered listing. The main workflow is a client or attendant submitting an order: the route delegates to order services, which check user, product, and stock data, save the order, and later process mock payment and update order status and loyalty points. Authentication is a separate branch using password hashing and JWT-based profile checks. The README also documents SQLite persistence and role-based access. Relationships reflect shown calls/imports and README statements; unsampled subsystems are not inferred.

Main entry points: [`api/rotas_usuarios.py`](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/api/rotas_usuarios.py) (User routes), [`api/rotas_pedidos.py`](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/api/rotas_pedidos.py) (Order routes), [`infrastructure/database.py`](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/infrastructure/database.py) (Database session), [`main.py`](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/main.py) (FastAPI app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_app["FastAPI app<br/>[main.py]"]
  node_user_routes["User routes<br/>[rotas_usuarios.py]"]
  node_order_routes["Order routes<br/>[rotas_pedidos.py]"]
end

subgraph group_domain["Domain and services"]
  node_schemas["Request schemas<br/>[schemas.py]"]
  node_enums["Order and role enums<br/>[enums.py]"]
  node_user_service["User service<br/>[services.py]"]
  node_order_service["Order service<br/>[services.py]"]
end

subgraph group_infra["Persistence and integrations"]
  node_repositories["Data repositories<br/>[repositories.py]"]
  node_models["SQLAlchemy models<br/>[models.py]"]
  node_database["Database session<br/>[database.py]"]
  node_sqlite[("SQLite store")]
  node_payment["Mock payment gateway"]
end

subgraph group_identity["Identity and access"]
  node_security["JWT and passwords<br/>[security.py]"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_app
node_app -->|"registers router"| node_user_routes
node_app -->|"registers router"| node_order_routes
node_app -->|"creates tables"| node_database
node_order_routes -->|"delegates orders"| node_order_service
node_user_routes -->|"delegates registration"| node_user_service
node_user_routes -->|"looks up login"| node_repositories
node_user_routes -->|"verifies and issues"| node_security
node_order_routes -->|"checks profile"| node_security
node_order_routes -->|"injects session"| node_database
node_user_routes -->|"injects session"| node_database
node_order_routes -->|"validates and responds"| node_schemas
node_user_routes -->|"validates and responds"| node_schemas
node_schemas -->|"uses enums"| node_enums
node_order_service -->|"queries and saves"| node_repositories
node_order_service -->|"processes payment"| node_payment
node_order_service -->|"hashes password"| node_security
node_user_service -->|"checks and saves"| node_repositories
node_user_service -->|"hashes password"| node_security
node_repositories -->|"queries models"| node_models
node_models -->|"uses base"| node_database
node_models -->|"uses enums"| node_enums
node_database -->|"persists data"| node_sqlite

click node_app "https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/main.py"
click node_user_routes "https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/api/rotas_usuarios.py"
click node_order_routes "https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/api/rotas_pedidos.py"
click node_schemas "https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/domain/schemas.py"
click node_enums "https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/domain/enums.py"
click node_user_service "https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/application/services.py"
click node_order_service "https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/application/services.py"
click node_security "https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/infrastructure/security.py"
click node_repositories "https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/infrastructure/repositories.py"
click node_models "https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/infrastructure/models.py"
click node_database "https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/infrastructure/database.py"
click node_payment "https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/infrastructure/gateway_pagamento.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_app,node_user_routes,node_order_routes,node_client toneBlue
class node_schemas,node_enums,node_user_service,node_order_service toneAmber
class node_repositories,node_models,node_database,node_sqlite,node_payment toneMint
class node_security toneRose
```

## Components

### API entry

- [FastAPI app](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/main.py): `main.py`
- [User routes](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/api/rotas_usuarios.py): `api/rotas_usuarios.py`
- [Order routes](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/api/rotas_pedidos.py): `api/rotas_pedidos.py`

### Domain and services

- [Request schemas](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/domain/schemas.py): `domain/schemas.py`
- [Order and role enums](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/domain/enums.py): `domain/enums.py`
- [User service](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/application/services.py): `application/services.py`
- [Order service](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/application/services.py): `application/services.py`

### Persistence and integrations

- [Data repositories](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/infrastructure/repositories.py): `infrastructure/repositories.py`
- [SQLAlchemy models](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/infrastructure/models.py): `infrastructure/models.py`
- [Database session](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/infrastructure/database.py): `infrastructure/database.py`
- **SQLite store**
- [Mock payment gateway](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/infrastructure/gateway_pagamento.py): `infrastructure/gateway_pagamento.py`

### Identity and access

- [JWT and passwords](https://github.com/devmauriciojunior/projeto-uninter-raizesdonorderste/blob/main/infrastructure/security.py): `infrastructure/security.py`

### Other components

- **API client**

## Connections

- API client → FastAPI app: sends requests (evidence: `README.md`)
- FastAPI app → User routes: registers router (evidence: `main.py`)
- FastAPI app → Order routes: registers router (evidence: `main.py`)
- FastAPI app → Database session: creates tables (evidence: `main.py`)
- Order routes → Order service: delegates orders (evidence: `api/rotas_pedidos.py`)
- User routes → User service: delegates registration (evidence: `api/rotas_usuarios.py`)
- User routes → Data repositories: looks up login (evidence: `api/rotas_usuarios.py`)
- User routes → JWT and passwords: verifies and issues (evidence: `api/rotas_usuarios.py`)
- Order routes → JWT and passwords: checks profile (evidence: `api/rotas_pedidos.py`)
- Order routes → Database session: injects session (evidence: `api/rotas_pedidos.py`)
- User routes → Database session: injects session (evidence: `api/rotas_usuarios.py`)
- Order routes → Request schemas: validates and responds (evidence: `api/rotas_pedidos.py`)
- User routes → Request schemas: validates and responds (evidence: `api/rotas_usuarios.py`)
- Request schemas → Order and role enums: uses enums (evidence: `domain/schemas.py`)
- Order service → Data repositories: queries and saves (evidence: `application/services.py`)
- Order service → Mock payment gateway: processes payment (evidence: `application/services.py`)
- Order service → JWT and passwords: hashes password (evidence: `application/services.py`)
- User service → Data repositories: checks and saves (evidence: `application/services.py`)
- User service → JWT and passwords: hashes password (evidence: `application/services.py`)
- Data repositories → SQLAlchemy models: queries models (evidence: `infrastructure/repositories.py`)
- SQLAlchemy models → Database session: uses base (evidence: `infrastructure/models.py`)
- SQLAlchemy models → Order and role enums: uses enums (evidence: `infrastructure/models.py`)
- Database session → SQLite store: persists data (evidence: `README.md`)
