How sysfaisal/nyobarust works
Nyobarust is a Rust/Axum API for perfume and related inventory, sales, and revenue operations, with user authentication. The principal workflow is an HTTP request routed to a domain handler, processed by a service, and answered through API response DTOs. The tree identifies distinct domain modules, but route and service implementations were not provided, so detailed dispatch, persistence, validation, and authentication wiring is not asserted.
Main entry points: handlers/mod.rs Domain handlers · main.rs Server startup · c_auth/mod.rs Authentication · route.rs HTTP routing
Components 26
API runtime
- Server startup
src/main.rs - HTTP routing
src/route/route.rs - Domain handlers
src/handlers/mod.rs - Request/response DTOs
src/dto/mod.rs - Application state
src/state/state.rs - PostgreSQL pool
src/config/database.rs
Identity
- User operations
src/handlers/user.rs - User service
src/service/user_svc.rs - Authentication
src/c_auth/mod.rs - Login
src/c_auth/login.rs - Token refresh
src/c_auth/refresh_token.rs
Catalog inventory
- Brand operations
src/handlers/brand.rs - Brand service
src/service/brands_svc.rs - Perfume operations
src/handlers/parfume.rs - Perfume service
src/service/parfume_svc.rs - Batch operations
src/handlers/batch.rs - Batch service
src/service/batch_svc.rs - Decant operations
src/handlers/decant.rs - Decant service
src/service/decant_svc.rs - Bottle operations
src/handlers/bottle.rs - Bottle service
src/service/bottle_svc.rs
Sales reporting
- Order operations
src/handlers/order.rs - Order service
src/service/order_svc.rs - Revenue operations
src/handlers/revenue.rs - Revenue service
src/service/revenue_svc.rs
Other components
- API client
Connections 24
- API client → Server startup: sends requests
- Server startup → HTTP routing: creates routes
- Server startup → PostgreSQL pool: connects pool
- Server startup → Application state: builds state
- HTTP routing → Domain handlers: routes requests
- Domain handlers → Request/response DTOs: uses payloads
- Domain handlers → User operations
- Domain handlers → Brand operations
- Domain handlers → Perfume operations
- Domain handlers → Batch operations
- Domain handlers → Decant operations
- Domain handlers → Bottle operations
- Domain handlers → Order operations
- Domain handlers → Revenue operations
- User operations → User service: delegates
- Brand operations → Brand service: delegates
- Perfume operations → Perfume service: delegates
- Batch operations → Batch service: delegates
- Decant operations → Decant service: delegates
- Bottle operations → Bottle service: delegates
- Order operations → Order service: delegates
- Revenue operations → Revenue service: delegates
- Authentication → Login
- Authentication → Token refresh