Skip to content

REST API for tracking expenses using Spring Boot, Spring MVC and Spring Data JPA.

License

joypatel9/expense-tracker-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

expense-tracker-api

REST API for tracking expenses, like this, but using Spring Data JPA, Lombok etc.

Created using Spring Boot and Spring Data JPA. JSON Web Token (JWT) used to add authentication.

Setup and Installation

  1. Clone repo from GitHub
    git clone https://github.com/joypatel9/expense-tracker-api.git
    cd expense-tracker-api
    
  2. Create a postgres database
  3. Update the database name, username and password in src/main/resources/application.properties
  4. Run the spring boot application using ./mvnw spring-boot:run
  5. This runs at port 8080 and hence all endpoints can be accessed starting from http://localhost:8080. For testing, you could use Postman collection ExpenseTracker, using the environment Expense tracker, which are available in src/test/resources/postman

Available Endpoints

  1. POST /api/users - registers a user
  2. POST /api/users/login - logs in a user, and returns a bearer JWT token
  3. GET /api/categories - gets all the categories of the current user
  4. GET /api/categories/{categoryId} - gets the category of the given categoryId
  5. POST /api/categories - adds a new category for the current user
  6. PUT /api/categories/{categoryId} - updates the category of the given categoryId
  7. GET /api/categories/{categoryId}/transactions - gets all transactions of the given categoryId
  8. POST /api/categories/{categoryId}/transactions - adds a transaction to the category of given categoryId
  9. GET /api/categories/{categoryId}/transactions/{transactionId} - gets the transaction of given categoryId and transactionId
  10. PUT /api/categories/{categoryId}/transactions/{transactionId} - updates the transaction of given categoryId and transactionId
  11. DEL /api/categories/{categoryId}/transactions/{transactionId} - deletes the transaction of given categoryId and transactionId
  12. DEL /api/categories/{categoryId} - deletes the given category of given categoryId and all its transactions

About

REST API for tracking expenses using Spring Boot, Spring MVC and Spring Data JPA.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages