Expense tracking for small groups AKA self-hosted WeShare replacement.
- Node.js (version specified in
.nvmrc
)- Use
fnm
for Node.js version management. It will automatically use the correct version of Node.js when youcd
into the project directory.
- Use
- Yarn
- Docker and Docker Compose 2+ (for local Postgres database)
- Compatible alternative (e.g. Podman) might work
- tmux is required for running integration tests in UI mode
- Copy
.env.example
to.env
and fill in the values. The defaults should work for local development. - Install dependencies:
yarn
- Start local PostgreSQL:
yarn infra:up
- Run migrations:
yarn db:migrate
- Previous step should automatically generate the database client, but if it didn't, generate it manually with
yarn db:generate-client
.
Remember to run migrations and / or generate the database client when the database schema changes.
- Start local PostgreSQL:
yarn infra:up
- Start the backend server:
yarn backend:start
- Start the frontend dev server:
yarn frontend:start
- Open http://localhost:1234 in your browser
Backend is automatically restarted on changes. Frontend will hot reload on changes.
Saituri supports integration / browser tests using Playwright. Tests require Docker Compose, because they run against a real PostgreSQL instance. Test scripts build, start and stop the necessary infrastructure automatically.
There are two different ways to run the tests:
yarn test:e2e:ci
- This runs the tests once and prints the results to the terminal. There is some overhead in starting and stopping the infrastructure, so this is better suited for CI than for local development.
yarn test:e2e:ui
- This command starts the necessary infrastructure and then Playwright in UI mode. The UI makes it easy to create and debug tests, and it supports running tests in watch mode. Backend, frontend and test code is automatically reloaded on changes, though tests are only re-run on changes to test code. The UI starts as a separate Chromium instance.
Tests are run in GitHub Actions as a part of the CI pipeline. Error traces are uploaded as artifacts, and after downloading they can be viewed using yarn playwright show-trace [filename]
.
- Run
docker compose -f saituri-compose.yaml up
- Pass
--build
to rebuild the images.
- Pass
- The server should now be running on http://localhost:3001.
- Make sure to set
HOST
andPORT
in.env
to match the production environment.
You can use /api/health
for health checks.