How jotapekk/erp works
This is a small FastAPI ERP for managing products, categories, and suppliers, with a static web interface. A client reaches the application entry point, which exposes health and domain routes and serves static files. The domain workflow covers catalog CRUD, product reference validation, and safeguards against disabling categories or suppliers that still have active products. SQLAlchemy models and a shared database session support persistence. The README is empty, so capabilities are inferred from the sampled routes; unsampled static UI behavior and database configuration details are not assumed.
Main entry points: database.py Database sessions · main.py FastAPI application · produtos.py Product API · categorias.py Category API
Components 15
Application entry
- FastAPI application
app/main.py - Static interface
static/index.html
ERP catalog
- Category API
app/routers/categorias.py - Category schemas
app/schemas/categoria.py - Category model
app/models/categoria.py - Supplier API
app/routers/fornecedores.py - Supplier schemas
app/schemas/fornecedor.py - Supplier model
app/models/fornecedor.py - Product API
app/routers/produtos.py - Product schemas
app/schemas/produto.py - Product model
app/models/produto.py
Integrity rules
- Integrity checks
app/services/integridade.py
Persistence
- Database sessions
app/database.py - Database configuration
app/config.py
Other components
- Client
Connections 24
- Client → FastAPI application: requests
app/main.py - FastAPI application → Category API: registers routes
app/main.py - FastAPI application → Supplier API: registers routes
app/main.py - FastAPI application → Product API: registers routes
app/main.py - FastAPI application → Database sessions: creates tables
app/main.py - FastAPI application → Static interface: serves files
app/main.py - Category API → Category schemas: validates data
app/routers/categorias.py - Category API → Category model: queries and updates
app/routers/categorias.py - Category API → Database sessions: gets sessions
app/routers/categorias.py - Category API → Integrity checks: checks active products
app/routers/categorias.py - Supplier API → Supplier schemas: validates data
app/routers/fornecedores.py - Supplier API → Supplier model: queries and updates
app/routers/fornecedores.py - Supplier API → Database sessions: gets sessions
app/routers/fornecedores.py - Supplier API → Integrity checks: checks active products
app/routers/fornecedores.py - Product API → Product schemas: validates data
app/routers/produtos.py - Product API → Product model: queries and updates
app/routers/produtos.py - Product API → Category model: checks category
app/routers/produtos.py - Product API → Supplier model: checks supplier
app/routers/produtos.py - Product API → Database sessions: gets sessions
app/routers/produtos.py - Integrity checks → Product model: counts active products
app/services/integridade.py - Category model → Database sessions: uses ORM base
app/models/categoria.py - Supplier model → Database sessions: uses ORM base
app/models/fornecedor.py - Product model → Database sessions: uses ORM base
app/models/produto.py - Database sessions → Database configuration: loads URL
app/database.py