@@ -8,7 +8,7 @@ A production-ready Spring Boot REST API for tracking job applications, built wit
88
99- ** Java 21**
1010- ** Spring Boot 3.2** (Web, Data JPA, Security, Validation)
11- - ** Spring Security** with stateless JWT authentication
11+ - ** Spring Security** with stateless JWT authentication + role-based authorization ( ` USER ` , ` BETA ` , ` ADMIN ` )
1212- ** JWT + Refresh Tokens** (access: 15 min, refresh: 7 days with rotation)
1313- ** Resilience4j Rate Limiting** on auth endpoints
1414- ** MariaDB** (production) / ** Testcontainers** (tests)
@@ -52,27 +52,38 @@ A production-ready Spring Boot REST API for tracking job applications, built wit
5252
5353| Method | Endpoint | Description |
5454| --------| ----------| -------------|
55- | POST | ` /api/auth/register ` | Register a new user |
56- | POST | ` /api/auth/login ` | Login and receive tokens |
57- | POST | ` /api/auth/refresh ` | Refresh access token |
58- | POST | ` /api/auth/logout ` | Logout and revoke refresh token |
59- | POST | ` /api/auth/forgot-password ` | Request password reset |
60- | POST | ` /api/auth/reset-password ` | Reset password with token |
61- | GET | ` /api/auth/me ` | Get current user info |
55+ | POST | ` /api/v1/ auth/register ` | Register a new user |
56+ | POST | ` /api/v1/ auth/login ` | Login and receive tokens |
57+ | POST | ` /api/v1/ auth/refresh ` | Refresh access token |
58+ | POST | ` /api/v1/ auth/logout ` | Logout and revoke refresh token |
59+ | POST | ` /api/v1/ auth/forgot-password ` | Request password reset |
60+ | POST | ` /api/v1/ auth/reset-password ` | Reset password with token |
61+ | GET | ` /api/v1/ auth/me ` | Get current user info |
6262
6363### Applications
6464
6565| Method | Endpoint | Description |
6666| --------| ----------| -------------|
67- | POST | ` /api/applications ` | Create application |
68- | GET | ` /api/applications ` | List all (paginated + filterable) |
69- | GET | ` /api/applications/{id} ` | Get by ID |
70- | PUT | ` /api/applications/{id} ` | Full update |
71- | PATCH | ` /api/applications/{id}/status ` | Update status |
72- | PATCH | ` /api/applications/{id}/reminder ` | Toggle reminder |
73- | DELETE | ` /api/applications/{id} ` | Delete |
74- | GET | ` /api/applications/upcoming ` | Upcoming next steps |
75- | GET | ` /api/applications/overdue ` | Overdue next steps |
67+ | POST | ` /api/v1/applications ` | Create application |
68+ | GET | ` /api/v1/applications ` | List all (paginated + filterable) |
69+ | GET | ` /api/v1/applications/{id} ` | Get by ID |
70+ | PUT | ` /api/v1/applications/{id} ` | Full update |
71+ | PATCH | ` /api/v1/applications/{id}/status ` | Update status |
72+ | PATCH | ` /api/v1/applications/{id}/reminder ` | Toggle reminder |
73+ | DELETE | ` /api/v1/applications/{id} ` | Delete |
74+ | GET | ` /api/v1/applications/upcoming ` | Upcoming next steps |
75+ | GET | ` /api/v1/applications/overdue ` | Overdue next steps |
76+
77+ ## Authorization Model
78+
79+ - JWT access tokens now include a ` roles ` claim (e.g., ` ROLE_USER ` , ` ROLE_ADMIN ` ).
80+ - Protected API routes require ` ROLE_USER ` (auth routes remain public).
81+ - A default ` ROLE_USER ` is assigned on registration.
82+
83+ Flyway seeds the roles catalog (` USER ` , ` BETA ` , ` ADMIN ` ) and sample accounts:
84+
85+ - ` admin@jobtracker.local ` / ` Admin@1234 ` (` ROLE_ADMIN ` + ` ROLE_USER ` )
86+ - ` user@jobtracker.local ` / ` User@1234 ` (` ROLE_USER ` )
7687
7788### Gamification
7889
0 commit comments