Vehicle management & cost tracking — your personal pit crew for every car.
Track maintenance, repairs, fuel costs, and seasonal expenses for your daily driver and track/hobby vehicles.
- 🚗 Daily vehicle management
- 🏎️ Seasonal vehicles management
- 🔧 Cost breakdowns — Service, repair, fuel costs
- 📊 Reports — per season, per year, or all-time
- 📥 Export — CSV/PDF export with full item breakdown
- ⛽ Spritmonitor integration — link a vehicle and display live average fuel consumption
| Layer | Technology |
|---|---|
| Frontend | Next.js 15 + React 18 + TypeScript + Tailwind CSS |
| Backend | NestJS + TypeScript |
| Database | PostgreSQL 16 |
| ORM | Drizzle |
- Docker + Docker Compose
git clone https://github.com/Severon96/pitbook.git
cd pitbookCreate a .env file in the project root. At minimum, set:
# Image version (use "latest" or a specific release tag, e.g. "1.0.3")
VERSION=latest
# Database
POSTGRES_USER=pitbook
POSTGRES_PASSWORD=change_me
POSTGRES_DB=pitbook
DATABASE_URL=postgresql://pitbook:change_me@postgres:5432/pitbook
# Backend
JWT_SECRET=change_me_use_a_long_random_string_at_least_32_chars
JWT_EXPIRES_IN=7d
FRONTEND_URL=http://localhost:3000 # externally accessible URL of the frontend
# Frontend
API_URL=http://api:3001 # must use the internal container port
# Ports exposed on the host (optional, defaults shown)
API_PORT=3001
WEB_PORT=3000
# OAuth/OIDC (optional, see Authentication section below)
OIDC_ENABLED=false
API_URLvsFRONTEND_URL
API_URLis used by the frontend container to reach the API container — use the Docker service name and the internal container port (http://api:3001), never the host-mapped port.FRONTEND_URLis used by the API for OAuth redirect URIs — use the externally accessible URL of the frontend (e.g.http://192.168.1.10:3000).
docker compose upDatabase migrations run automatically on API startup.
| Service | URL |
|---|---|
| Frontend | http://localhost:3000 |
| API | http://localhost:3001 |
| Swagger Docs | http://localhost:3001/api/docs |
Ports depend on WEB_PORT / API_PORT in your .env.
Use the dev compose file, which builds images locally with live reload via bind mounts:
docker compose -f docker-compose.dev.yml upNo .env is required — sensible defaults are built in.
Users register with email and password. The first registered user becomes an admin.
Integrate with any OIDC-compliant identity provider (Keycloak, Authentik, Authelia, etc.).
OIDC_ENABLED=true
OIDC_ISSUER_URL=https://your-provider.example.com/realms/pitbook
OIDC_CLIENT_ID=pitbook
OIDC_CLIENT_SECRET=your_client_secret
OIDC_REDIRECT_URI=http://localhost:3001/auth/oauth/callback
OIDC_SCOPE=openid profile email # optional, this is the defaultKeycloak:
- Create a new realm (e.g. "pitbook")
- Create a new client:
- Client ID:
pitbook - Client Protocol:
openid-connect - Access Type:
confidential - Valid Redirect URIs:
http://localhost:3001/auth/oauth/callback
- Client ID:
- Copy the Secret from the Credentials tab
- Set
OIDC_ISSUER_URLtohttps://your-keycloak/realms/pitbook
Authentik:
- Create a new OAuth2/OIDC Provider
- Name: Pitbook
- Client Type: Confidential
- Redirect URIs:
http://localhost:3001/auth/oauth/callback
- Create an Application linked to the provider
- Copy Client ID and Client Secret
- Set
OIDC_ISSUER_URLto your Authentik issuer URL
Authelia:
identity_providers:
oidc:
clients:
- id: pitbook
description: Pitbook Vehicle Management
secret: your_client_secret
redirect_uris:
- http://localhost:3001/auth/oauth/callback
scopes:
- openid
- profile
- emailSet OIDC_ISSUER_URL to your Authelia URL.
- When OAuth is enabled, a "Sign in with SSO" button appears on the login page
- Users are redirected to the identity provider and back after authentication
- User accounts are created automatically from the OAuth profile
- No password is stored for OAuth users
Pitbook can display live average fuel consumption from Spritmonitor.de.
- Get your API key — log in to Spritmonitor and generate a key at My Account → Change Password (token field at the bottom).
- Link a vehicle — open a vehicle's detail page, find the Spritmonitor card, enter your API key and click Find Vehicles, select the vehicle, then click Link.
- Done — the card shows the live average consumption (e.g.
Ø 7.2 l/100km) and a direct link to Spritmonitor.
To remove the link, click Unlink in the Spritmonitor card.
The API key and vehicle ID are stored per vehicle, so different vehicles can use different Spritmonitor accounts. Consumption data is fetched live on each page load — nothing is cached locally.