How ramijaber4/order-management works
This repository combines an authenticated order-management API with a PostgreSQL sales-analytics ETL. The main user workflow is registering or logging in, browsing products, and submitting a customer-owned order; order creation validates and locks inventory, then commits the order, items, and stock changes together. A separate analytics workflow reads sales data and publishes full or incremental results, with checkpoints and run history. The API and analytics source are documented as able to use the same or separate databases. Some capabilities, including product/customer service internals, are represented from README and index references rather than inspected excerpts.
Main entry points: routes.py API routes · pipeline.py Incremental pipeline · daily_pipeline.py Daily pipeline · main.py FastAPI entry
Components 24
API and access
- FastAPI entry
app/main.py - API routes
app/api/routes.py - Authentication
app/core/auth.py - API contracts
app/schemas.py
Order domain
- Customer service
app/services/customers.py - Product service
app/services/products.py - Order service
app/services/orders.py - Commerce models
app/models.py
Sales analytics
- ETL command runner
etl_analytics/run.py - ETL configuration
etl_analytics/config.py - Incremental pipeline
etl_analytics/pipeline.py - Daily pipeline
etl_analytics/daily_pipeline.py - Sales extraction
etl_analytics/sales_extract.py - Sales transformation
etl_analytics/transform.py - Sales publication
etl_analytics/sales_load.py - ETL schema and load
etl_analytics/load.py - Run history
etl_analytics/run_logging.py
Persistence and operations
- Ecommerce PostgreSQL
- Request sessions
app/db/session.py - Request and error logging
app/core/logging_config.py - Error logging
app/core/error_logging.py - Analytics PostgreSQL
Other components
- Customer or admin
- ETL operator
Connections 34
- Customer or admin → FastAPI entry: sends requests
README.md - FastAPI entry → API routes: registers routes
app/main.py - FastAPI entry → Request and error logging: installs middleware
app/main.py - FastAPI entry → Error logging: installs handlers
app/main.py - API routes → Customer service: calls registration
app/api/routes.py - API routes → Order service: calls order operations
app/api/routes.py - API routes → Product service: calls catalog operations
app/api/routes.py - API routes → Authentication: uses dependencies
app/api/routes.py - API routes → Request sessions: injects sessions
app/api/routes.py - API routes → API contracts: validates and returns
app/api/routes.py - Authentication → Request sessions: gets sessions
app/core/auth.py - Authentication → Commerce models: loads customer
app/core/auth.py - Customer service → Commerce models: creates customer
app/services/customers.py - Customer service → API contracts: accepts registration
app/services/customers.py - Order service → Commerce models: reads and writes
app/services/orders.py - Order service → API contracts: accepts order
app/services/orders.py - Order service → Ecommerce PostgreSQL: commits order and stock
README.md - Customer service → Ecommerce PostgreSQL: persists accounts
README.md - Product service → Ecommerce PostgreSQL: manages catalog
README.md - Request sessions → Ecommerce PostgreSQL: opens connections
app/db/session.py - ETL operator → ETL command runner: starts pipeline
README.md - ETL command runner → ETL configuration: loads configuration
etl_analytics/run.py - ETL command runner → Incremental pipeline: runs incremental flow
etl_analytics/run.py - ETL command runner → Daily pipeline: runs daily flow
etl_analytics/run.py - Incremental pipeline → ETL schema and load: acquires publication lock
etl_analytics/pipeline.py - Incremental pipeline → Sales extraction: extracts sales
etl_analytics/pipeline.py - Incremental pipeline → Sales publication: stages and upserts
etl_analytics/pipeline.py - Incremental pipeline → Run history: records run status
etl_analytics/pipeline.py - Daily pipeline → Sales transformation: transforms daily totals
etl_analytics/daily_pipeline.py - Daily pipeline → ETL schema and load: loads daily results
etl_analytics/daily_pipeline.py - Incremental pipeline → Ecommerce PostgreSQL: reads source sales
README.md - Incremental pipeline → Analytics PostgreSQL: publishes facts and checkpoint
README.md - Daily pipeline → Ecommerce PostgreSQL: reads source sales
README.md - Daily pipeline → Analytics PostgreSQL: publishes daily metrics
README.md