JSPM

@10565/quicknode-cli

1.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q48856F
  • License MIT

A CLI tool to quickly bootstrap Node.js projects with pre-configured dependencies and clean architecture

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@10565/quicknode-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    QuickNode CLI

    NPM version npm GitHub stars

    ๐Ÿš€ A powerful CLI tool to quickly bootstrap Node.js projects with clean architecture and pre-configured dependencies.

    โœจ Features

    • TypeScript & JavaScript Support: Choose between TypeScript or JavaScript templates
    • Clean Architecture: Domain-driven design with clear separation of concerns
    • Pre-configured Dependencies: All essential tools ready to use
    • Multiple Database Support: PostgreSQL (TypeORM) and MongoDB (Mongoose)
    • API Documentation: Swagger/OpenAPI 3.0 integration
    • Security & Validation: Helmet, express-validator, and class-validator
    • Testing Setup: Jest with extended matchers and coverage
    • Code Quality: ESLint, Prettier, and Husky pre-commit hooks
    • Development Tools: Hot reload with ts-node-dev/nodemon
    • Logging: Structured logging with Pino

    ๐Ÿ“ฆ Installation

    Install the CLI globally:

    npm install -g @10565/quicknode-cli

    Alternatively, you can run it without a global installation using npx:

    npx @10565/quicknode-cli create my-awesome-app

    ๐ŸŽฏ Usage

    Create a new project

    If you have installed the CLI globally, you can use the qn command directly.

    # Create a new project in a new directory
    qn create my-awesome-app
    
    # Create a project in the current directory
    qn create .
    
    # Interactive mode (will prompt for options)
    qn create

    Command Options

    # Use TypeScript template (default)
    qn create my-app --typescript
    
    # Use JavaScript template
    qn create my-app --javascript

    ๐Ÿ—๏ธ What's Included

    Dependencies

    • Express.js: Web framework
    • Helmet: Security middleware
    • Dotenv: Environment variable management
    • Express-validator: Request validation
    • Pino: Structured logging
    • Swagger: API documentation
    • TypeORM: PostgreSQL ORM (TypeScript template)
    • Mongoose: MongoDB ODM
    • Class-transformer & Class-validator: DTO validation (TypeScript)

    Development Dependencies

    • TypeScript: Type checking (TypeScript template)
    • ts-node-dev: Development server with hot reload (TypeScript)
    • Nodemon: Development server with hot reload (JavaScript)
    • Jest: Testing framework
    • Jest-extended: Additional Jest matchers
    • ESLint: Code linting
    • Prettier: Code formatting
    • Husky: Git hooks
    • Commitlint: Conventional commits

    Pre-configured Scripts

    {
      "dev": "Start development server",
      "build": "Build TypeScript to JavaScript (TypeScript only)",
      "start": "Start production server",
      "test": "Run tests",
      "test:watch": "Run tests in watch mode",
      "test:coverage": "Run tests with coverage",
      "lint": "Lint code",
      "lint:fix": "Lint and fix code",
      "format": "Format code with Prettier"
    }

    ๐Ÿ›๏ธ Clean Architecture Structure

    src/
    โ”œโ”€โ”€ domain/                 # Domain layer (business logic)
    โ”‚   โ”œโ”€โ”€ entities/          # Domain entities
    โ”‚   โ”œโ”€โ”€ repositories/      # Repository interfaces
    โ”‚   โ””โ”€โ”€ use-cases/         # Application use cases
    โ”œโ”€โ”€ infrastructure/        # Infrastructure layer
    โ”‚   โ”œโ”€โ”€ controllers/       # HTTP controllers
    โ”‚   โ”œโ”€โ”€ database/          # Database configuration
    โ”‚   โ”‚   โ”œโ”€โ”€ entities/      # TypeORM entities (TypeScript)
    โ”‚   โ”‚   โ”œโ”€โ”€ models/        # Mongoose models
    โ”‚   โ”‚   โ””โ”€โ”€ repositories/  # Repository implementations
    โ”‚   โ”œโ”€โ”€ docs/             # API documentation setup
    โ”‚   โ”œโ”€โ”€ logging/          # Logging configuration
    โ”‚   โ”œโ”€โ”€ middleware/       # Express middleware
    โ”‚   โ””โ”€โ”€ routes/           # Route definitions
    โ””โ”€โ”€ server.ts/js          # Application entry point

    ๐Ÿš€ Quick Start

    After creating your project:

    1. Navigate to your project:

      cd my-awesome-app
    2. Install dependencies:

      npm install
    3. Copy environment variables:

      cp .env.example .env
    4. Update environment variables in .env:

      DATABASE_URL=postgresql://username:password@localhost:5432/your_db
      MONGO_URL=mongodb://localhost:27017/your_db
      PORT=3000
      JWT_SECRET=your-secret-key
    5. Start development server:

      npm run dev
    6. Visit your API:

    ๐Ÿ“Š Database Setup

    PostgreSQL (TypeScript template)

    1. Install PostgreSQL
    2. Create a database
    3. Update DATABASE_URL in .env
    4. Run migrations: npm run db:migrate (TypeScript only)

    MongoDB

    1. Install MongoDB
    2. Update MONGO_URL in .env
    3. Connection is automatic

    ๐Ÿงช Testing

    The template includes a complete testing setup:

    • Unit tests for use cases and entities
    • Integration tests for API endpoints
    • Coverage reports with detailed metrics
    • Jest extended for additional matchers

    Run tests:

    npm test              # Run all tests
    npm run test:watch    # Watch mode
    npm run test:coverage # With coverage

    ๐Ÿ”ง Code Quality

    ESLint & Prettier

    Code quality is ensured with ESLint and Prettier:

    npm run lint          # Check for issues
    npm run lint:fix      # Fix issues automatically
    npm run format        # Format code

    Git Hooks

    Pre-commit hooks automatically:

    • Lint and fix code
    • Format code
    • Validate commit messages (conventional commits)

    Conventional Commits

    Commit format: type(scope): description

    Types: feat, fix, docs, style, refactor, test, chore

    Examples:

    • feat: add user authentication
    • fix: resolve database connection issue
    • docs: update API documentation

    ๐ŸŒŸ Example API

    The template includes a complete User API with:

    • Create user (POST /api/v1/users)
    • Get all users (GET /api/v1/users)
    • Get user by ID (GET /api/v1/users/:id)
    • Update user (PUT /api/v1/users/:id)
    • Delete user (DELETE /api/v1/users/:id)

    All endpoints include:

    • Input validation
    • Error handling
    • Swagger documentation
    • Clean architecture implementation

    ๐Ÿค Contributing

    1. Fork the repository
    2. Create a feature branch: git checkout -b feature/amazing-feature
    3. Commit changes: git commit -m '''feat: add amazing feature'''
    4. Push to branch: git push origin feature/amazing-feature
    5. Open a Pull Request

    ๐Ÿ“„ License

    This project is licensed under the MIT License - see the LICENSE file for details.

    ๐Ÿ™ Acknowledgments

    • Built with modern Node.js best practices
    • Inspired by clean architecture principles
    • Designed for developer productivity

    ๐Ÿ“ž Support

    If you have any questions or issues:

    1. Check the GitHub Issues
    2. Create a new issue if needed
    3. Contribute to make it better!

    โ˜• Buy us a Coffee


    Happy coding! ๐ŸŽ‰