AssetTrack is a comprehensive, enterprise-grade asset tracking system built with a robust Spring Boot backend and a modern React frontend. It features role-based access control, condition reporting, automated low-stock alerts, and much more.
- Role-Based Access Control: Granular permissions for Admins, Managers, and Developers.
- Asset Lifecycle Management: Track assets from procurement to decommissioning.
- Condition Reports: Log issues, track repairs, and manage warranty statuses.
- Automated Notifications: Get alerted for low stock and expiring warranties via email (Mailtrap) and in-app notifications.
-
Start the database only:
make db
(or
docker-compose up -d postgres pgadmin)- PostgreSQL runs on
localhost:5432. - pgAdmin is available at http://localhost:8081 (Login:
admin@assettrack.com/admin).
- PostgreSQL runs on
-
Optional email alerts (host backend):
- Copy .env.example to
.envand fill in Mailtrap values.
- Copy .env.example to
-
Run the backend:
make backend
- Loads
.env.localif present and generates RSA keys if missing.
- Loads
-
Run the frontend:
make frontend
(OR
cd frontend && npm install && npm run dev)
Key Management Note: If you want to store keys elsewhere, set
RSA_PRIVATE_KEY_LOCATIONandRSA_PUBLIC_KEY_LOCATION(for example,file:/absolute/path/private_pkcs8.pem).
Run everything seamlessly with Docker Compose:
docker-compose up -dNotes:
- Compose loads variables from
.envat the repo root. - Copy .env.example to
.envand fill values before running. - The backend container auto-generates RSA keys on first start and stores them in a named volume.
- Database connection defaults to the
postgresservice inside the Compose network. - Optional mail settings are picked up from
.envif present.
If you only want the database in Docker and run the backend on the host:
docker-compose up -d postgres pgadminTo quickly test the application with realistic data, we use the DatabaseSeeder component.
It populates the database with:
- Users: Admin, Managers, and Developers. (e.g., login as
alice.admin@company.comwith passwordAdmin@1234) - Assets: Laptops, Monitors, Keyboards, Mice, etc.
- Allocations: Historical and active asset assignments.
- Condition Reports & Notifications: To demonstrate alerting and repair flows.
The seeder runs automatically when the dev or seed Spring profile is active.
spring.profiles.active=devYou can view the exact data generated or customize it by checking the file:
👉 backend/src/main/java/com/assettrack/config/DatabaseSeeder.java
- Create a shared inbox in Mailtrap and invite the team to the workspace.
- Use the shared SMTP credentials locally (do not commit them).
- Copy .env.example to
.env.
- Copy .env.example to
- Environment variables used by the app:
MAILTRAP_HOST(default:sandbox.smtp.mailtrap.io)MAILTRAP_PORT(default:2525)MAILTRAP_USERNAMEMAILTRAP_PASSWORD- Optional:
MAIL_FROM(default:no-reply@assettrack.local) - Optional:
ALERTS_RECIPIENT_EMAIL(defaults toadmin@assettrack.com)
- Email alerts are sent by the low-stock scheduled job in
AlertService.- To test quickly, create low-stock items and set
ALERTS_RECIPIENT_EMAILto a test address.
- To test quickly, create low-stock items and set
Use the helper script to quickly get a JWT for Swagger testing:
./backend/scripts/get-token.shIt will login or auto-register (default email dev@assettrack.local, password ChangeMe123).
Common options:
./backend/scripts/get-token.sh --email user@company.com --password "MyPass123"
ASSETTRACK_EMAIL=user@company.com ASSETTRACK_PASSWORD=MyPass123 ./backend/scripts/get-token.sh
./backend/scripts/get-token.sh --print-headerSwagger UI Authentication: Go to http://localhost:8080/swagger-ui/index.html → Authorize → paste the token (or the Authorization: Bearer ... header).
Use Make targets from the repo root for a smoother developer experience:
make db
make backend
make frontend
make dockerNotes:
make backendloads.envviascripts/load-env.shif it exists.make backendalso runsbackend/scripts/ensure-rsa-keys.shto generate keys if missing.- Run
make backendandmake frontendin separate terminals.
The API is strictly documented using the OpenAPI 3.0 specification. You can view the interactive Swagger UI documentation here: https://AhmedShehab1.github.io/AssetTrack/
We use property-based testing with Schemathesis to ensure our Spring Boot implementation strictly adheres to our OpenAPI specification. This approach automatically generates hundreds of test cases to catch edge cases, validation errors, and conformance issues.
The source of truth for our API is located at /docs/openapi.yaml and is hosted at http://shehabtech.me/AssetTrack.
You can run the API tests locally using Docker:
docker run schemathesis/schemathesis:stable run http://shehabtech.me/AssetTrack --schema ./docs/openapi.yaml