type
moc
created
Tue Apr 07 2026 02:00:00 GMT+0200 (Central European Summer Time)
updated
Tue Apr 07 2026 02:00:00 GMT+0200 (Central European Summer Time)
tags
moc architecture technical

MOC: Architecture

abstract
Map of Content for the technical architecture of B2BPaper. Django REST backend + Angular 19 frontend, PostgreSQL, Celery, Redis, deployed via PM2 + nginx on Contabo VPS.

Stack at a Glance

Layer Tech Notes
Backend Django 6.0.2 + DRF backend/, port 8910 via gunicorn
Frontend Angular 19 standalone frontend/, built to /var/www/hub/b2bpaper-app/
Database PostgreSQL name: b2bpaper, integer cents for prices
Async Celery + Redis Excel polling, matching, newsletter generation (5min beat)
Auth JWT role-based: mill / buyer / admin
Tests pytest + Playwright 741 passing

See wiki/wiki/concepts/django-app-layout and wiki/wiki/concepts/angular-frontend-stack.

The 4-Layer Architecture

wiki/wiki/concepts/four-layer-architecture

  1. Data Bootstrap — seeding, fixtures, master product catalog.
  2. Entity — core models (Products, Surplus, Mills, Buyers, etc.).
  3. Action — business operations (matching, exclusivity, newsletter).
  4. Output — APIs, emails, dashboards, exports.

The 6 Core Entities

wiki/wiki/concepts/six-core-entities

  1. Products (master catalog)
  2. Surplus Availability
  3. Mills
  4. Mills Surplus Visibility (regional config)
  5. Buyers
  6. Buyer Specifics (stored requirements for matching)

The 8 Core Actions

wiki/wiki/concepts/eight-core-actions

  1. Extract Buyers
  2. Extract Mills
  3. Exclusivity (48h window)
  4. Pre-Production Announcements
  5. Newsletter Generation
  6. Container Assembly
  7. Excel Ingestion
  8. Visibility Configuration

Key Patterns

Frontend

wiki/wiki/concepts/angular-frontend-stack — standalone components, OnPush, inject(), @if/@for, Reactive Forms, Tailwind tokens (no raw hex).

Conventions

Source Summaries

Related MOCs