Skip to content

Simple little personal finance app, experimenting with Bun and Solid.js

License

Notifications You must be signed in to change notification settings

binary-koan/sconet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sconet

Sconet (our "scones and tea budget") is a simple little personal finance app that lets you record your income and expenses, setup categories and budgets, and break down your spending, all in multiple currencies.

It's 🚧 super WIP and incomplete 🚧 so expect to find broken things everywhere - at the moment this is more of a testing ground for me to experiment with using Bun and SolidJS, creating a semi-custom GraphQL client and server, etc rather than something I recommend actually using!

CI Lint

Local development

Requirements

  • Bun 0.4.0 or higher
  • Node.js
  • A PostgreSQL database with pg_stat_statements and uuid-ossp extensions enabled
  1. Clone the repo
  2. Run bun install in the root
  3. Set up a CloudFlare Turnstile site and set the domain to localhost. This is required for login to work
  4. Create a api/.env file with the following content:
JWT_SECRET=<some random string to use for signing auth tokens>
USER_EMAILS=<your email, to create an initial user>
TURNSTILE_SECRET_KEY=<your turnstile secret key>
  1. Create a web/.env file with the following content:
VITE_TURNSTILE_SITEKEY=<your turnstile site key>
  1. In the api directory:
    • Run bun migrate to apply database migrations
    • Run bun seed to populate some initial data along with the user(s) in USER_EMAILS above
  2. Run bun dev to start a dev server
    • Visit http://localhost:1235 for the app itself
    • Visit http://localhost:4444/graphql to browse the API in GraphiQL
  3. Log in with the email you added in USER_EMAILS and the password changeme

Deployment

Sconet can be built as a single Docker image. The included fly.toml can be used for easy deployment to Fly.io.

To build the Docker image you will need to specify VITE_TURNSTILE_SITEKEY as a build arg, e.g.

docker build -t sconet --build-arg VITE_TURNSTILE_SITEKEY=<your site key> .

When running the image you should

  • Specify the JWT_SECRET and TURNSTILE_SECRET_KEY environment variables just like in local development
  • Mount a persistent storage volume to the /app/data path so that the database will be persisted between restarts

Backing up the database

The app will optionally back up the database to S3-compatible storage if you specify the BUCKET_ENDPOINT, BUCKET_NAME, ACCESS_KEY_ID and SECRET_KEY_ID environment variables.

Snapshots will be taken every 5 minutes if the database has changed, and only the last 3 snapshots will be stored (configure in api/src/db/backup.ts).

About

Simple little personal finance app, experimenting with Bun and Solid.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published