Skip to content

Expense Tracker System will keep track of Income-Expense on a day to day basics. Technologies Used:

Notifications You must be signed in to change notification settings

ravisahani2893/expense-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expense Tracker System

Expense Tracker System will keep track of Income-Expense on a day to day basics.

Technologies Used

  1. Spring Boot
  2. Spring Security
  3. Spring Data JPA
  4. JWT
  5. MySQL Database
  6. Hibernate
  7. Maven
  8. Spring Boot Devtools

Prerequisites

Java 1.8 or greater, Spring boot 2.0 or greater, Maven, IntelliJ or Eclipse

Getting Started

Follow the step below to get the application up and running on your local machine for development and testing purpose.

  1. Git clone project in your local machine https://github.com/ravisahani2893/expense-tracker
  2. Import the project in Eclipse.
  3. Create database with name expense_tracker in MySQL Workbench.
  4. Run the application.
  5. Once application is up and running.Execute below queries.
  INSERT INTO roles(name) VALUES('ROLE_USER');
  INSERT INTO roles(name) VALUES('ROLE_MODERATOR');
  INSERT INTO roles(name) VALUES('ROLE_ADMIN');
  1. Access the application by url http://localhost:9001 in any web browser.

Testing Rest API via Postman

  1. User Registration
API : {{url}}/api/auth/signup

Request:
{
    "username":"testuser",
    "email":"[email protected]",
    "password":"123456"
}

Response:
{
    "message": "User registered successfully!"
}
  1. User Login
API : {{url}}/api/auth/signin

Request:
{
    "username":"testuser",
    "password":"123456"
}

Response:
{
    "id": 3,
    "username": "testuser",
    "email": "[email protected]",
    "roles": [
        "ROLE_USER"
    ],
    "accessToken": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0dXNlciIsImlhdCI6MTY1Mjg4MDk4NiwiZXhwIjoxNjUyOTY3Mzg2fQ.xMy8xN9cv7YTkDJ0zPZMo_INpDMZqdKnYAhgLTLfYHB-VWtmdhqOQ1kh-5yx6P6Wwc_QyM1JA_j8zksd4o5OWw",
    "tokenType": "Bearer"
}
  1. Create Category
API : {{url}}/api/category

Headers:
{
    "Authorization":"Bearer {{token}}"
}

Request:
{
    "name":"Health Care"
}

Response:
{
    "id": 6,
    "name": "Health Care",
    "createdAt": "2022-05-18T13:38:58.527+00:00",
    "updatedAt": "2022-05-18T13:38:58.527+00:00",
    "active": true
}
  1. List Category
API : {{url}}/api/category

Headers:
{
    "Authorization":"Bearer {{token}}"
}

Response:
{
    "userId": 3,
    "categories": [
        {
            "id": 6,
            "name": "Health Care",
            "createdAt": "2022-05-18T13:38:59.000+00:00",
            "updatedAt": "2022-05-18T13:38:59.000+00:00",
            "active": true
        }
    ]
}
  1. Create Payment Type
API : {{url}}/api/paymenttype

Headers:
{
    "Authorization":"Bearer {{token}}"
}

Request:
{
    "type":"UPI"
}

Response:
{
    "id": 6,
    "type": "UPI",
    "createdAt": "2022-05-18T13:43:28.901+00:00",
    "updatedAt": "2022-05-18T13:43:28.901+00:00",
    "active": true
}
  1. List Payment Type
API : {{url}}/api/paymenttype

Headers:
{
    "Authorization":"Bearer {{token}}"
}

Response:
[
    {
        "id": 6,
        "type": "UPI",
        "createdAt": "2022-05-18T13:43:29.000+00:00",
        "updatedAt": "2022-05-18T13:43:29.000+00:00",
        "active": true
    }
]
  1. Create Expense
API : {{url}}/api/expense

Headers:
{
    "Authorization":"Bearer {{token}}"
}

Request:

{
    "amount":100,
    "expenseDescription":"Health Product",
    "paymentId":6,
    "categoryId":6
}

Response:
{
    "id": 5,
    "category": {
        "id": 6,
        "name": "Health Care",
        "createdAt": "2022-05-18T13:38:59.000+00:00",
        "updatedAt": "2022-05-18T13:38:59.000+00:00",
        "active": true
    },
    "payment": {
        "id": 6,
        "type": "UPI",
        "createdAt": "2022-05-18T13:43:29.000+00:00",
        "updatedAt": "2022-05-18T13:43:29.000+00:00",
        "active": true
    },
    "expenseAmount": 100,
    "expenseDescription": "Health Product",
    "createdAt": "2022-05-18T13:47:35.915+00:00",
    "updatedAt": "2022-05-18T13:47:35.915+00:00"
}
  1. List User Expense
API : {{url}}/api/expense

Headers:
{
    "Authorization":"Bearer {{token}}"
}

Response:
[
    {
        "id": 5,
        "expenseAmount": 100.00,
        "expenseDescription": "Health Product",
        "categoryName": "Health Care",
        "paymentType": "UPI",
        "createdAt": "2022-05-18",
        "updatedAt": "2022-05-18"
    }
]
  1. List User Expense by Date Filter
API : {{url}}/api/expense?fromDate=2022-05-01&toDate=2022-05-20

Headers:
{
    "Authorization":"Bearer {{token}}"
}

Response:
[
    {
        "id": 5,
        "expenseAmount": 100.00,
        "expenseDescription": "Health Product",
        "categoryName": "Health Care",
        "paymentType": "UPI",
        "createdAt": "2022-05-18",
        "updatedAt": "2022-05-18"
    }
]
  1. List User Current Month Expense
API : {{url}}/api/expense/currentmonth

Headers:
{
    "Authorization":"Bearer {{token}}"
}

Response:
[
    {
        "id": 5,
        "expenseAmount": 100.00,
        "expenseDescription": "Health Product",
        "categoryName": "Health Care",
        "paymentType": "UPI",
        "createdAt": "2022-05-18",
        "updatedAt": "2022-05-18"
    }
]
  1. List User Expense By Category
API : {{url}}/api/expense/currentmonth

Headers:
{
    "Authorization":"Bearer {{token}}"
}

Response:
[
    {
        "id": 5,
        "expenseAmount": 100.00,
        "expenseDescription": "Health Product",
        "categoryName": "Health Care",
        "paymentType": "UPI",
        "createdAt": "2022-05-18",
        "updatedAt": "2022-05-18"
    }
]
  1. List User Expense By Category and Date Filter
API : {{url}}/api/expense/category/6?fromDate=2022-05-01&toDate=2022-05-20

Headers:
{
    "Authorization":"Bearer {{token}}"
}

Response:
[
    {
        "id": 5,
        "expenseAmount": 100.00,
        "expenseDescription": "Health Product",
        "categoryName": "Health Care",
        "paymentType": "UPI",
        "createdAt": "2022-05-18",
        "updatedAt": "2022-05-18"
    }
]
  1. List User Current Month Expense By Category
API : {{url}}/api/expense/currentmonth/category/6

Headers:
{
    "Authorization":"Bearer {{token}}"
}

Response:
[
    {
        "id": 5,
        "expenseAmount": 100.00,
        "expenseDescription": "Health Product",
        "categoryName": "Health Care",
        "paymentType": "UPI",
        "createdAt": "2022-05-18",
        "updatedAt": "2022-05-18"
    }
]

About

Expense Tracker System will keep track of Income-Expense on a day to day basics. Technologies Used:

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages