Express 5 + TS backend service template
|
Some checks failed
/ checks (push) Successful in 36s
/ deploy (push) Failing after 2s
|
||
|---|---|---|
| .forgejo | ||
| migrations | ||
| src | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .nvmrc | ||
| .prettierignore | ||
| .prettierrc.json | ||
| CLAUDE.md | ||
| commitlint.config.js | ||
| Dockerfile | ||
| eslint.config.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vitest.config.ts | ||
${REPO_NAME}
Express 5 + TypeScript backend generated from nholtware/service-template-express.
Endpoints
GET /healthzliveness, always 200 once listeningGET /readyzreadiness: PostgresSELECT 1and RedisPINGfor whichever ofDATABASE_URL/REDIS_URLare set; 503 + JSON reason otherwiseGET /service name, version (git sha), pod, aservice_inforow, Redis hit counter
Local dev
cp .env.example .env # then export the vars, or use your shell's env loader
npm ci && npm run dev
npm run lint && npm test
Env is validated at boot (src/lib/config.ts): PORT, SERVICE_NAME (required), LOG_LEVEL, DATABASE_URL?, REDIS_URL?.
Migrations: SQL files in migrations/, applied with npm run migrate.
Logs: one JSON object per line on stdout (level,time,msg,service,version, plus req.*/res.statusCode/responseTime per request).
Using this template
- Generate a repo from this template in Forgejo (public). The repo name is substituted into
package.json, this README,.env.example, the CI workflow, and the first migration. - Set 3 Actions secrets on the new repo:
REGISTRY_USER(nholtware),REGISTRY_TOKEN(registry push token),GITOPS_TOKEN(ci-bot gitops token). - Add gitops entries: render
templates/backend/(see its README) intomanifests/<app>/and addapps/<app>.yamlinnholtware/gitops. - Push to
main. Generating a repo emits no push event, so CI only starts on your first push.