User identity and access management service for AccountabilityAtlas. Handles registration, authentication (email/password + OAuth), JWT token issuance, profile management, and trust tier progression.
- Docker Desktop (for PostgreSQL and Redis)
- Git
JDK 21 is managed automatically by the Gradle wrapper via Foojay Toolchain -- no manual JDK installation required.
git clone <repo-url>
cd AcctAtlas-user-serviceBuild the project (downloads JDK 21 automatically on first run):
# Linux/macOS
./gradlew build
# Windows
gradlew.bat builddocker-compose up -dThis starts PostgreSQL 17 and Redis 7. Flyway migrations run automatically when the service starts.
# Linux/macOS
./gradlew bootRun
# Windows
gradlew.bat bootRunThe service starts on http://localhost:8081.
# Health check
curl http://localhost:8081/actuator/health
# Register a new user
curl -X POST http://localhost:8081/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"SecurePass123","displayName":"TestUser"}'
# Login (save the accessToken from the response)
curl -X POST http://localhost:8081/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"SecurePass123"}'
# Get current user profile (replace TOKEN with accessToken from login)
curl http://localhost:8081/users/me \
-H "Authorization: Bearer TOKEN"./gradlew testIntegration tests use TestContainers to spin up PostgreSQL automatically -- Docker must be running.
Formatting is enforced by Spotless using Google Java Format.
# Check formatting
./gradlew spotlessCheck
# Auto-fix formatting
./gradlew spotlessApplyRuns Spotless, Error Prone, tests, and JaCoCo coverage verification (80% minimum):
./gradlew checkBuild a Docker image locally using Jib (no Dockerfile needed):
./gradlew jibDockerBuildBuild and start the full stack (service + Postgres + Redis) in Docker:
./gradlew composeUpsrc/main/java/com/accountabilityatlas/userservice/
config/ Spring configuration (Security, JPA, JWT)
domain/ JPA entities (User, Session, OAuthLink, etc.)
repository/ Spring Data JPA repositories
service/ Business logic
web/ Controller implementations
event/ Event publisher interface
src/main/resources/
application.yml Shared config
application-local.yml Local dev overrides
db/migration/ Flyway SQL migrations
src/test/java/.../
domain/ Entity unit tests
service/ Service unit tests (Mockito)
web/ Controller tests (@WebMvcTest)
integration/ Integration tests (TestContainers)
API interfaces and DTOs are generated from docs/api-specification.yaml by the OpenAPI Generator plugin into build/generated/.
| Task | Description |
|---|---|
bootRun |
Run the service locally (uses local profile) |
test |
Run all tests |
unitTest |
Run unit tests only (no Docker required) |
integrationTest |
Run integration tests only (requires Docker) |
check |
Full quality gate (format + analysis + tests + coverage) |
spotlessApply |
Auto-fix code formatting |
jibDockerBuild |
Build Docker image |
composeUp |
Build image + docker-compose up |
composeDown |
Stop docker-compose services |