How gonbechii/backend-data-portfolio-2025 works
Project Type and Purpose
• This is a monorepo containing two related projects. The focus here is Project 1 — Orders & Inventory API, a backend REST service built with Django/DRF and MariaDB, intended to manage products, customers, orders (with nested items), stock validation and later expose business metrics to Power BI. It lives alongside a future ETL/Data Pipeline and dashboards but currently implements only the API layer.
File Structure Analysis
• Top-level files: .env.db, docker-compose.yml (DB container), README, docs/, seeds/.
• orders_inventory_api/: the Django project root containing
• config/: Django settings (settings.py), URL router (urls.py), WSGI/ASGI.
• core/: app modules—models.py (Customer, Product, Order, OrderItem), serializers.py, views.py, admin.py, migrations and tests/.
• manage.py.
• seeds/: JSON fixture for products.
• Docker support via docker-compose.yml orchestrates MariaDB + Adminer.
README Insights
• Describes tech stack: Python 3.13, Django 5.x, DRF, MariaDB, Power BI.
• Outlines functional features (JWT/auth to come, business metrics, CI/CD).
• Lists REST endpoints, usage examples and seed data workflow.
• Roadmap covers future additions (Swagger, Celery, ETL with Pandas, dashboards, CI/CD).
a. Main Components
• Client/UI (cURL/Postman/third-party)
• Django Application
• URL Router & Middleware
• Authentication (JWT, permissions)
• API Views / ViewSets (Customers, Products, Orders)
• Serializers (input validation, nested items)
• Business Logic (order total calculation, stock decrement)
• Database Layer (MariaDB via Django ORM)
• Tables: product, customer, order, order_item
• Data Seed & Migration Tools (manage.py migrations & loaddata)
• External Service
• Adminer (DB admin)
• (Future) Power BI dashboard / ETL pipeline service
• Dev/Infra
• Docker Compose network (db, adminer, app)
• CI/CD pipeline (future GitHub Actions or similar)
b. Relationships & Data Flow
• Client → Django Router (HTTP REST) → Views
• Views ↔ Serializers (validation & conversion)
• Views ↔ ORM → MariaDB
• On order creation: transactional flow that validates stock, creates OrderItem rows, updates Product.stock, recalculates totals.
• (Future) ETL job reads DB → Pandas transforms → loads to analytics DB → Power BI
c. Architectural Patterns
• MVC/MVT: Django separates Models, Views, Templates (no UI templates here, only API).
• Layered Architecture:
1. Presentation/API Layer
2. Business Logic Layer (serializers + model methods)
3. Data Access Layer (ORM)
• Single-service monolith (will evolve into micro-services or separate ETL microservice).
d. Key Technologies & Libraries
• Django + Django REST Framework
• MariaDB/MySQL (dockerized)
• Python-dotenv for env config
• serializers, viewsets, routers (DRF)
• migrations & fixtures for data seeding
• Adminer for DB management
• (Planned) Pandas, Celery, Swagger/OpenAPI