Simple, self-hosted attendance tracking API.
Presence is a lightweight, zero-dependency attendance tracking API. It runs as a single binary with an embedded SQLite database — no external services required.
- Zero configuration — runs out of the box with sensible defaults
- Single binary — no external database or services needed
- JWT authentication — secure user registration and login
- Session management — create and manage attendance sessions
- Check-in/out tracking — real-time attendance recording with timestamps
- CSV export — download attendance records as CSV
- RESTful API — clean, versioned JSON API
- Docker ready — multi-stage Dockerfile included
- Graceful shutdown — handles SIGINT/SIGTERM cleanly
git clone https://github.com/akhil-datla/Presence.git
cd Presence
make build
./presencedocker compose up -dDownload from Releases and run:
./presenceThe server starts on http://localhost:8080 by default.
All endpoints return JSON. Protected endpoints require Authorization: Bearer <token> header.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/auth/register |
Register a new user |
| POST | /api/v1/auth/login |
Login and get JWT token |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/users/me |
Get current user profile |
| PUT | /api/v1/users/me |
Update profile |
| DELETE | /api/v1/users/me |
Delete account |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/sessions |
Create a session |
| GET | /api/v1/sessions |
List your sessions |
| GET | /api/v1/sessions/:id |
Get session details |
| PUT | /api/v1/sessions/:id |
Update a session |
| DELETE | /api/v1/sessions/:id |
Delete a session |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/sessions/:id/checkin |
Check in to session |
| POST | /api/v1/sessions/:id/checkout |
Check out of session |
| GET | /api/v1/sessions/:id/attendance |
List attendance records |
| GET | /api/v1/sessions/:id/attendance/filter |
Filter by time |
| DELETE | /api/v1/sessions/:id/attendance |
Clear attendance |
| GET | /api/v1/sessions/:id/export/csv |
Export as CSV |
Register:
curl -X POST http://localhost:8080/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"first_name":"Jane","last_name":"Doe","email":"jane@example.com","password":"securepassword"}'Login:
curl -X POST http://localhost:8080/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"jane@example.com","password":"securepassword"}'Create Session:
curl -X POST http://localhost:8080/api/v1/sessions \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name":"Team Standup"}'Check In:
curl -X POST http://localhost:8080/api/v1/sessions/<session_id>/checkin \
-H "Authorization: Bearer <token>"| Variable | Flag | Default | Description |
|---|---|---|---|
PORT |
--port |
8080 |
Server port |
DATABASE_PATH |
--db |
presence.db |
SQLite database path |
JWT_SECRET |
--jwt-secret |
auto-generated | JWT signing secret |
LOG_LEVEL |
— | info |
Log level |
Environment variables take precedence over flags.
make build # Build binary
make run # Build and run
make test # Run tests
make lint # Run linter
make docker # Build Docker imageMIT — see LICENSE for details.