Spring Boot REST API for managing tax filing records with MySQL persistence, user-linked filings, Thymeleaf login, and OAuth2 security configuration.
This release keeps the TaxEase tax-record workflow intact and adds a broader OAuth2 login setup. In addition to the existing Keycloak-backed configuration, the template now includes Google OAuth2 registration wiring for login experimentation and demos.
- Spring Boot REST API setup
- Spring Data JPA repository pattern
- MySQL-backed persistence
- Spring Security with OAuth2 client configuration
- Keycloak issuer-based JWT decoder setup
- Google OAuth2 client registration
- Custom Thymeleaf login page
- Method-level authorization with
@PreAuthorize - User signup, lookup, update, and admin user listing
- User-linked tax record creation
- Tax record create, read, update, and delete endpoints
- Admin-only approve and reject workflow endpoints
- One-to-many relationship between users and tax records
- Java 17
- Spring Boot 3.3
- Spring Web
- Spring Data JPA
- Spring Security
- Spring OAuth2 Client
- Spring OAuth2 Resource Server
- Thymeleaf
- MySQL
- Maven
- Lombok
TaxEase Template/
├── CHANGELOG.md
├── README.md
├── pom.xml
├── mvnw
├── mvnw.cmd
└── src/
└── main/
├── java/com/CodingNinjas/TaxEase/
│ ├── config/
│ ├── controller/
│ ├── dto/
│ ├── exception/
│ ├── model/
│ ├── repository/
│ ├── service/
│ └── TaxEaseApplication.java
└── resources/
├── application.yml
└── templates/
└── login.html
- Open a terminal in the project root.
- Update MySQL, Keycloak, and Google client values in
src/main/resources/application.ymlif needed. - Run
mvn test. - Run
mvn spring-boot:run. - Open
http://localhost:8082/loginfor the custom login page. - Use the API under
http://localhost:8082.
Available user endpoints:
GET /user/allGET /user/{userid}POST /user/signupPUT /user/update/{id}
Available tax endpoints:
GET /api/tax/{id}GET /api/tax/allPOST /api/tax/{userId}PUT /api/tax/{id}DELETE /api/tax/{id}POST /api/tax/approve/{id}POST /api/tax/reject/{id}
Access notes:
/user/signup,/login, and static assets are public.NORMALusers can read, create, update, and delete tax records.ADMINusers can list all users and approve or reject tax filings.- OAuth2 login is configured for Keycloak through
spring.security.oauth2.client. - Google login can be enabled by supplying the placeholder client credentials in
application.yml.
Example user signup request body:
{
"username": "john",
"password": "john123",
"age": 30,
"email": "john@example.com",
"role": "NORMAL"
}Example tax record request body:
{
"taxYear": "2024-2025",
"income": 900000,
"deductions": 150000
}- Suggested repository description:
Spring Boot REST API for tax filing management with MySQL persistence, user-linked filings, Thymeleaf login, and OAuth2 security configuration. - Suggested topics:
java,java-17,spring-boot,spring-security,spring-data-jpa,oauth2,keycloak,google-login,thymeleaf,mysql,rest-api,tax-management,maven,learning-project,portfolio-project