A lightweight Node.js + Express + TypeScript backend for Servineo. It includes sane defaults for development, linting, formatting, and CI.
- TypeScript (strict) with ts-node-dev for fast reloads
- Express 5 with CORS and JSON body parsing
- Environment variables via dotenv
- ESLint (flat config) + Prettier, with VS Code format-on-save
- GitHub Actions workflow for linting and formatting on PRs/commits
- Node.js 20+
- npm 10+
- Install dependencies
npm ci
- Configure environment variables
Create a
.env
at the project root (optional — defaults are provided). You can start by copying the example file:
cp .env.example .env
SERVER_PORT=3000
- Start the dev server
npm run dev
You should see:
Server running on http://localhost:3000
Base URL: http://localhost:<SERVER_PORT>/api
- Health check
- Method: GET
- Path:
/healthy
- Response: 200
- Example:
{ "healt": "i'm alive", "status": 200, "message": "ok" }
Quick test:
curl -i http://localhost:3000/api/healthy
src/
index.ts # App entrypoint
config/
env.config.ts # Env var loading (dotenv) and defaults
server.config.ts # Express app setup (CORS, JSON, routes)
server.routes.ts # App router
modules/
health/
health.controller.ts # Health controller
health.routes.ts # Health routes
npm run dev
– Start the server with ts-node-dev (reload on changes)npm run lint
– Run ESLint over the projectnpm run lint:fix
– Fix autofixable ESLint issuesnpm run format
– Run Prettier and write changesnpm run format:check
– Check Prettier formatting without writing
- ESLint uses flat config in
eslint.config.mjs
(no .eslintrc). - Prettier is configured via
.prettierrc.json
and ignores with.prettierignore
. - VS Code users:
.vscode/settings.json
enables format-on-save using Prettier.
GitHub Actions workflow: .github/workflows/lint.yml
- Triggers on push/PR to
dev
andmain
- Node 20,
npm ci
- Runs
npm run lint
andnpm run format:check
MIT © Servineo. See LICENSE.