Skip to content

This project is crafted in Kotlin, leveraging the Spring Boot Framework, and using PostgreSQL as the primary database. It is designed to help users manage their personal finances by allowing them to set monthly budgets, track transactions, and manage user settings. The application also integrates Spring's scheduling capabilities for automated tasks

Notifications You must be signed in to change notification settings

renatompf/personal-finance-tracking

Repository files navigation

Personal Finance Tracking


Project Description

This project is crafted in Kotlin, leveraging the Spring Boot Framework, and using PostgreSQL as the primary database. Additionally, TimescaleDB is used for optimized time-series data management, facilitating efficient storage and querying of monthly statistics. The application also integrates Spring's scheduling capabilities for automated tasks such as periodic data updates and statistical aggregations.


API Endpoints Overview:

Authentication Endpoints

Register

  • Endpoint: POST /auth/register
  • Description: Registers a new user.
  • Request Body: RegistrationRequest
  • Response: AuthenticationResponse
  • HTTP Response Code: 201 (Created)

Example:

POST /auth/register
Content-Type: application/json

{
    "name": "Renato",
    "email": "[email protected]",
    "password": "password"
}

Login

  • Endpoint: POST /auth/login
  • Description: Authenticates a user.
  • Request Body: AuthenticationRequest
  • Response: AuthenticationResponse
  • HTTP Response Code: 200 (OK)

Example:

POST /auth/login
Content-Type: application/json

{
    "email": "[email protected]",
    "password": "password"
}

Budget Endpoints

Get Remaining Budget

  • Endpoint: GET /budgets/remaining
  • Description: Retrieves the remaining budget.
  • Response: RemainingBudgetDto
  • HTTP Response Code: 200 (OK)

Example:

GET /budgets/remaining

Settings Endpoints

Get Settings

  • Endpoint: GET /settings
  • Description: Retrieves user settings.
  • Response: SettingsDtoOut
  • HTTP Response Code: 200 (OK)

Example:

GET /settings

Add Settings

  • Endpoint: POST /settings
  • Description: Adds new settings.
  • Request Body: CreatingSettingsDto
  • Response: SettingsDtoOut
  • HTTP Response Code: 204 (No Content)

Example:

POST /settings
Content-Type: application/json

{
  "monthlyBudgetValue": 5000
}

Update Settings

  • Endpoint: PUT /settings
  • Description: Updates user settings.
  • Request Body: CreatingSettingsDto
  • Response: SettingsDtoOut
  • HTTP Response Code: 200 (OK)

Example:

PUT /settings
Content-Type: application/json

{
  "monthlyBudgetValue": 6000
}

Transaction Endpoints

Get All Transactions

  • Endpoint: GET /transactions
  • Description: Retrieves a paginated list of all transactions.
  • Parameters: Pageable (for pagination)
  • Response: Paginated list of TransactionOutDto
  • HTTP Response Code: 200 (OK)

Example:

GET /transactions?page=0&size=10

Get Transaction by ID

  • Endpoint: GET /transactions/{transactionId}
  • Description: Retrieves a transaction by its ID.
  • Path Variable: transactionId (Transaction ID)
  • Response: TransactionOutDto
  • HTTP Response Code: 200 (OK)

Example:

GET /transactions/<UUID>

Add Transaction

  • Endpoint: POST /transactions
  • Description: Creates a new transaction.
  • Request Body: TransactionInDto
  • Response: TransactionOutDto
  • HTTP Response Code: 204 (No Content)

Example:

POST /transactions
Content-Type: application/json

{
  "amount": -150.50,
  "category": "ENTERTAINMENT",
  "description": "Nintendo Switch Black Friday"
}

Delete Transaction by ID

  • Endpoint: DELETE /transactions/{transactionId}
  • Description: Deletes a transaction by its ID.
  • Path Variable: transactionId (Transaction ID)
  • Response: Void
  • HTTP Response Code: 204 (No Content)

Example:

DELETE /transactions/<UUID>

Get Monthly Summary

  • Endpoint: GET /transactions/summary/monthly
  • Description: Retrieves a monthly summary of transactions.
  • Parameters: category (optional)
  • Response: List of TransactionMonthlySummaryDto
  • HTTP Response Code: 200 (OK)

Example:

GET /transactions/summary/monthly?category=FOOD

About

This project is crafted in Kotlin, leveraging the Spring Boot Framework, and using PostgreSQL as the primary database. It is designed to help users manage their personal finances by allowing them to set monthly budgets, track transactions, and manage user settings. The application also integrates Spring's scheduling capabilities for automated tasks

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published