Skip to content

Local setup

Twenty minutes from clone to a working instance synced with your Dropbox or OneDrive. Everything below was run on macOS with Docker Desktop; Linux is identical.

Terminal window
git clone https://github.com/damviaHQ/damvia.git
cd damvia
cd server && npm install
cd ../client && npm install

Install the server first: the client’s package.json links it as "server": "file:../server" to share the tRPC router types.

Terminal window
cd server
docker-compose up -d

This starts three containers under the project name damvia-preview:

ContainerPortCredentials
postgres (15)5432dam / dam, database dam
minio9000 API, 8090 consoledam / damdamdamdam
mailhog1025 SMTP, 8025 web UInone

Open the MinIO console at http://localhost:8090, sign in, and create two buckets: dam and dam-assets. The server does not create buckets.

Terminal window
cp .env.template .env

The template’s defaults already match the compose stack (database, MinIO, MailHog). Fill in:

  • ASSET_UPDATER and the matching DROPBOX_* or ONEDRIVE_* variables. See Dropbox or OneDrive; the refresh token or app registration is the only step that takes real time.
  • APP_SECRET: any long random string, for example openssl rand -hex 32.
  • PRODUCT_MATCHING_REGEX if your file names encode product keys; otherwise leave the example, it is harmless.

Leave MAILCONFIG empty: the server then reads server/mailconfig.json, whose templates are fine for a first run. The full list is in Environment variables.

Terminal window
npm run dev

npm run dev runs nodemon with ts-node and sets ENABLE_WORKER=true, so migrations run, the API listens on http://localhost:3000, the worker starts, and the first cloud sync begins immediately. The log shows asset updater initialized, then server listening, then Fetched N entries from Dropbox (or the OneDrive delta pages) and finally assets updated successfully. Sync repeats every 5 minutes.

Files appear in the database with status creating and are downloaded and thumbnailed by the worker in batches of 10; a large library takes a while to fill in.

In a second terminal:

Terminal window
cd client
cp .env.template .env
npm run dev

VITE_API_ENDPOINT defaults to http://localhost:3000/trpc, which is the dev server. The client is at http://localhost:5173, which is also the server’s default APP_URL, so email links work out of the box.

Sign up at http://localhost:5173/sign-up. The region dropdown offers Global, seeded by the initial migration. The verification email lands in MailHog at http://localhost:8025; click its link. The account is now verified but not approved, and has the member role. Promote it in SQL as described in First admin, reload, and the admin menu appears.

TaskCommand
Stop the services, keep the datadocker-compose stop in server/
Wipe everything and start overdocker-compose down -v in server/ (deletes the postgres and minio volumes)
Force a full consistency pass between database and MinIOnpm run cli -- check-integrity in server/
See queued and failed jobspsql postgresql://dam:dam@localhost/dam -c "select name, state, count(*) from pgboss.job group by 1,2"
Type-check the clientnpx vue-tsc --noEmit in client/