Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/budgetingwebsite/backend
https://github.com/budgetingwebsite/backend
backend bouncycastle budgeting dropwizard java java-17 jooq rest-api sql
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/budgetingwebsite/backend
- Owner: BudgetingWebsite
- Created: 2024-09-09T13:48:50.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-26T18:37:59.000Z (4 months ago)
- Last Synced: 2024-10-12T17:23:36.748Z (4 months ago)
- Topics: backend, bouncycastle, budgeting, dropwizard, java, java-17, jooq, rest-api, sql
- Language: Java
- Homepage:
- Size: 418 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Budgeting Website Backend
This is the backend for the budgeting website. It should provide for the majority of processing and logic for the website. Users should be able to create secure accounts, store income and expense records, categorize those records into bucket, and budget their finances. Statistics should also be provided, such as net income over time.Currently, several databases are intended to be supported. They include MySQL, PostgreSQL, MariaDB, SQLite, and H2. For testing, H2 is being used.
# Technology
- Java 17
- Dropwizard
- Jooq
- SQLite JDBC
- H2 JDBC
- MySQL JDBC
- PostgreSQL JDBC
- MariaDB JDBC
- Bouncycastle
- JUnit
- Jackson
- Mybatis# Configuration
The project-specific configurations you can set in the YAML file you'll provide to the program.- `database-url ` - _the url to the database._
- `admin-username ` - _the username of the admin account to be autogenerated._
- `admin-password ` - _the password of the admin account to be autogenerated._
- `max-username-length ` - _the maximum length to allow for usernames._# Setup
The schema for initializing the database can be found at src/main/resources/schema.sql.# Endpoints
## Account
### `POST` /account/{uuid}
Creates a new account with the provided username and password.#### Consumes JSON
```
{
username: String,
password: String
}
```### `AUTH:Basic` `DELETE` /account/{username}
Delete an existing account based on the provided username. Will return 401 if the provided credentials does not correspond to an account with the admin role or is not the same account that is being deleted.### `AUTH:Basic` `PUT` /account/password
Update the password of authenticated account.#### Consumes JSON
```
{
password: String
}
```### `AUTH:Basic` `Permited:ADMIN` `PUT` /account/{username}/roles
Update the roles of the account of the provided username. The roles should be comma-delimited. They are case-sensitive. The allowed roles are USER and ADMIN.#### Consumes JSON
```
{
roles: String
}
```## Account
### `AUTH:Basic` `POST` /bucket
Create a new bucket.#### Consumes JSON
```
{
name: String,
share: Double
}
```### `AUTH:Basic` `DELETE` /bucket/{uuid}
Delete the bucket associated with the provided UUID.### `AUTH:Basic` `PUT` /bucket/{uuid}
Update the bucket associated with the provided UUID.#### Consumes JSON
```
{
name: String,
share: Double
}
```### `AUTH:Basic` `GET` /bucket
Get the authenicated user's buckets.#### Produces JSON
```
{
[
{
uuid: String,
created: LocalDateTime,
updated: LocalDateTime,
owner: String,
name: String,
share: Double,
amount: Long
},
...
]
}
```## Financial Record
### `AUTH:Basic` `POST` /record/income
Add an income record.#### Consumes JSON
```
{
amount: Integer,
year: Integer,
month: Integer,
day: Integer,
category: String,
description: String
}
```
#### Produces TEXT
```
uuid: String
```### `AUTH:Basic` `POST` /record/expense
Add an expense record.#### Consumes JSON
```
{
amount: Integer,
year: Integer,
month: Integer,
day: Integer,
category: String,
description: String,
bucket: String
}
```#### Produces TEXT
```
uuid: String
```### `AUTH:Basic` `DELETE` /record/income/{uuid}
Delete an income record.### `AUTH:Basic` `DELETE` /record/expense/{uuid}
Delete an expense record.### `AUTH:Basic` `GET` /record/income
Get income records in the time range. Month and day values start at 1. So, January 1st, 2024, would be `...startYear=2024&startMonth=1&startDay=1...`#### Consumes PARAMS
```
startYear: String
startMonth: String
startDay: String
endYear: String
endMonth: String
endDay: String
```### `AUTH:Basic` `GET` /record/expense
Get expense records in the time range. Month and day values start at 1. So, January 1st, 2024, would be `...startYear=2024&startMonth=1&startDay=1...`#### Consumes PARAMS
```
startYear: String
startMonth: String
startDay: String
endYear: String
endMonth: String
endDay: String
```### `AUTH:Basic` `PUT` /record/income/{uuid}
Update an income record.#### Consumes JSON
```
{
amount: Integer,
year: Integer,
month: Integer,
day: Integer,
category: String,
description: String
}
```### `AUTH:Basic` `PUT` /record/expense/{uuid}
Update an expense record.#### Consumes JSON
```
{
amount: Integer,
year: Integer,
month: Integer,
day: Integer,
category: String,
description: String,
bucket: String
}
```