Skip to content

byte2code/taxease-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TaxEase API

Spring Boot REST API for managing tax filing records with MySQL persistence, user-linked filings, Thymeleaf login, and OAuth2 security configuration.

Overview

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.

Concepts and Features Covered

  • 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

Tech Stack

  • Java 17
  • Spring Boot 3.3
  • Spring Web
  • Spring Data JPA
  • Spring Security
  • Spring OAuth2 Client
  • Spring OAuth2 Resource Server
  • Thymeleaf
  • MySQL
  • Maven
  • Lombok

Project Structure

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

How to Run

  1. Open a terminal in the project root.
  2. Update MySQL, Keycloak, and Google client values in src/main/resources/application.yml if needed.
  3. Run mvn test.
  4. Run mvn spring-boot:run.
  5. Open http://localhost:8082/login for the custom login page.
  6. Use the API under http://localhost:8082.

Available user endpoints:

  • GET /user/all
  • GET /user/{userid}
  • POST /user/signup
  • PUT /user/update/{id}

Available tax endpoints:

  • GET /api/tax/{id}
  • GET /api/tax/all
  • POST /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.
  • NORMAL users can read, create, update, and delete tax records.
  • ADMIN users 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
}

GitHub Metadata

  • 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

About

Spring Boot REST API for tax filing management with MySQL persistence, user-linked filings, Thymeleaf login, and OAuth2 Keycloak security configuration.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors