Edge gateway for AccountabilityAtlas. Routes external requests to internal services, handles JWT validation, CORS, and rate limiting.
- Docker Desktop (for 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-api-gatewayBuild the project (downloads JDK 21 automatically on first run):
# Linux/macOS
./gradlew build
# Windows
gradlew.bat builddocker-compose up -dThis starts Redis 7 for rate limiting.
# Linux/macOS
./gradlew bootRun
# Windows
gradlew.bat bootRunThe gateway starts on http://localhost:8080.
./gradlew testFormatting 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 (gateway + Redis) in Docker:
./gradlew composeUpStop docker-compose services:
./gradlew composeDownsrc/main/java/com/accountabilityatlas/gateway/
config/ Spring configuration (JWT, CORS)
filter/ Gateway filters (JWT authentication)
src/main/resources/
application.yml Shared config
application-local.yml Local dev overrides
src/test/java/.../
filter/ Filter unit tests
integration/ Integration tests (TestContainers)
| Task | Description |
|---|---|
bootRun |
Run the service locally (uses local profile) |
test |
Run all tests |
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 |
The gateway routes requests with /api/v1 prefix to backend services:
| Path Pattern | Target Service |
|---|---|
/api/v1/auth/** |
user-service:8081 |
/api/v1/users/** |
user-service:8081 |
/api/v1/videos/** |
video-service:8082 |
/api/v1/locations/** |
location-service:8083 |
/api/v1/moderation/** |
moderation-service:8085 |