Document full build and deployment instructions in CLAUDE.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
100
CLAUDE.md
100
CLAUDE.md
@@ -111,6 +111,106 @@ Key invariants:
|
|||||||
- Upload worker uses `NetworkConnected` constraint + retry/backoff
|
- Upload worker uses `NetworkConnected` constraint + retry/backoff
|
||||||
- No DB or network access directly in Composables — always via ViewModel
|
- No DB or network access directly in Composables — always via ViewModel
|
||||||
|
|
||||||
|
## Webapp (`webapp/`)
|
||||||
|
|
||||||
|
**Stack:** TypeScript, Vite, Vanilla Web Components, MapLibre GL JS, nginx (Produktion)
|
||||||
|
|
||||||
|
**Entwicklung:**
|
||||||
|
```bash
|
||||||
|
cd webapp
|
||||||
|
npm install
|
||||||
|
npm run dev # Dev-Server :5173, proxied /v1 + /login + /logout → :8080
|
||||||
|
npm run typecheck # TypeScript-Prüfung ohne Build
|
||||||
|
```
|
||||||
|
|
||||||
|
**Produktions-Build:**
|
||||||
|
```bash
|
||||||
|
cd webapp
|
||||||
|
npm run build # statische Dateien in webapp/dist/
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Build & Deployment
|
||||||
|
|
||||||
|
### Gesamte Applikation (Docker)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Im Root-Verzeichnis — baut und startet alle Services:
|
||||||
|
docker-compose up --build
|
||||||
|
```
|
||||||
|
|
||||||
|
| Service | Port | Beschreibung |
|
||||||
|
|---------|------|-------------|
|
||||||
|
| `postgres` | intern | PostgreSQL 16 |
|
||||||
|
| `migrate` | — | Führt DB-Migrationen aus (einmalig, dann beendet) |
|
||||||
|
| `api` | 8080 | Go REST API |
|
||||||
|
| `webapp` | **9050** | SPA via nginx (proxied API-Calls zum `api`-Service) |
|
||||||
|
|
||||||
|
Webapp erreichbar unter `http://localhost:9050`.
|
||||||
|
|
||||||
|
**Erster Benutzer anlegen** (nach dem ersten Start):
|
||||||
|
```bash
|
||||||
|
docker-compose exec api /createuser
|
||||||
|
# oder lokal:
|
||||||
|
cd backend && go run ./cmd/createuser
|
||||||
|
```
|
||||||
|
|
||||||
|
**Nur neu bauen ohne Cache:**
|
||||||
|
```bash
|
||||||
|
docker-compose build --no-cache
|
||||||
|
docker-compose up
|
||||||
|
```
|
||||||
|
|
||||||
|
**Logs:**
|
||||||
|
```bash
|
||||||
|
docker-compose logs -f api
|
||||||
|
docker-compose logs -f webapp
|
||||||
|
```
|
||||||
|
|
||||||
|
### Einzelne Komponenten bauen
|
||||||
|
|
||||||
|
**Backend (Go-Binary):**
|
||||||
|
```bash
|
||||||
|
cd backend
|
||||||
|
go build -o ./bin/server ./cmd/server
|
||||||
|
go build -o ./bin/migrate ./cmd/migrate
|
||||||
|
```
|
||||||
|
|
||||||
|
**Backend (Docker-Image):**
|
||||||
|
```bash
|
||||||
|
docker build -t pamietnik-backend ./backend
|
||||||
|
```
|
||||||
|
|
||||||
|
**Webapp (statische Dateien):**
|
||||||
|
```bash
|
||||||
|
cd webapp
|
||||||
|
npm run build # Ausgabe: webapp/dist/
|
||||||
|
```
|
||||||
|
|
||||||
|
**Webapp (Docker-Image mit nginx):**
|
||||||
|
```bash
|
||||||
|
docker build -t pamietnik-webapp ./webapp
|
||||||
|
```
|
||||||
|
|
||||||
|
### Android APK
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd app
|
||||||
|
./gradlew assembleRelease # Release-APK (erfordert Signing-Konfiguration)
|
||||||
|
./gradlew assembleDebug # Debug-APK
|
||||||
|
./gradlew installDebug # Direkt auf verbundenem Gerät/Emulator installieren
|
||||||
|
```
|
||||||
|
|
||||||
|
### Dienste stoppen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose down # Container stoppen
|
||||||
|
docker-compose down -v # + PostgreSQL-Volume löschen (Daten verloren!)
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Project Decisions (from README)
|
## Project Decisions (from README)
|
||||||
|
|
||||||
| Decision | Choice |
|
| Decision | Choice |
|
||||||
|
|||||||
Reference in New Issue
Block a user