There are 168 hours in a week.
How would you like to spend them?
The whole idea with this app is to first breakdown how you would like to spend your time in an ideal week. Everybody needs to spend time on things like sleep, work, commute, personal care, hobbies. In this modern age it is easy to fall into time sinks like doom scrolling, lazing around, or just generally meandering and not feeling fulfilled by not spending time wisely.
Everyone needs time to relax but time is a scarce resource so why not make the most of it.
- Set up DB credentials:
cp .env.example .env
Then alter env vars as you see fit.
- Install node dependencies:
npm install
- Start app & db with docker:
npm run dev
Note: This requires port 5432
to be available to start a postgres DB docker container.
- Access the application at http://localhost:5173
The deployment/ directory provides terraform code that will provision an AWS VPC with three nodes:
- The dockerised svelte app running on an EC2 instance
- The RDS Postgres DB instance
- An EC2 tailscale subnet router bastion node
The advantage of hosting the app using tailscale means only nodes on your tailnet (vpn) will be able to access the application. For this reason, I have forgone implementing authentication.
To deploy the app to AWS follow deployment/README.md.
The following npm
scripts are probably the most useful:
npm run dev # runs the app & db docker containers
npm run format # formats the project
npm run pgcli # to access the local DB
npm run pgconf # to configure db credentials in ~/.pg_service.conf
# Requires prod env set up
npm run pull-prod # to pull data from the prod env locally
npm run reset-local-db # wipes and seeds DB locally without pulling data
To run npm run pull-prod
we require prod configured as rds
in ~/.pg_service.conf
and pg_dump
. Try npm run pgconf
.
To install pg_dump
via brew
:
brew install postgresql
Note: For convenience, you can add db credentials to ~/.pgpass
to prevent password prompts. Database connection entries are added in the following format:
hostname:port:database:username:password