A possible backend implementation for the Budget apps on Android & iOS
Find a file
William Brawner 2a7d674204 Fix monthly recurring transactions not being created when the year changes
The previous implementation only checked that at least one month had passed between the last run date and now by subtracting the ordinal values. If it were February (month 2) and the previous run date were in January (month 1), then 2 - 1 would equal 1, so it would have been one month since the previous run and we would create the recurring transaction. If it were December however (month 12), the following month would be January (month 1), and 1 - 12 would be -11, so it would appear that we had already created a transaction 11 months in the future. The new implementation also takes the year into account to avoid this situation.
2022-02-02 21:21:20 -07:00
.github/workflows Automatically deploy changes on pushes to main 2021-11-24 16:25:13 -07:00
api Bump all dependencies 2021-12-18 07:18:52 -07:00
app Fix monthly recurring transactions not being created when the year changes 2022-02-02 21:21:20 -07:00
core Bump all dependencies 2021-12-18 07:18:52 -07:00
db Bump all dependencies 2021-12-18 07:18:52 -07:00
gradle/wrapper Update gradle and kotlin versions 2021-07-05 19:05:25 -06:00
storage Bump all dependencies 2021-12-18 07:18:52 -07:00
testhelpers Bump all dependencies 2021-12-18 07:18:52 -07:00
web Bump all dependencies 2021-12-18 07:18:52 -07:00
.gitignore Remove swagger 2021-03-31 20:21:16 -07:00
build.gradle.kts Bump all dependencies 2021-12-18 07:18:52 -07:00
captain-definition Configure caprover deployments 2019-05-22 21:54:15 -07:00
docker-compose.yml WIP: Finish ktor migration 2021-08-12 15:22:06 -06:00
Dockerfile Run twigs as user instead of root in docker image 2021-12-18 07:44:01 -07:00
gradlew Migrate from JDK 8 -> 11 and use Gradle instead of Maven 2020-02-10 17:57:53 -07:00
gradlew.bat Migrate from JDK 8 -> 11 and use Gradle instead of Maven 2020-02-10 17:57:53 -07:00
LICENSE Add license 2019-10-03 15:24:43 -07:00
README.md Fix links to other projects in README 2021-12-21 21:13:16 -07:00
settings.gradle.kts WIP: Implement recurring transactions 2021-09-19 20:21:02 -06:00

Twigs Server

This is the backend application that powers the Android, iOS, and web applications for Twigs, a personal finance/budgeting app. None of these apps are complete, so expect bugs, and they are all in various stages of development, so expect some feature disparity between platforms.

Prerequisites

  • JDK 14 or newer
  • PostgreSQL 13 or newer
  • (optional) Docker

Running

Prior to running the app, make sure you have a PostgreSQL server running, with a database and user ready to go. To avoid the hassle of figuring out how to get it installed locally, using Docker is recommended, and a sample docker-compose.yml file is included in the root of the repository. If you already have a PostgreSQL server running, you can run the app from the command line with gradle:

./gradlew run

Configuration

Some parameters of Twigs can be configured via environment variables:

Environment Variable Default Value Note
TWIGS_PORT 8080 Port for web server to listen on
TWIGS_DB_HOST localhost PostgreSQL server host
TWIGS_DB_PORT 5432 PostgreSQL server port
TWIGS_DB_NAME twigs PostgreSQL database name
TWIGS_DB_USER twigs PostgreSQL database user
TWIGS_DB_PASS twigs PostgreSQL database password
TWIGS_PW_SALT Salt to use for password, generated if empty or null

Building

Building the app is also handled with gradle:

./gradlew shadowJar