Phase 0: repo skeleton, image, compose stacks, doctor, migration runner, frontend shell
New repo for the Packet Station rebuild (Python 3.12, FastAPI, PostgreSQL 16, React, VisualKit, MFilesKit, Docker Compose on docker-1). Nothing is migrated from the M: install. - CLAUDE.md with the safety rules, README, CHANGELOG, docs (BRIEF, PLAN, SECURITY rewritten for the server with the requirement ID table, DEPLOY, stubs for FEED, POLICY, SCHEMA, GO-LIVE, PAPER-FALLBACK). - packetstation CLI: app, worker (heartbeat stub), migrate, doctor, version, healthcheck. Settings from the environment with secret files. Stack guard (test never points at VISUAL production). Security headers and CSP. Trusted proxy resolved by name. JSON logs with redaction. - Migration runner and 0001_base: settings, append-only audit_events with hash chain, ps_notify, grants for ps_app. - Multi-stage Dockerfile (ODBC Driver 18, PESCO libraries from the Gitea index only), compose base, proxy overlay for npm_default, CI overlay, postgres initdb roles, env examples, NPM proxy host notes, Gitea Actions. - Frontend: Vite, React, TypeScript, the PESCO dark theme ported with self-hosted fonts, placeholder sign-in and home. - Verified on docker-1: image builds, CI stack comes up healthy, doctor database checks pass, 77 server tests pass against PostgreSQL. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
# Packet Station
|
||||
|
||||
Digital job packets for the PESCO shop floor. A packet moves through each department on screen instead of on paper. VISUAL releases the work and Packet Station builds the packet with the drawing from M-Files at the rev the job pull calls. Clerical checks anything flagged. Warehouse pulls parts and records heat numbers, MTRs and shorts. A supervisor assigns a station and welder. The station logs welds on the weld map, works the checklist and runs the timer. The supervisor sends it to Q.C. Q.C. inspects, accepts or rejects, and adds reports. Clerical closes the job in VISUAL, exports the manufacturing data book PDF and files it. A change in VISUAL to a packet already in the shop goes to Clerical as a change order before it reaches the shop.
|
||||
|
||||
This repo is the rebuild of Packet Station as a server application: Docker Compose on `docker-1`, PostgreSQL 16, a Python server that enforces every rule, a worker for the VISUAL feed and M-Files drawing lookups, and a React frontend as a pure client. Sign-in is PESCO's Active Directory. VISUAL is read through VisualKit and M-Files through MFilesKit, read-only.
|
||||
|
||||
## Status
|
||||
|
||||
**Rebuild in progress. Phase 0: skeleton, image, doctor.**
|
||||
|
||||
No user feature exists yet. The old build on `M:\Production\Packet Station` stays the live system until go-live. The new system starts empty; nothing is migrated from M:.
|
||||
|
||||
| Area | Exists yet? |
|
||||
|---|---|
|
||||
| Repo, docs, CLAUDE.md | Yes (phase 0) |
|
||||
| Image, compose, CI, `doctor`, migration runner, security headers, build version endpoint | Yes (phase 0, image and stack verified on docker-1) |
|
||||
| Sign-in, sessions, audit, frontend shell | No (phase 1) |
|
||||
| Packets, policy, Clerical screens | No (phase 2) |
|
||||
| VISUAL feed and drawings | No (phase 3) |
|
||||
| Warehouse, shop, Q.C., close and file, PDFs | No (phases 4 to 7) |
|
||||
| Project Management, Admin, notifications, backups | No (phases 8 and 9) |
|
||||
| Regression bench and go-live | No (phase 10) |
|
||||
|
||||
## Phases
|
||||
|
||||
The full plan is in [docs/PLAN.md](docs/PLAN.md).
|
||||
|
||||
| Phase | What it delivers |
|
||||
|---|---|
|
||||
| 0 | Skeleton: repo, docs, Dockerfile, compose, CI, `packetstation doctor`, migration runner, headers and CSP. |
|
||||
| 1 | Identity: AD sign-in, sessions, optional PIN, devices, signatures, audit, SSE, frontend shell and theme. |
|
||||
| 2 | Core domain: schema, policy engine in Python, packet API, Clerical screen, packet page. |
|
||||
| 3 | VISUAL feed and M-Files drawings in the worker, change orders, Clerical "From VISUAL" panel. |
|
||||
| 4 | Warehouse: task board, pull table, heats, MTRs, shorts, upload pipeline. |
|
||||
| 5 | Shop: supervisor and stall screens, weld map, heat table, timer, change-order verification. |
|
||||
| 6 | Q.C.: inspection, accept and reject, Q.C. documents, digital ITP. |
|
||||
| 7 | Close and file, HMAC seals, server-side PDFs (data book, traveler, ITP, prints, stamps). |
|
||||
| 8 | Project Management screen, find bar, list view, presence. |
|
||||
| 9 | Admin completion, AD reconcile, integrity job, notifications, backups and restore. |
|
||||
| 10 | Regression bench, hardening, go-live and paper-fallback docs. |
|
||||
|
||||
## Folder map
|
||||
|
||||
```
|
||||
CLAUDE.md README.md CHANGELOG.md pyproject.toml Dockerfile .env.example
|
||||
docs/ the brief, the plan, security, deploy, feed, policy, schema, go-live, paper fallback
|
||||
server/packetstation/ the Python package: app, worker, CLI, migrations, policy, domain, feed, drawings, PDFs
|
||||
frontend/ Vite + React + TypeScript client
|
||||
tests/ server tests (pytest), e2e scenarios (Playwright), synthetic fixture generator
|
||||
deploy/ compose files (base, NPM overlay, CI overlay), PostgreSQL init, Samba AD for CI
|
||||
docker/ the image entrypoint
|
||||
scripts/ host backup and restore scripts, systemd timer
|
||||
.gitea/workflows/ CI
|
||||
```
|
||||
|
||||
Not in git: `.env`, `tests/fixtures/local/`, `reference/`, `recordings/`. Real job data stays out of git and CI.
|
||||
|
||||
## How to run
|
||||
|
||||
Developer machine:
|
||||
|
||||
```bash
|
||||
python -m venv .venv
|
||||
.venv\Scripts\python -m pip install -e ".[dev]"
|
||||
.venv\Scripts\python -m pytest
|
||||
cd frontend && npm ci && npm run build
|
||||
packetstation doctor
|
||||
```
|
||||
|
||||
`visualkit` and `mfileskit` install from PESCO's Gitea index with `--index-url`. Everything else installs from public PyPI in a separate step. See [docs/DEPLOY.md](docs/DEPLOY.md).
|
||||
|
||||
Test stack on `docker-1`:
|
||||
|
||||
```bash
|
||||
docker compose -p packetstation-test --env-file /etc/packetstation/test/stack.env \
|
||||
-f deploy/compose.yaml -f deploy/compose.proxy.yaml up -d
|
||||
```
|
||||
|
||||
The `packetstation` command has `doctor`, `migrate`, `app` and `worker`.
|
||||
|
||||
## Docs
|
||||
|
||||
- [docs/BRIEF.md](docs/BRIEF.md): the brief this rebuild follows.
|
||||
- [docs/PLAN.md](docs/PLAN.md): the approved phased plan and open questions.
|
||||
- [docs/SECURITY.md](docs/SECURITY.md): old layers and where they live now, the new controls, the requirement ID table.
|
||||
- [docs/DEPLOY.md](docs/DEPLOY.md): host, stacks, secrets, NPM proxy host, doctor, backups.
|
||||
- [docs/FEED.md](docs/FEED.md): the VISUAL feed and drawing jobs (phase 3).
|
||||
- [docs/POLICY.md](docs/POLICY.md): who may do what (phase 2).
|
||||
- [docs/SCHEMA.md](docs/SCHEMA.md): the database schema (phases 1 to 3).
|
||||
- [docs/GO-LIVE.md](docs/GO-LIVE.md): go-live procedure (phase 10).
|
||||
- [docs/PAPER-FALLBACK.md](docs/PAPER-FALLBACK.md): what the shop does when the server is down (phase 10).
|
||||
- [CHANGELOG.md](CHANGELOG.md): what changed.
|
||||
- [CLAUDE.md](CLAUDE.md): rules for Claude Code sessions in this repo.
|
||||
Reference in New Issue
Block a user