Installation
Prerequisites
Section titled “Prerequisites”| Tool | Version | Why |
|---|---|---|
| Go | 1.26+ | Required at runtime and build time. The installer checks for it. |
| Node.js | 20+ | Vite dev server and frontend build. The create-laju-go installer requires Node ≥ 20. |
| Git | any | The installer clones the template via degit. |
| C compiler | GCC / Clang | SQLite uses go-sqlite3, which is CGO-based. macOS has Clang via Xcode CLT; Linux needs build-essential or gcc. |
A package manager (npm, yarn, or bun) is also needed for the frontend. The installer detects what you have and asks which to use.
Installing the prerequisites
Section titled “Installing the prerequisites”brew install go node gitxcode-select --install # provides Clang for CGOsudo apt install golang-go nodejs npm git build-essentialVerify everything is on PATH:
go version # go1.26.xnode --version # v20.x or newergit --versionOption A — The installer (recommended)
Section titled “Option A — The installer (recommended)”npm create laju-go@latest scaffolds a fresh project from the template. It clones the repo, strips dev-only files (the installer itself, AGENTS.md, site/, agent configs), keeps the useful .llm-wiki/concepts and entities, installs Go and Node dependencies, and copies .env.example to .env.
npm create laju-go@latest my-appThe installer clones the template, strips dev-only files, installs Go and Node.js dependencies, and creates .env from .env.example. Then it prints the next steps:
cd my-appnpm run dev:allThat’s it. Open http://localhost:8080.
What gets stripped
Section titled “What gets stripped”These repo-internal artifacts do not belong in a fresh scaffold and are removed automatically:
create-laju-go/— the installer itselfAGENTS.md,.mcp.json— agent instructions and MCP config.devin/,.windsurf/,.zero/,.pi/— agent skill and rule directoriessite/— this documentation site.llm-wiki/sources,.llm-wiki/meta,.llm-wiki/raw— session logs and regenerable metadata
The .llm-wiki/wiki/concepts and entities directories are kept — they document the repo’s architecture and are useful for understanding what you just cloned.
Option B — Run from a repo clone
Section titled “Option B — Run from a repo clone”If you want the full repo (docs, agent configs, installer source):
git clone https://github.com/maulanashalihin/laju-go.gitcd laju-gomake setupmake setup does three things:
setup: @test -f .env || cp .env.example .env go mod tidy go mod download npm installThen start the dev servers:
npm run dev:allScripts
Section titled “Scripts”Laju Go ships both npm scripts and a Makefile. They overlap — pick whichever you prefer.
npm scripts
Section titled “npm scripts”| Script | What it does |
|---|---|
npm run dev |
Vite dev server only (frontend, port 5173) |
npm run dev:go |
Air live-reload for the Go backend only (port 8080) |
npm run dev:all |
Both, concurrently — the normal dev command |
npm run build |
vite build — compiles frontend to dist/ |
npm run build:go |
go build -o laju-go ./cmd/laju-go |
npm run build:all |
vite build && go build — full production build |
npm run build:linux |
Cross-compile a Linux amd64 binary via cross-env |
npm run serve |
go run ./cmd/laju-go — run without building a binary |
npm run db:generate |
sqlc generate — regenerate app/queries/ from queries/*.sql |
npm run db:migrate |
Run Goose migrations up |
npm run db:migrate:status |
Show migration status |
npm run db:migrate:down |
Roll back the last migration |
npm run db:migrate:create |
Create a new migration file |
npm run db:refresh |
Delete the SQLite DB and cache — fresh slate |
npm run verify |
templ generate && vite build && go build && go vet && go test — the full pre-push check |
Make targets
Section titled “Make targets”| Target | Equivalent |
|---|---|
make setup |
Copy .env, go mod tidy/download, npm install |
make build |
vite build then go build |
make build-go |
go build only |
make build-linux |
Cross-compile Linux amd64 (with -trimpath and version ldflags) |
make test |
go test ./... |
make lint |
golangci-lint run ./... |
make generate |
templ generate && sqlc generate |
make templ |
templ generate |
make db-generate |
sqlc generate |
make migrate |
Run Goose migrations up |
make db-refresh |
Delete the DB and cache |
make clean |
Remove binary, tmp/, dist/, DB files |
make docker |
docker build -t laju-go . |
make version |
Print the current version + commit |
Build order matters
Section titled “Build order matters”# Correct — Vite first, then Gonpm run build:all
# The Go binary reads dist/.vite/manifest.json at runtime.# If you build Go before Vite, the manifest is stale or missing.The build:all and make build targets handle this ordering for you. If you ever run the steps manually, always run vite build before go build.
Configuration
Section titled “Configuration”All config lives in .env, copied from .env.example during setup. The key variables:
APP_PORT=8080APP_ENV=developmentAPP_URL=http://localhost:8080
DB_PATH=./data/app.db
SESSION_SECRET=change-this-in-productionSESSION_TTL=24h
ALLOWED_ORIGINS=http://localhost:5173FRONTEND_URL=http://localhost:5173
# Optional — leave empty to disableGOOGLE_CLIENT_ID=GOOGLE_CLIENT_SECRET=SMTP_HOST=smtp.gmail.comGoogle OAuth and SMTP are optional — leave them blank and those features simply don’t activate. See Configuration for the full list.
Verifying the install
Section titled “Verifying the install”Run the full check to confirm everything compiles and tests pass:
npm run verifyThis runs templ generate, vite build, go build, go vet, and go test ./.... If it passes, your install is good.
Next steps
Section titled “Next steps”- Building with AI agents — the repo conventions that keep generated code correct
- Architecture overview — how requests flow through the layers