How ricardoshuree/gasfavero works
Gasfavero is a gas-sales ERP with a separate driver app, backed by a FastAPI service and PostgreSQL/Supabase. Office users authenticate, use operational and administrative screens, and send requests to backend routes for sales, customers, finance, inventory-related work, mapping and access management. Drivers use a mobile workflow for demands and sales, plus finance and account tasks. The README documents closed-system local/Google authentication and RBAC. Route and persistence internals were not sampled, so domain-specific backend wiring is shown only at the supported router boundary.
Main entry points: api/main.py API router · app/main.py FastAPI app · routes ERP screens · useAuth.ts Frontend auth
Components 21
ERP frontend
- ERP screens
frontend/src/routes - Frontend auth
frontend/src/hooks/useAuth.ts - Permission UI
frontend/src/hooks/usePermissions.ts
Driver app
- Driver workflow
frontend-motorista/src/App.tsx - Driver sales
frontend-motorista/src/components/VendasTela.tsx - Driver API client
frontend-motorista/src/lib/api.ts
Backend service
- FastAPI app
backend/app/main.py - API router
backend/app/api/main.py - Auth dependencies
backend/app/api/deps.py - Sales operations
backend/app/api/routes/vendas.py - Customer operations
backend/app/api/routes/clientes.py - Finance operations
backend/app/api/routes/fechamento.py - RBAC management
backend/app/api/routes/roles.py - Other operations
backend/app/api/routes
Data and identity
- ERP models
backend/app/models.py - Database access
backend/app/core/db.py - Supabase auth
frontend/src/lib/supabase.ts
Other components
- Office user
- Driver
- PostgreSQL
- Supabase Auth
Connections 21
- Office user → ERP screens: uses
- ERP screens → Frontend auth: authenticates through
- Frontend auth → FastAPI app: login requests
- Frontend auth → Supabase auth: starts OAuth
- Supabase auth → Supabase Auth: authenticates with
- ERP screens → FastAPI app: API requests
- Permission UI → FastAPI app: permission requests
- FastAPI app → API router: dispatches
- API router → Auth dependencies: includes auth routes
- API router → Sales operations: includes routes
- API router → Customer operations: includes routes
- API router → Finance operations: includes routes
- API router → RBAC management: includes routes
- API router → Other operations: includes routes
- Driver → Driver workflow: uses
- Driver workflow → Driver sales: opens sales
- Driver workflow → Driver API client: uses
- Driver API client → FastAPI app: API requests
- Database access → ERP models: uses models
- Database access → PostgreSQL: reads and writes
- API router → Database access: persists operational data