NGPKF is a modern, scalable backend boilerplate built with NestJS, GraphQL (including GraphQL Federation), Kafka, PostgreSQL, and AdminJS. It provides a robust foundation for event-driven, microservice-ready Node.js applications, featuring:
- NestJS for modular, maintainable server-side code
- GraphQL for flexible API development
- GraphQL Federation for composing multiple GraphQL services into a unified API
- Kafka for distributed event streaming
- PostgreSQL for relational data storage
- AdminJS for instant admin panel
- MikroORM for data access
- Docker for easy local and production deployment
Key Features & Benefits:
- Rapid project bootstrap for scalable Node.js backends
- First-class GraphQL API support (including GraphQL Federation)
- Built-in support for microservices and event-driven architecture
- Out-of-the-box Docker Compose for local and prod environments
- CLI utilities for user and topic management
- Integrated admin panel (AdminJS)
- Secure authentication with JWT
- Code quality enforced by ESLint, Prettier, Husky, and Commitlint
- Ready for CI/CD and cloud deployment
- Docker
- Docker Compose
- Node.js (for local scripts)
git clone <repository_url>
cd ngpkfCopy the sample environment file and fill in your values:
# For local environment
cp .env.sample .env.local
# For development environment
cp .env.sample .env.dev
# For production environment
cp .env.sample .env.prodnpm run app:start:localnpm run app:start:devnpm run app:start:prod- API (GraphQL Playground): http://localhost:3000/graphql
- GraphQL Federation Gateway: http://localhost:3000/federation (if enabled)
- Admin Panel: http://localhost:3000/admin
- PostgreSQL:
localhost:5432 - Kafka:
localhost:9092
# For local
npm run app:stop:local
# For development
npm run app:stop:dev
# For production
npm run app:stop:prodCreate a new migration:
npm run db:migrate:createApply migrations:
npm run db:migrate:upnpm testCreate a super user via CLI:
npm run app:start:local:cli -- auth-user:create -u <email> -p <password> --super-user
npm run app:start:dev:cli -- auth-user:create -u <email> -p <password> --super-user
npm run app:start:prod:cli -- auth-user:create -u <email> -p <password> --super-user- For issues, use the repository issue tracker
- For contributing, see CONTRIBUTING.md (if available)
- For license details, see LICENSE
- Maintainer: Reginald Mabanta
- License: MIT
- Contributions: Welcome! Please see
CONTRIBUTING.mdfor guidelines (if available).
├── src/
│ ├── apis/ # API modules (HTTP, Kafka)
│ ├── command/ # CLI commands
│ ├── common/ # Shared modules/utilities
│ ├── config/ # Configuration
│ ├── infra/ # Infrastructure (db, kafka, admin)
│ ├── modules/ # Business logic modules
│ └── main.ts # App entrypoint
├── test/ # Tests
├── Dockerfile # Docker build
├── docker-compose.* # Docker Compose configs
├── .env.sample # Example environment
└── ...
Built with NestJS, KafkaJS, MikroORM, AdminJS, and the open source community.