diff --git a/.DS_Store b/.DS_Store index d52302d..e42afa8 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/AGENTS.md b/AGENTS.md index 870fe7e..1224d8f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,133 +1,132 @@ # AGENTS.md +## Overview + +Single-page app for tracking engineering projects across weekly sessions +("Sitzungen"). Vanilla JS/HTML/CSS frontend + Node.js/Express server. No build +step, no bundler, no tests. Data is persisted as semicolon-separated CSVs +under `sessions/`. + +Two HTML entrypoints, both served statically by Express: +- `Test.html` — the main app (tabs: Projektboard, Auslastung, Projekte, + Projektbeteiligte). Served at `/`. +- `project-plan.html` — per-project Gantt/TODO planning view, opened in a new + tab via `openProjectPlan()` in `main.v2.js:2358`. Loads `main.v2.js` first, + then `project-plan.js`. + +All UI strings/comments/CSV content are German. Preserve German in +user-facing text. + ## File structure ``` . -├── server.js # Express server with API endpoints -├── package.json # Dependencies (express, cors) +├── server.js # Express server + CSV API +├── package.json # deps: express, cors only +├── docker-compose.yml # at repo ROOT; build context ., dockerfile Docker/Dockerfile +├── Docker/Dockerfile # node:20-alpine +├── .dockerignore +├── .vscode/extensions.json ├── public/ -│ ├── Test.html # Root HTML file (served at /) -│ ├── main.v2.js # Complete frontend client app -│ └── styles.css # UI styles -├── Docker/ -│ └── Dockerfile # Node.js Alpine image -├── docker-compose.yml # Docker service definition -└── sessions/ # Data directory (bind-mounted in Docker) - ├── ELT/ # Elektro department - ├── HLS/ # HLS department - └── ARCH/ # Architektur department +│ ├── Test.html # main app (served at /) +│ ├── main.v2.js # entire main client app (~3200 lines) +│ ├── project-plan.html # Gantt/TODO planning view +│ ├── project-plan.js # planning logic (~1500 lines) +│ ├── styles.css +│ └── dein_bild.ico +└── sessions/ # data; bind-mounted into Docker container + ├── ELT/ HLS/ ARCH/ # one folder per department ``` -## Overview - -Single-page app for tracking engineering projects across weekly sessions -("Sitzungen"). Vanilla JS/HTML/CSS frontend (`public/`) + Node.js/Express server -(`server.js`). No build step, no bundler. Data is persisted as CSV files under -`sessions/`. - ## Running -- `npm install` then `npm start` (executes `node server.js`). -- Or with Docker: `docker compose -f Docker/docker-compose.yml up --build`. -- Server runs on `PORT` env var or defaults to `3003`; serves `public/Test.html` - as root and API under `/load-all`, `/save-csv`, `/delete-csv`. -- Frontend assumes the API lives at `window.location.origin`, falling back to - `http://localhost:3003` when opened as a local file. Opening `Test.html` - directly without a server will load seed/demo data. - -## Operations - -### Local ```bash npm install -npm start +npm start # http://localhost:3003, or PORT=3004 if occupied +docker compose up --build # Docker variant (compose file is at repo root) ``` -Access at `http://localhost:3003` (or `PORT=3004` if occupied). -### Docker -```bash -docker compose -f Docker/docker-compose.yml up --build -``` -Access at `http://localhost:3003` (or override with `PORT=3004`). +- PORT env var overrides default 3003 in `server.js`. +- Frontend must be served over HTTP: `baseUrl()` in `main.v2.js` uses + `window.location.origin` or falls back to `http://localhost:3003` when opened + via `file://` (then only seed/demo data loads). +- Check `/health` returns `{ok:true}` after starting. + +## Server API (`server.js`) + +- `GET /` → `Test.html`; `GET /health`. +- `GET /load-all?department=` → `{sessions:[{filename,content}], people}` with + `_people.csv` content in `people`; sessions sorted by filename. +- `POST /save-csv {filename, csv, department}` → writes UTF-8 BOM CSV. +- `POST /delete-csv {filename, department}`. +- Valid departments hard-coded as `ELT|HLS|ARCH` in `server.js` + (`VALID_DEPARTMENTS`); anything else silently falls back to `ELT`. Same set in + `DEPARTMENTS` in `main.v2.js`. +- `safeName()` strictly validates filenames (path traversal protection); + static assets get `Cache-Control: no-store`. +- JSON body limit is 2 MB. ## CSV format -- Delimiter: semicolon (`;`) -- Encoding: UTF-8 with BOM (`\ufeff`) -- Structure: - - `sessions//` contains department data - - Week files: `