Express API with Docker and CI Baseline
Set up an Express API scaffold with container and CI automation enhancements that are supported by tinkerise.
Prerequisites
Section titled “Prerequisites”- Node.js 20.11+
tinkeriseinstalled- Docker installed
Step 1: Scaffold the Express API
Section titled “Step 1: Scaffold the Express API”tinkerise backend express inventory-api --typescriptcd inventory-apiExpected result: an Express project generated by the official scaffolder flow.
Step 2: Add quality and delivery enhancements
Section titled “Step 2: Add quality and delivery enhancements”tinkerise add eslint prettier ci docker envThis adds linting, formatting, GitHub Actions CI, container files, and environment scaffolding.
Step 3: Install and validate locally
Section titled “Step 3: Install and validate locally”npm installnpm run lintnpm testExpected result: lint and test commands complete successfully for the generated baseline.
Step 4: Build and run in Docker
Section titled “Step 4: Build and run in Docker”docker build -t inventory-api .docker run --rm -p 3000:3000 inventory-apiVerify the service starts in the container and listens on the expected port.
Step 5: Prepare CI usage
Section titled “Step 5: Prepare CI usage”Push to GitHub so the generated workflow executes on pull requests.
Expected result: CI runs lint/test/build checks with the generated configuration.
Expected generated artifacts
Section titled “Expected generated artifacts”- Express app source and scripts from scaffolder
.github/workflows/ci.ymlfrom CI enhancementDockerfileand.dockerignorefrom Docker enhancement.env.exampleand related env templates from env enhancement
Next steps
Section titled “Next steps”- Add commit policy with
tinkerise add husky commitlint. - Add dependency automation with
tinkerise add renovate. - Compare runtime notes in the Express guide.