Skip to content

Local Development Blueprint

This guide provides the "Happy Path" for bootstrapping and running your generated project locally. Each configuration matches the instructions found in the generated README.md.

PREREQUISITES

Before starting, ensure you have the following installed:

  • Node.js (v18+)
  • Docker & Docker Compose (for infrastructure like Databases, Redis, and Kafka)

The 7-Step Development Flow

To ensure your microservice is production-ready, follow this standard sequence:

StepGoalActionWhy?
Step 1Initialize Gitgit initEnables Husky hooks and security gates.
Step 2Install Depsnpm install (or pnpm, yarn)Downloads core project dependencies.
Step 3Setup Envcp .env.example .envConfigures local environment variables.
Step 4Launch Infradocker-compose up -dStarts DB, Redis, and Kafka in background.
Step 5Run Devnpm run dev (or pnpm, yarn)Launches the app in hot-reload mode.
Step 6Quality Gatenpm testVerifies code quality and unit tests.
Step 7Ship projectnpm run deployBuilds and deploys via PM2/Cluster mode.

Detailed Setup

1. Environment Configuration

Copy the example environment file and adjust values:

bash
cp .env.example .env

2. Infrastructure & App Launch

Choose the infrastructure setup that matches your generated project:

Full Stack (DB + Redis + Kafka)

bash
# Initialize repository
git init && npm install

# Start all infrastructure
docker-compose up -d db redis kafka

# Start the application
npm run dev
bash
git init && pnpm install
docker-compose up -d db redis kafka
pnpm dev
bash
git init && yarn install
docker-compose up -d db redis kafka
yarn dev

Full Stack + ELK (Optional)

bash
git init && npm install
docker-compose up -d db redis kafka
docker-compose -f docker-compose.elk.yml up -d
npm run dev
bash
git init && pnpm install
docker-compose up -d db redis kafka
docker-compose -f docker-compose.elk.yml up -d
pnpm dev
bash
git init && yarn install
docker-compose up -d db redis kafka
docker-compose -f docker-compose.elk.yml up -d
yarn dev

REST + MongoDB

bash
git init && npm install
docker-compose up -d db
npm run dev
bash
git init && pnpm install
docker-compose up -d db
pnpm dev
bash
git init && yarn install
docker-compose up -d db
yarn dev

GraphQL + Redis

bash
git init && npm install
docker-compose up -d db redis
npm run dev
bash
git init && pnpm install
docker-compose up -d db redis
pnpm dev
bash
git init && yarn install
docker-compose up -d db redis
yarn dev

Minimal (No DB)

bash
git init && npm install
npm run dev
bash
git init && pnpm install
pnpm dev
bash
git init && yarn install
yarn dev

PRO TIP

Running docker-compose up -d without specifying services will start all infrastructure defined in your docker-compose.yml.

Released under the ISC License.
Architected by Technical Writers on System Weakness. NPM Downloads GitHub Stars