- C# 99.8%
- Dockerfile 0.2%
Locking the whole UsersController to Admin broke driver order loading: ChaufforView.vue fetches /api/users (for delivered-by names) alongside orders/items in one Promise.all, so a driver's 403 there failed the whole fetch. Reads stay open to any authenticated user; create/update/ delete stay Admin-only. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0134xoPzpcGeKoUxogYVdhyB |
||
|---|---|---|
| OpgaveApi | ||
| CLAUDE.md | ||
| docker-compose.yml | ||
| Dockerfile | ||
| dockerignore | ||
| LICENSE | ||
| README.md | ||
opgave-tracker
Backend REST API for Vig Festival's internal task and material ordering system. C#/.NET 10, JWT auth, in-memory storage. No database — all data resets on restart.
Prerequisites
Local dev: .NET 10 SDK
Docker: Docker + Docker Compose v2
Running locally
cd OpgaveApi
dotnet run
API available at http://localhost:5082.
Swagger/Scalar docs at http://localhost:5082/scalar/v1 (dev mode only).
Running with Docker Compose
The compose file expects an external Docker network named homelab_homelab. Create it once if it doesn't exist:
docker network create homelab_homelab
Then start the stack:
docker compose up -d
Backend runs on port 8080 inside the container. Map it as needed in your reverse proxy.
Configuration
JWT settings are read from environment variables in production. Before deploying, set these in your environment or docker-compose.override.yml:
Jwt__Secret=<your-secret-min-30-chars>
Jwt__Issuer=<your-issuer>
Jwt__Audience=<your-audience>
Security: Do not use the default secret from
appsettings.jsonin production. Change it before exposing the API publicly.
Authentication
All endpoints except /api/auth/login and /api/auth/register require a Bearer token.
Register:
POST /api/auth/register
Content-Type: application/json
{ "username": "...", "password": "..." }
Login:
POST /api/auth/login
Content-Type: application/json
{ "username": "...", "password": "..." }
Returns a JWT. Pass it as Authorization: Bearer <token> on subsequent requests.
Endpoints
| Resource | Base path |
|---|---|
| Auth | /api/auth |
| Users | /api/users |
| Orders | /api/orders |
| Order items | /api/orderitems |
| Items | /api/items |
| Locations | /api/locations |
| Delivery photos | /api/deliveryphotos |
| Fuckup photos | /api/fuckupphotos |
Full interactive docs at /scalar/v1 when running in development.
Photo uploads
Uploaded files are stored under /app/uploads inside the container, mounted as a Docker volume (uploads). They persist across container restarts but are local to the host.
Notes
- Storage is in-memory. Restarting the API wipes all data.
- CORS is set to allow all origins. Lock this down if the API is publicly accessible.
- Frontend repo: opgave-tracker-client