This service loads environment variables from env/.env
- Create the environment file:
cp env/.env.example env/.env- Adjust the values for your environment:
| Variable | Usage | Default |
|---|---|---|
| APP_HOST | Host/IP where the HTTP server listens | 127.0.0.1 |
| APP_PORT | HTTP server port | 8000 |
| DATABASE_URL | Database connection string | |
| JWT_SECRET | Secret used to sign/verify JWT | dev-secret |
| JWT_EXP_HOURS | JWT token expiration in hours | 24 |
| PASSWORD_RESET_EXP_MINUTES | Password reset token expiration in minutes | 30 |
| PASSWORD_RESET_URL_BASE | Public frontend base URL for password reset (e.g. http://localhost:3000/reset-password) | empty |
Optional variable:
- APP_ENV: environment value reported by the system endpoint (defaults to development).
Schema migrations and seeders run separately.
Default seeded credentials
- admin / ContraseniaSegura2026!
- manager / ContraseniaSegura2026!
- auditor / ContraseniaSegura2026!
- default / ContraseniaSegura2026!
- Apply migrations (table structure only):
cargo run --manifest-path migrations/Cargo.toml --bin migrate- Run seeders (initial data):
cargo run --manifest-path migrations/Cargo.toml --bin seedcargo runcargo build --release
./target/release/money_manager_backendStart development environment (incremental compilation with cache volumes):
cd docker
docker compose --profile dev up -d --buildStart production environment (release build):
cd docker
docker compose --profile prod up -d --buildNote: use only one profile at a time to avoid port conflicts on 8000.
Stop:
cd docker
docker compose --profile dev downThe API exposes interactive documentation generated with utoipa.
- Swagger UI: http://localhost:8000/swagger/
- OpenAPI JSON specification: http://localhost:8000/api-docs/openapi.json
| Group | Resources |
|---|---|
| Functional Entities | users, accounts, categories, transactions |
| Catalogs | currencies, transaction_types |
| Security | audit_logs |
| Role | Functional Entities | Catalogs | Security |
|---|---|---|---|
| Admin | CRUD (any) | CRUD (any) | Read (any) |
| Manager | Create (any) + RUD (own) | CRUD (any) | - |
| Auditor | Read (any) | Read (any) | Read (any) |
| User | CRUD (own) | - | - |
graph LR
%% Role definitions
subgraph Roles
Admin((Admin))
Manager((Manager))
Auditor((Auditor))
User((User))
end
%% Resource definitions
subgraph Entidades["Functional Entities"]
EF[users, accounts, categories, transactions]
end
subgraph Catalogos["Catalogs"]
CT[currencies, transaction_types]
end
subgraph Auditoria["Security"]
AL[audit_logs]
end
%% Admin relations
Admin -- "CRUD (any)" --> EF
Admin -- "CRUD (any)" --> CT
Admin -- "Read (any)" --> AL
%% Manager relations
Manager -- "Create (any)" --> EF
Manager -- "RUD (own)" --> EF
Manager -- "CRUD (any)" --> CT
%% Auditor relations
Auditor -- "Read (any)" --> EF
Auditor -- "Read (any)" --> CT
Auditor -- "Read (any)" --> AL
%% User relations
User -- "CRUD (own)" --> EF
%% Styles
style Admin fill:#f96,stroke:#333,stroke-width:2px
style Manager fill:#69f,stroke:#333
style Auditor fill:#9f9,stroke:#333
style User fill:#ddd,stroke:#333