Skip to content
varianterPublic

About

Time managed

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Variant Tid.

Getting started

You need Bun (the version in .bun-version) and Docker.

az login
bun install
bun run dev

bun run dev reads the app's secrets from the dev Key Vault as you, through the Azure CLI, and keeps them in memory. You need read access to the vault. Without it, dev still starts, but features that need a secret don't work. The list of secrets is in apps/web/src/developmentSecrets.ts.

The app runs on http://localhost:3000.

Before pushing, run bun run verify. It type-checks, lints and runs the tests.

Database

Postgres runs in Docker through Testcontainers, on whatever port is free. bun run dev starts it, applies new migrations, seeds a small fixture if it's empty, and stops it again when you quit. The container is kept between runs, so your data stays.

  • bun run db:reset rebuilds the dev database from the fixture. The fixture's dates are relative to today.
  • bun run db:studio opens Drizzle Studio against the dev database.

The app connects as the role app, which can only use what migrations grant it and has statement and idle-transaction timeouts. Migrations, fixtures and schema tests run as the container's superuser. A new table, or a new kind of write to an existing one, needs a grant in its migration.

Tests get a fresh container each run, which is removed afterwards. Shutting down the dev server tears down database.

Troubleshooting

"Could not find a working container runtime strategy": Testcontainers can't find Docker. Check that Docker is running (docker info). If you use Colima, OrbStack or similar, Testcontainers doesn't read Docker contexts, so point it at the socket yourself, e.g. in your shell config:

export DOCKER_HOST=$(docker context inspect --format '{{.Endpoints.docker.Host}}')
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock

Deployment

Tid is deployed from varianter/infrastructure-as-code

About

Time managed

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages