Files
training-software/README.md
Paperclip CTO 295ac1c31f feat(TRA-335): license limits, per-customer branding, frontend, Gitea CI, and deployment README
- Added OrganizationProfile model with license_user_limit choices (20/50/100/1000), company_name, brand_logo_url
- Added migration 0003_organization_profile
- Admin-only REST endpoint GET/PATCH /api/v1/accounts/organizations/{org_id}/profile/
- OrganizationProfileSerializer, OrganizationProfileAdmin, factory, and integration tests
- Static Nginx-hostable frontend under frontend/public with configurable API_BASE_URL via config.js
- frontend/nginx.conf reference server config
- .gitea/workflows/ci.yml: ruff lint, pytest with Postgres/Redis services, docker build
- README.md: English deployment guide covering env vars, Docker Compose, migration, org profile API, frontend deploy

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-08 07:52:08 +02:00

1.9 KiB

Training Software

This repository contains a Django-based training platform backend plus a static customer portal frontend.

Features for customer environment setup

  • Per-customer organization profile with configurable license user limits (20, 50, 100, 1000)
  • Per-customer branding via company name and logo URL
  • Static frontend that can be hosted on Nginx and configured with the backend API domain at deploy time
  • CI pipeline for tests, linting, and container build

Backend deployment

1. Prerequisites

  • Python 3.12
  • PostgreSQL 16+
  • Redis 7+
  • Docker (recommended for containerized deploy)

2. Environment variables

Create environment variables based on .env.example.

Required minimum values:

  • DJANGO_SECRET_KEY
  • DJANGO_ALLOWED_HOSTS
  • DATABASE_URL
  • REDIS_URL
  • DJANGO_SETTINGS_MODULE (use config.settings.prod in production)

3. Build and run with Docker Compose

docker compose up -d --build

4. Run migrations

docker compose exec web python manage.py migrate

5. Verify health

curl http://<api-domain>/healthz/

Organization profile API (license + branding)

Admin endpoint:

  • GET /api/v1/accounts/organizations/{org_id}/profile/
  • PATCH /api/v1/accounts/organizations/{org_id}/profile/

Patch example:

{
  "company_name": "Acme Corp",
  "license_user_limit": 100,
  "brand_logo_url": "https://cdn.example.com/acme-logo.svg"
}

Frontend deployment on Nginx

The static frontend is under frontend/public.

1. Set backend API domain

Edit frontend/public/config.js and set:

window.APP_CONFIG = {
  API_BASE_URL: "https://api.example.com"
};

2. Serve via Nginx

Use frontend/nginx.conf as a reference server config and copy the frontend/public files to your Nginx web root.

CI for Gitea

Gitea Actions workflow file:

  • .gitea/workflows/ci.yml

It runs:

  • Ruff lint
  • Django test suite
  • Docker image build