Some checks failed
Deploy Development / deploy (push) Failing after 4s
Docker & Deployment: - docker-compose.yml (Prod: Port 3003/8003) - docker-compose.dev-env.yml (Dev: Port 3098/8098) - Backend Dockerfile (Python 3.12-slim) - Frontend Dockerfile (Node 20 + Nginx) - Gitea Actions (deploy-dev.yml, deploy-prod.yml) Frontend: - React 18 + Vite setup - package.json, vite.config.js, index.html - App.jsx (minimal with version display) - api.js (complete API client) - app.css + AuthContext from Mitai - main.jsx entry point Backend Migrations: - 001_auth_membership.sql (Auth + Features + Tier Limits) - 002_organization.sql (Clubs, Divisions, Training Groups) - 003_catalogs.sql (Skills + Methods with sample data) Documentation: - .claude/rules/ (ARCHITECTURE, CODING_RULES, etc.) - SHINKAN_PROJECT_SETUP.md (technical setup guide) Server: - Directories created on Pi: /home/lars/docker/shinkan[-dev] - Gitea Runner configured and running Ready for first deployment to dev.shinkan.jinkendo.de version: 0.1.0 date: 2026-04-21
2.5 KiB
2.5 KiB
Coding Rules – Mitai Jinkendo
Diese Regeln IMMER befolgen. Sie basieren auf Erfahrungen aus der Entwicklung.
Backend
1. Auth auf jeden Endpoint
# Jeder neue Endpoint braucht Auth:
@router.get("/neuer-endpoint")
def neuer_endpoint(session: dict = Depends(require_auth)):
pid = session['profile_id']
2. Profile-ID aus Session – nie aus Header
pid = session['profile_id'] # ✅
# Nicht: request.headers.get('X-Profile-Id') ❌
3. bcrypt für Passwörter
from auth import hash_pin, verify_pin
hashed = hash_pin(plain_password) # ✅
# Nicht: hashlib.sha256(...) ❌
4. PostgreSQL-Syntax
cur.execute("SELECT * FROM t WHERE id = %s AND active = true", (id,))
# Nicht: ? und active = 1 (SQLite-Syntax)
5. Rate Limiting für sensitive Endpoints
from slowapi import Limiter
@router.post("/sensitive")
@limiter.limit("5/minute")
def sensitive(request: Request, ...):
6. Universal CSV Import / Admin-Vorlagen
Neues Import-Zielmodul, Änderungen an csv_parser, Executor, DB-source/CHECK, oder System-CSV-Vorlagen:
- Pflichtlektüre und Checkliste:
.claude/docs/technical/UNIVERSAL_CSV_IMPORT_AGENT_GUIDE.md - Keine zweite DB-Connection im Importpfad; Zeilenfehler ohne „aborted transaction“ (SAVEPOINT-Muster wo nötig)
- Admin Create/Update von Systemvorlagen: Validierung über
validate_csv_templatenicht umgehen
Frontend
1. api.js für alle API-Calls
await api.listWeight() // ✅
await fetch('/api/weight') // ❌ kein Token
2. Fehlerbehandlung in async Funktionen
try {
const data = await api.meinEndpoint()
} catch(e) {
setError(e.message) // api.js wirft bereits Error mit detail-Text
}
3. Kein TypeScript
Das Projekt nutzt bewusst kein TypeScript – keine .ts/.tsx Dateien erstellen.
4. Keine neuen npm-Pakete ohne Absprache
Erst fragen, dann installieren.
5. CSS-Variablen statt Hardcoded-Farben
// ✅ Richtig:
style={{color: 'var(--accent)'}}
// ❌ Falsch:
style={{color: '#1D9E75'}}
Git & Deployment
1. Nie direkt auf main pushen
Immer über Pull Request in Gitea: develop → main
2. develop Branch nie löschen
Er ist permanent – nicht nach Merge löschen.
3. .env nie committen
Steht in .gitignore – nie entfernen.
4. Commit-Message Format
feat: neues Feature
fix: Bugfix
refactor: Umbau ohne Funktionsänderung
docs: Dokumentation
ci: CI/CD Änderungen
chore: Maintenance