- type
- summary
- 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)
- sources
- raw/notes/techContext
- tags
- tech-stack infrastructure deployment angular django postgresql pm2 nginx
Tech Context Summary
abstract
B2BPaper runs on Angular 19 (frontend) + Django REST Framework (backend) + PostgreSQL, deployed on a single Contabo VPS with PM2 process management, Nginx reverse proxy, and Celery+Redis for async tasks.Frontend Stack
- Framework: Angular 18+ (effectively Angular 19 in current codebase)
- Styling: Tailwind CSS primary, component SCSS only when Tailwind cannot handle it
- UI Library: Angular Material for form fields, dialogs, tables
- Charts: ApexCharts via
ngx-apexcharts(never Highcharts) - Forms: Reactive Forms exclusively (never template-driven)
- Components: Standalone, OnPush change detection,
ViewEncapsulation.None - State Management:
BehaviorSubjectin services, exposed via.asObservable()
See wiki/concepts/angular-frontend-stack for full details.
Backend Stack
- Framework: Django 5.x + Django REST Framework 5.x
- Database: PostgreSQL (always -- never SQLite or MySQL)
- Auth: Django auth + JWT tokens via
djangorestframework-simplejwt - Filtering:
django-filter - API Docs:
drf-spectacular(OpenAPI/Swagger) - Task Queue: Celery + Redis for async processing (email ingestion, matching)
See wiki/concepts/django-app-layout for the app-by-app breakdown and wiki/concepts/service-layer-pattern for the business logic organization.
Infrastructure
- Server: Contabo VPS (
vmi2998435.contaboserver.net, IP77.237.235.106) - Process Manager: PM2 (process name:
marketplace-api) - Reverse Proxy: Nginx with marketplace mounted at
/mvp/onb2bpaper.xdvu.com - SSL: Let's Encrypt via wildcard cert on
b2bpaper.xdvu.com - Django Config:
FORCE_SCRIPT_NAME = '/mvp',STATIC_URL = '/mvp/static/' - Static Files: Served by Nginx from
backend/staticfiles/
See wiki/concepts/pm2-process-layout and wiki/concepts/nginx-mvp-routing for infrastructure details.
Deployment URLs
| URL | Purpose |
|---|---|
https://b2bpaper.xdvu.com/mvp/ |
Marketplace root (redirects to Swagger) |
https://b2bpaper.xdvu.com/mvp/api/docs/ |
Swagger UI |
https://b2bpaper.xdvu.com/mvp/admin/ |
Django Admin |
https://b2bpaper.xdvu.com/mvp/static/ |
Static files |
http://127.0.0.1:8910 |
Direct gunicorn (internal only) |
See wiki/concepts/deployment-urls for the full URL map.
Key Integrations (Planned and Implemented)
| Integration | Status | Technology |
|---|---|---|
| Email Ingestion | Planned | Celery task + email client |
| Excel Parsing | Planned | openpyxl or pandas |
| Newsletter Generation | Planned | Django email + Celery scheduling |
| Matching Algorithm | Planned | Custom Django service + future ML |
| Container Fill Optimization | Implemented | apps/containers/services.py |
The container fill optimization is the most mature integration, with a full service layer, scoring system (0-100), product compatibility checks, and freight rate comparison with fallback rates.
Constraints
- Single-server deployment for MVP (no Kubernetes/cloud complexity)
- Must support Excel files of varying formats (mills do not standardize)
- Geographic visibility at regional level, not per-buyer
- 48-hour exclusivity windows need reliable Celery scheduling
- Commission tracking must be accurate to the cent
Sources
- raw/notes/techContext -- full technical context including stack details, deployment configuration, integration plans, and constraints
Related
- wiki/concepts/angular-frontend-stack -- frontend architecture details
- wiki/concepts/django-app-layout -- backend app organization
- wiki/concepts/deployment-urls -- all live URLs
- wiki/concepts/pm2-process-layout -- process management
- wiki/concepts/nginx-mvp-routing -- reverse proxy routing
- wiki/summaries/codeguidelines-summary -- coding standards for the stack