Kleines, lokales Time-Tracking‑Projekt mit Express + statischem Frontend.
Kurz:
- Backend: index.js (Express, JSON-Datei als Speicher)
- Frontend: public/index.html + public/app.js
- Persistenz: data.json
- Paketinfo: package.json
Schnellstart
- Abhängigkeiten installieren:
npm install
- Starten:
node index.js
- Öffnen: http://localhost:3000
Wichtige Dateien & Funktionen
- Server-Logik: index.js
loadData— liest data.jsonsaveData— schreibt data.jsoncomputeSummary— berechnet Gesamt- und Projektzeiten
- Client-Logik: public/app.js
api— Fetch‑Wrapper für API-AufrufeloadProjects— lädt Projektliste ins UIrefresh— aktualisiert UI (Einträge, aktiv, Zusammenfassung)
- UI: public/index.html
API (Kurzüberblick, implementiert in index.js)
- GET /api/projects — Liste der Projekte
- POST /api/projects — Projekt anlegen (Body: { name })
- GET /api/entries — alle Einträge + aktuelles active
- POST /api/start — Start einer Session (Body: { projectId })
- POST /api/stop — Stoppt aktuelle Session, legt Eintrag an
- GET /api/summary — Zusammenfassung (totalSeconds, perProject)
- GET /api/data — Rohdaten (debug)
Beispiel cURL (Neues Projekt):
curl -X POST -H "Content-Type: application/json" \
-d '{"name":"Mein Projekt"}' http://localhost:3000/api/projectsDatenformat
- Persistiert in data.json. Schema: { projects: [...], entries: [...], active: null|{projectId,start} }.
Hinweis Dieses Projekt ist 100% KI generiert