BudgetBuddyDE

Modifications

Getting started

1. Clone the repository

git clone git@github.com:BudgetBuddyDE/BudgetBuddyDE.git
cd services/pocketbase

2. Install dependencies

go mod tidy

3. Spin up instance

go run main.go serve

Dockerfile

The Dockerfile which is used to build our Pocketbase instance can be found under BudgetBuddyDE/services/pocketbase/Dockerfile.

Jobs

JobDescriptionExecute at
process-recurring-paymentsDetails can be found in the features section30 1 * * *
delete-marked-usersRetrieves all users who have been marked as “to be deleted” and are to be deleted today.30 1 * * *

Endpoints

GET /transactions/stats

The endpoint provides an overview of a user's recorded transactions for a specific date range. The overview contains information about the user's income, expenditure and account balance.

Request

Authentication

Access is restricted to authenticated users. The middleware requires authentication as an administrator or an authorized user from the users table.

Params
PropTypeDefault
startDate
Date
-
endDate
Date
-

Response

PropTypeDefault
startDate
Date
-
endDate
Date
-
balance
{current: number, estimated: number}
-
income
{received: number, upcoming: number}
-
expenses
{received: number, upcoming: number}
-
Response
{
  "startDate": "2025-03-01",
  "endDate": "2025-03-31",
  "balance": {
    "current": -510.4799999999959,
    "estimated": -560.439999999995
  },
  "income": {
    "received": 14636.77,
    "upcoming": 0
  },
  "expenses": {
    "received": 15147.249999999996,
    "upcoming": 49.96
  }
}

/transactions/budget

This endpoint provides an overview of a user's expenses, income, and available budget for a specified period.

Request

Authentication

Access is restricted to authenticated users. The middleware requires authentication as an administrator or an authorized user from the users table.

Params
PropTypeDefault
startDate
Date
-
endDate
Date
-

Response

PropTypeDefault
startDate
Date
-
endDate
Date
-
expenses
number
-
upcomingExpenses
number
-
freeAmount
number
-
Response
{
  "startDate": "2025-03-01",
  "endDate": "2025-03-31",
  "expenses": 15147.25,
  "upcomingExpenses": 49.96,
  "freeAmount": -560.44
}

/categories/stats

This endpoint provides an overview of the income and expenses of a user's recorded transactions grouped by category for a specific time period.

Request

Authentication

Access is restricted to authenticated users. The middleware requires authentication as an administrator or an authorized user from the users table.

Params
PropTypeDefault
startDate
Date
-
endDate
Date
-

Response

PropTypeDefault
startDate
Date
-
endDate
Date
-
categories
Array<{balance: number, category: {id: string, name: string}, expenses: number, income: number}>
-
Response
{
  "endDate": "2025-03-31",
  "startDate": "2025-03-01",
  "categories": [
    {
      "balance": -61.36,
      "category": {
        "id": "i795t0h2yp48ytj",
        "name": "Abonnement"
      },
      "expenses": 61.36,
      "income": 0
    }
  ]
}

On this page