Skip to content

Repository files navigation

FinGuard Finance Application

Finguard is a backend application for finance management. This project consists of the backend implementation for the finance management service, built with Java, Spring Data JPA, Spring Boot, and Microservices. Postman is used for front-end validation.

Introduction

FinGuard is designed to help users manage their finances efficiently. It includes features for user registration, budget management, transaction processing, investment analytics, and more.

Prerequisites

  • Java 11 or higher
  • Maven
  • Oracle Database (or any other database with appropriate configuration)

  • How to run Fingaurd

    1. Run this command to clone the repo

    git clone https://github.com/Krishnann-s/FinGuard.git
    cd Fingaurd
    

    2. Set Up Lombok:

    • Intellij IDEA: Install Lombok as an extension.
    • Eclipse or Spring Tool Suite: Download Lombok and set the IDE Path.

    3. Configure the Database

    • Open the application.properties file.
    • Update the database URL, username, password to match your database configuration.

    4.Run the application

    • Use your IDE to run the application or execute the following command
    • ./mvnw spring-boot:run

    Technologies used

    FinGuard is a Spring Boot project (version 3.3.4) that requires Lombok configuration. It uses various dependencies like Spring Gateway and Spring Validation. Dependencies for each microservice are listed in detail in the Mircoservices section.

    The database used is Oracle Database, but you can change this by updating the database URL, username, and password in the application.properties file.

    Each microservice has its own port number. The API Gateway, running on port 8086, is used to navigate through the microservices. All microservices, including the API Gateway, are registered in the Eureka server.

    Microservices

    User-Service

    User-Service consist of the user registration and login business logic. The JWT-Token is generated during the Login stage. It runs in port 8000.

    Dependencies Needed
    • Spring-boot-starter-validation
    • Springfox-boot-starter
    • spring-boot-devtools
    • lombok
    • spring-boot-starter-data-jpa
    • spring-cloud-starter-netflix-eureka-client
    • spring-cloud-starter-openfeign
    • jjwt-api
    • jjwt-impl
    • jjwt-jackson
    • Spring-boot-starter-mail
    • spring-boot-starter-security

    User RestController

    Definition REST APIs
    Register user: POST - /finguard/user/register
    Login User: POST - /fingaurd/user/login
    Get All User(only Admin can access): GET - /fingaurd/users
    Get User by Id: GET - /finguard/user/{userId}
    Update User by Id: PUT - /finguard/user/{userId}
    Update User wallet by User Id: PUT - /finguard/user/wallet/{userId}
    Delete User by Id(Both user and Admin have access): DELETE - /finguard/user/{userId}

    Notification Service

    This microservice handles sending emails when a new user registers. Below is a detailed explanation of the components and dependencies used.

    Dependencies Used
  • spring-boot-starter-test
  • spring-boot-starter
  • dotenv-java
  • spring-boot-starter-web
  • spring-boot-devtools
  • lombok
  • spring-cloud-starter-openfeign
  • spring-boot-starter-mail
  • spring-cloud-starter-netflix-eureka-client
  • springdoc-openapi-starter-webmvc-ui
  • Notification RestController

    Definition REST APIs
    Send Account creation mail POST - /notification/sendEmail

    Finance Management Service

    The Finance Management Service handles budget management and transaction processing. It includes functionalities for creating, updating, and deleting budgets, as well as managing transactions, debts, and portfolio investments.

    Dependencies Needed
  • spring-boot-starter
  • spring-boot-starter-validation
  • springdoc-openapi-starter-webmvc-ui
  • spring-boot-starter-test
  • spring-boot-starter-data-jpa
  • spring-boot-starter-web
  • spring-cloud-starter-openfeign
  • spring-boot-devtools
  • lombok
  • ojdbc11
  • spring-cloud-starter-netflix-eureka-client
  • springfox-swagger-ui
  • hibernate-validator
  • validation-api
  • Budget RestController

    Definition REST APIs
    Create a new Budget POST - /api/budgets
    Get a budget by ID GET - /api/budgets/{budgetId}
    Update a Budget by ID PUT - /api/budgets/{budgetId}
    Delete a Budget by ID DELETE - /api/budgets/{budgetId}
    Get all budgets for a user GET - /api/budgets/user/{userId}
    Get remaining amount in budget GET - /api/budgets/{budgetId}/remaining
    Get budget report GET - /api/budgets/report/{userId}/{startDate}/{endDate}

    Transation RestController

    Definition REST APIs
    Create a new transaction POST - /transactions
    Get a transaction by ID GET - /transactions/{id}/{userName}
    Get transactions by user ID GET - /transactions/user/{userId}
    Make a transaction POST - /transactions/user/txn
    Portfolio transaction POST - /transactions/user/portfolio
    Debt transaction POST - /transactions/user/debt

    Investment Analytics Service

    The Investment Analytics Service provides functionalities for managing and analyzing investment portfolios. It includes endpoints for adding, viewing, updating, and deleting portfolios, as well as generating various financial reports.

    Dependencies Needed
  • spring-boot-starter
  • spring-boot-starter-test
  • springdoc-openapi-starter-webmvc-ui
  • spring-boot-starter-web
  • spring-boot-devtools
  • ojdbc11
  • lombok
  • spring-boot-starter-data-jpa
  • spring-cloud-starter-netflix-eureka-client
  • spring-boot-starter-validation
  • javax.mail-api
  • javax.mail
  • spring-cloud-starter-openfeign
  • Portfolio RestController

    Definition REST APIs
    Add a new portfolio POST - /api/Portfolio
    View a portfolio by ID GET - /api/Portfolio/{portfolioId}
    Update a portfolio PUT - /api/Portfolio/{portfolioId}
    Delete a portfolio DELETE - /api/Portfolio/{portfolioId}
    View all portfolios for a user GET - /api/Portfolio/portfolio/{userId}

    Report RestController

    Definition REST APIs
    Get debts report GET - /api/reports/financereport/{userId}
    Get income and expense report GET - /api/reports/incomexpensereport/{userId}
    Get budget report GET - /api/reports/budgetreport/{userId}/{startDate}/{endDate}
    Get portfolio report GET - /api/reports/portfolioreport/{userId}

    API Gateway

    The API Gateway handles role-based authentication and routes requests to the appropriate microservices. It uses JWT for authentication and supports role-based access control.

    Dependencies Needed
  • spring-boot-starter-webflux
  • spring-boot-starter-security
  • spring-cloud-starter-gateway
  • jjwt-api
  • jjwt-impl
  • jjwt-jackson
  • servlet-api
  • spring-cloud-starter-netflix-eureka-client
  • spring-boot-starter-test
  • spring-boot-devtools
  • spring-cloud-starter
  • spring-security-test
  • Contact

    If you have any questions, suggestions, or feedback, feel free to reach out:

    About

    A Backend Finance Application for managing money.

    Topics

    Resources

    Stars

    0 stars

    Watchers

    1 watching

    Forks

    Releases

    Packages

    Used by

    Contributors

    Languages