- C# 73.9%
- HTML 23.4%
- CSS 2.4%
- JavaScript 0.1%
- Shell 0.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .devcontainer | ||
| .forgejo/workflows | ||
| requirements | ||
| src | ||
| tests | ||
| .dockerignore | ||
| .editorconfig | ||
| .gitignore | ||
| CLAUDE.md | ||
| Directory.Build.props | ||
| Directory.Packages.props | ||
| README.md | ||
| renovate.json | ||
| TimeTracker.slnx | ||
Time Tracker
Time tracking and invoicing for consultants at Luizio, replacing Harvest. Track time per
client, project and task, see it by day and week as 5,50 or 5:30, invoice it as valid
Swedish invoices in Swedish or English, and follow it up in reports. The requirements are in
requirements/.
Run it
With Aspire, which needs only Docker:
dotnet run --project src/TimeTracker.AppHost # dashboard → http://localhost:15080, app → http://localhost:8080
The AppHost starts PostgreSQL (data kept in a Docker volume) and Mailpit in containers, wires their settings into the app and shows its traces in the dashboard. Mailpit's web UI is linked from the dashboard; its port changes on each run.
Without Aspire, in the devcontainer: PostgreSQL and Mailpit are already running
(.devcontainer/services.yaml) and the environment variables are set:
dotnet run --project src/TimeTracker.Web # → http://localhost:8080, Mailpit on :8025
Sign up with an @luizio.com address; the confirmation email shows up in Mailpit. The
database is migrated automatically on start.
Configuration
Everything that differs between environments is read from environment variables (NFR-003):
| Variable | Example | |
|---|---|---|
ConnectionStrings__Default |
Host=db;Database=timetracker;Username=…;Password=… |
Required |
App__PublicUrl |
https://time.luizio.com |
Used in links in emails |
App__AllowedSignUpDomain |
luizio.com |
Always allowed to sign up, and its users are admins who allow other domains and addresses in the app (default luizio.com) |
Smtp__Host, Smtp__Port |
smtp.example.com, 587 |
|
Smtp__Username, Smtp__Password |
Optional | |
Smtp__Security |
Auto, StartTls, SslOnConnect, None |
Default Auto |
Smtp__FromAddress, Smtp__FromName |
noreply@luizio.com, Time Tracker |
The app's own sender; replies go to the user |
RateLimits__AccountPermitLimit, RateLimits__AccountWindow |
10, 00:05:00 |
Per-IP limit on login, sign-up and password reset (NFR-004) |
OTEL_SERVICE_NAME |
timetracker |
Name in Prometheus (job) and Loki (service_name) |
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT |
http://prometheus:9090/api/v1/otlp/v1/metrics |
Optional; OTLP/HTTP (NFR-008) |
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT |
http://loki:3100/otlp/v1/logs |
Optional; OTLP/HTTP |
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT |
http://tempo:4318/v1/traces |
Optional; OTLP/HTTP |
OTEL_EXPORTER_OTLP_ENDPOINT |
http://collector:4317 |
Optional; sends all three to one collector instead |
The app listens on port 8080 and serves /health for the platform's probes. HTTPS is
terminated in front of it. Keys for cookies and email links are stored in the database, so
restarts don't log anyone out.
Build and deploy
.forgejo/workflows/build.yml runs on every push to main: format check, unit tests,
integration tests against PostgreSQL, then builds src/TimeTracker.Web/Dockerfile and pushes
code.luizio.com/ludwig/time-tracker:<run number> (and :latest); the commit is in the
image's org.opencontainers.image.revision label. Deploying and
backups are done by the home-server project.
Tests
dotnet test tests/TimeTracker.Engine.Tests # pure logic, no database
TEST_POSTGRES="Host=localhost;Database=postgres;Username=timetracker;Password=timetracker" \
dotnet test tests/TimeTracker.Manager.IntegrationTests # creates and drops its own databases
Layout
The solution follows the Manager / Engine / Access layering used in OpsyOne, wired with Luizio.iFX (NFR-002):
Blazor pages, controllers ──proxy──▶ Managers ──proxy──▶ Engines (pure logic)
└─proxy──▶ Accessors (PostgreSQL, SMTP)
| Project | Contents |
|---|---|
TimeTracker.AppHost |
Aspire host for local development: PostgreSQL, Mailpit, dashboard |
TimeTracker.Web |
Blazor UI, account and file controllers, reminder job, composition root |
TimeTracker.Manager.Interface / .Service |
Use cases: time, clients, projects, invoices, reports, settings, import, accounts, reminders |
TimeTracker.Engine.Interface / .Service |
Rates and invoice totals, Harvest CSV, invoice PDF (QuestPDF), Swedish holidays |
TimeTracker.Access.Interface / .Service |
EF Core + Identity on PostgreSQL, file storage, SMTP |
TimeTracker.Utilities |
Duration and number formatting shared by every layer |
Every call between layers goes through the iFX proxy, so it is traced and logged, and the
logged-in user travels with it as CurrentUser. Accessors limit every query to that user.
PDFs are rendered with QuestPDF under its Community licence, which is free for companies with less than USD 1M in annual revenue.