Development
This guide is a procedure. It shows how to set up a local environment for Leap.
Prerequisites
Section titled “Prerequisites”- Docker and Docker Compose.
just.- Go 1.25+.
- Node 22+.
- pnpm.
First-time setup
Section titled “First-time setup”-
Clone the repository.
-
Start the development stack:
Terminal window just devThe command starts PostgreSQL and pgweb in Docker, the Go backend on
:9000, and the Vite dev server on:5173. The first run installs the frontend dependencies. -
Open
http://localhost:5173in a browser. -
Log in with
admin@admin.comand the passwordadmin.
Press Ctrl+C to stop the processes and remove the containers.
The development stack uses the committed
config.dev.toml. It carries fixed development credentials and a development JWT secret. Production validation rejects these values.
Run modes
Section titled “Run modes”just dev starts every service in one terminal. You can also start the parts separately:
| Command | Services |
|---|---|
just dev |
PostgreSQL, pgweb, backend, frontend |
just backend |
PostgreSQL, pgweb, backend |
just frontend |
Vite dev server only (proxies /api to :9000) |
just dev-db |
PostgreSQL and pgweb, detached |
The development ports:
| Service | URL |
|---|---|
| Leap application | http://localhost:9000 |
| Vite dev server | http://localhost:5173 |
| pgweb (database browser) | http://localhost:8081 |
| PostgreSQL | localhost:5432 |
Tests and lint
Section titled “Tests and lint”just testruns the Go tests with a coverage report.just test-raceadds the race detector. The command needs a C compiler.just test-frontendruns the Vue component tests with Vitest.just checkruns format, vet, lint, and tests.just fmt vet lintruns the individual checks.
just build builds the frontend, then the Go binary, and packs the frontend and the migrations into the binary with stuffbin. The result is bin/crm.
just build-uibuilds the frontend only.just build-backendbuilds the binary and packs the assets.
Database
Section titled “Database”The migrations run at the server startup, and they are idempotent. A restart is safe.
The development database runs in Docker with these values:
- host:
localhost - port:
5432 - user:
crm - password:
crm - database:
crm
Use pgweb at http://localhost:8081 to browse the tables.
Docker helpers
Section titled “Docker helpers”just docker-upstarts the development stack in Docker: the application, PostgreSQL, and pgweb.just docker-downstops the stack.just docker-resetstops the stack and removes the database volume.just docker-rebuildrebuilds the image and starts the stack.
CAUTION:
just docker-reseterases all data in the development database.
