Skip to content
/ ngpkf Public

Scalable backend boilerplate built with NestJS, GraphQL (including GraphQL Federation), Kafka, PostgreSQL, and AdminJS.

License

Notifications You must be signed in to change notification settings

egiev/ngpkf

Repository files navigation

NGPKF

Build Status Version License: MIT

What is NGPKF?

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

Why use NGPKF?

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

Getting Started

Prerequisites

1. Clone the Repository

git clone <repository_url>
cd ngpkf

2. Configure Environment Variables

Copy 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.prod

3. Start the Application

Local Development

npm run app:start:local

Development

npm run app:start:dev

Production

npm run app:start:prod

4. Accessing Services

5. Stopping the Application

# For local
npm run app:stop:local
# For development
npm run app:stop:dev
# For production
npm run app:stop:prod

6. Database Migrations

Create a new migration:

npm run db:migrate:create

Apply migrations:

npm run db:migrate:up

7. Running Tests

npm test

Usage Examples

Run CLI Commands

Create 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

Support & Documentation


Maintainers & Contributing

  • Maintainer: Reginald Mabanta
  • License: MIT
  • Contributions: Welcome! Please see CONTRIBUTING.md for guidelines (if available).

Project Structure

├── 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
└── ...

Acknowledgements

Built with NestJS, KafkaJS, MikroORM, AdminJS, and the open source community.

About

Scalable backend boilerplate built with NestJS, GraphQL (including GraphQL Federation), Kafka, PostgreSQL, and AdminJS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published