Files
Torsten Schulz (local) 328bc9e776 Add account deletion feature and privacy section
Implement a new endpoint for account deletion in AuthController, allowing users to permanently delete their accounts and associated data. Update AuthService to handle account deletion logic, including confirmation checks and data removal from the database. Enhance frontend with new views and components for account deletion and privacy information, including links in the side menu and profile view. Update mobile app to support account deletion and privacy sections, improving user experience and compliance with data protection standards.
2026-05-15 11:20:08 +02:00
..

TimeClock Backend API v3.0

Node.js/Express Backend für die TimeClock Zeiterfassungsanwendung.

Installation

npm install

Konfiguration

Erstellen Sie eine .env Datei im Backend-Verzeichnis:

PORT=3000
NODE_ENV=development

Starten

Entwicklung (mit Auto-Reload)

npm run dev

Produktion

npm start

API-Dokumentation

Base URL

http://localhost:3010/api

Endpunkte

Health Check

GET /api/health

Response:

{
  "status": "ok",
  "message": "TimeClock API v3.0.0",
  "timestamp": "2025-10-15T10:00:00.000Z"
}

Alle Zeiteinträge abrufen

GET /api/time-entries

Einzelnen Zeiteintrag abrufen

GET /api/time-entries/:id

Neuen Zeiteintrag erstellen

POST /api/time-entries
Content-Type: application/json

{
  "project": "Mein Projekt",
  "description": "Beschreibung"
}

Zeiteintrag aktualisieren

PUT /api/time-entries/:id
Content-Type: application/json

{
  "endTime": "2025-10-15T10:30:00.000Z",
  "description": "Aktualisierte Beschreibung"
}

Zeiteintrag löschen

DELETE /api/time-entries/:id

Statistiken abrufen

GET /api/time-entries/stats/summary

Response:

{
  "totalEntries": 10,
  "completedEntries": 8,
  "runningEntries": 2,
  "totalHours": "42.50",
  "totalSeconds": 153000,
  "projectStats": {
    "Projekt A": {
      "duration": 86400,
      "count": 5
    }
  }
}

Datenmodell

TimeEntry

{
  id: Number,
  startTime: String (ISO 8601),
  endTime: String (ISO 8601) | null,
  description: String,
  project: String,
  duration: Number (Sekunden) | null,
  isRunning: Boolean
}

Dependencies

  • express - Web-Framework
  • cors - CORS-Middleware
  • helmet - Sicherheits-Middleware
  • morgan - HTTP Request Logger
  • dotenv - Environment Variables

Entwicklung

Der aktuelle Stand verwendet In-Memory-Speicher. Für eine Produktionsumgebung sollte eine Datenbank integriert werden:

  • MongoDB mit mongoose
  • PostgreSQL mit pg/sequelize
  • MySQL mit mysql2/sequelize