How patronsafety-create/storage_management works
This repository is a Storage ERP API whose visible runtime path is authentication: a client submits credentials to the FastAPI app, the login handler checks the user and password, then returns a JWT. A separate dependency validates bearer tokens and looks up the corresponding user. The domain layer also defines warehouse, product, price-list, and receipt/issue status models, but the supplied sources show no operational endpoints for those capabilities. The README is empty, so the map reflects only the supplied source excerpts and index.
Main entry points: auth.py Login handler · dependencies.py Token guard · database.py Database sessions · main.py FastAPI app
Components 12
API and authentication
- FastAPI app
src/api/main.py - Login handler
src/api/auth.py - Token guard
src/api/dependencies.py
Security services
- Password and JWT
src/infrastructure/security.py
ERP domain
- Auth schemas
src/domain_model/auth_schemas.py - User and access entities
src/domain_model/auth_models.py - Warehouse and catalog
src/domain_model/models.py - Warehouse and catalog schemas
src/schemas.py - Inventory document states
src/domain_model/enums.py
Persistence
- Database sessions
src/infrastructure/database.py
Other components
- API client
- PostgreSQL
Connections 12
- API client → FastAPI app: sends requests
src/api/main.py - FastAPI app → Login handler: mounts router
src/api/main.py - Login handler → Database sessions: requests session
src/api/auth.py - Login handler → User and access entities: queries user
src/api/auth.py - Login handler → Password and JWT: verifies and issues
src/api/auth.py - Login handler → Auth schemas: returns token schema
src/api/auth.py - Token guard → Database sessions: requests session
src/api/dependencies.py - Token guard → Password and JWT: uses signing config
src/api/dependencies.py - Token guard → User and access entities: queries user
src/api/dependencies.py - Token guard → Auth schemas: builds token data
src/api/dependencies.py - Database sessions → PostgreSQL: connects to
src/infrastructure/database.py - Warehouse and catalog schemas → Warehouse and catalog: shapes records