UNPKG

create-node-spark

Version:
539 lines (370 loc) โ€ข 16.3 kB
<div align="center"> # ๐Ÿš€ create-node-spark ### The fastest way to scaffold production-ready Node.js backends **Zero configuration โ€ข TypeScript ready โ€ข Multiple databases โ€ข Developer-friendly** **https://talhabilal-dev.github.io/create-node-spark.github.io/** [![npm version](https://img.shields.io/npm/v/create-node-spark?style=flat-square&color=00d8ff)](https://www.npmjs.com/package/create-node-spark) [![npm downloads](https://img.shields.io/npm/dm/create-node-spark?style=flat-square&color=00d8ff)](https://www.npmjs.com/package/create-node-spark) [![license](https://img.shields.io/github/license/talhabilal-dev/create-node-spark?style=flat-square&color=00d8ff)](LICENSE) [![GitHub stars](https://img.shields.io/github/stars/talhabilal-dev/create-node-spark?style=flat-square&color=00d8ff)](https://github.com/talhabilal-dev/create-node-spark) ![CreateNodeSpark Demo](https://res.cloudinary.com/dvdktrhsz/image/upload/v1755154754/2025-08-1410-59-54-ezgif.com-video-to-gif-converter_afyoyo.gif) [Quick Start](#-quick-start) โ€ข [Features](#-features) โ€ข [Documentation](#-documentation) โ€ข [Contributing](#-contributing) </div> --- ## ๐ŸŽ‰ Exciting News: Phase 2 Development Has Begun > **We're thrilled to announce that Phase 2 development is now underway!** Phase 1 has been successfully completed with all core features implemented. Phase 2 brings exciting new capabilities including **PostgreSQL + Prisma integration**, **Fastify framework support**, and **enhanced project customization**. Stay tuned for groundbreaking updates! --- ## โœจ What is create-node-spark? **create-node-spark** is a powerful, developer-focused CLI tool that eliminates the tedious setup process for Node.js backend projects. Inspired by industry leaders like Create React App and Vite, it provides instant scaffolding for production-ready REST APIs with modern best practices built-in. Whether you're a **beginner seeking guidance** or a **seasoned developer avoiding repetitive setup**, create-node-spark gets you coding in seconds, not hours. ### ๐ŸŽฏ Perfect For - ๐Ÿš€ **Rapid prototyping** and MVP development - ๐Ÿ‘จโ€๐Ÿ’ป **Solo developers** and small teams - ๐Ÿข **Enterprise teams** needing consistent project structure - ๐Ÿ“š **Learning projects** with industry-standard setup - ๐Ÿ”„ **API-first development** workflows ## ๐Ÿš€ Quick Start Get up and running in under 30 seconds: ```bash # Using npx (recommended - always latest version) npx create-node-spark@latest # Or install globally npm install -g create-node-spark create-node-spark ``` **That's it!** Follow the interactive prompts and you'll have a fully configured backend ready for development. ## โœจ Features <table> <tr> <td width="50%"> ### ๐Ÿ› ๏ธ **Core Capabilities** - **Language Choice**: JavaScript or TypeScript - **Package Manager**: npm or pnpm support - **Modern ES Modules**: No CommonJS legacy - **Framework Ready**: Express.js & Fastify pre-configured - **Database Integration**: MongoDB, MySQL & PostgreSQL support - **Modern ORM**: Prisma integration for PostgreSQL - **File Uploads**: Optional Multer configuration </td> <td width="50%"> ### ๐Ÿ”ง **Developer Experience** - **Smart ESLint**: Balanced rules for productivity - **Prettier Integration**: Consistent code formatting - **Environment Setup**: `.env` configuration ready - **Organized Structure**: Professional folder layout - **Zero Dependencies**: Lightweight and fast - **Directory Safety**: Prevents accidental overwrites </td> </tr> </table> ## ๐Ÿ“ฆ Installation Methods <details> <summary><strong>๐Ÿ“ฑ Method 1: NPX (Recommended)</strong></summary> ```bash npx create-node-spark@latest ``` โœ… Always uses the latest version โœ… No global installation required โœ… Perfect for one-time usage </details> <details> <summary><strong>๐ŸŒ Method 2: Global Installation</strong></summary> ```bash npm install -g create-node-spark create-node-spark ``` โœ… Available from anywhere โœ… Faster subsequent usage โœ… Ideal for frequent use </details> <details> <summary><strong>๐Ÿ”ง Method 3: Development Setup</strong></summary> ```bash git clone https://github.com/talhabilal-dev/create-node-spark.git cd create-node-spark npm install npm link ``` โœ… Full source code access โœ… Contributing ready โœ… Latest development features </details> ## ๐ŸŽฎ Interactive Setup Process ![CreateNodeSpark Demo](https://res.cloudinary.com/dvdktrhsz/image/upload/v1755154752/img1_puiryt.png) The CLI guides you through a seamless setup process: 1. **๐Ÿ“ Project Name**: Choose your project identifier 2. **๐Ÿ“ฆ Package Manager**: Select npm or pnpm 3. **๐Ÿ’ป Language**: JavaScript or TypeScript 4. **๐Ÿš€ Framework**: Express.js, Fastify, or vanilla Node.js 5. **๐Ÿ—„๏ธ Database**: MongoDB, MySQL, PostgreSQL, or none 6. **โš™๏ธ Features**: ESLint, Multer, and more ## ๐Ÿ“ Generated Project Structure # ๐Ÿ› ๏ธ Introduction > โšก Spark your Node.js backend, skip the boilerplate. ![CreateNodeSpark Demo](https://res.cloudinary.com/dvdktrhsz/image/upload/v1755154754/2025-08-1410-59-54-ezgif.com-video-to-gif-converter_afyoyo.gif) **create-node-spark** is a powerful CLI (Command Line Interface) tool designed to scaffold production-ready Node.js backend projects with ease. Inspired by tools like Create Next App and Vite, this tool removes the boilerplate pain by generating a clean, structured, and configurable Node.js project โ€” so you can focus on building features, not setting up folders and configs. Whether youโ€™re a beginner wanting a head start or a seasoned developer tired of setting up the same repetitive structure, create-node-spark helps you spark your next backend project in seconds. # โ“ What is Create-Node-Spark? create-node-spark is a flexible scaffolding tool built specifically for Node.js backend projects, focusing on REST API development. Hereโ€™s what it sets up for you under the hood: - โœ… Choose between JavaScript or TypeScript at scaffold time - โœ… Uses modern ESM (ECMAScript Modules) โ€” no old CommonJS clutter - โœ… Built on Express.js & Fastify, popular and battle-tested Node.js frameworks - โœ… Pre-configured for MongoDB integration with Mongoose - โœ… Pre-configured for MySQL integration with Knex.js and mysql2 - โœ… Pre-configured for PostgreSQL integration with Prisma ORM - โœ… Sets up environment variables (.env) out of the box - โœ… Includes an optional Multer setup to handle file uploads - โœ… Includes an optional ESLint setup to keep your codebase clean and consistent - โœ… Depends only on Inquirer (for CLI prompts) โ€” keeping external dependencies light and minimal ## ๐Ÿ“ Generated Project Structure ![CreateNodeSpark Demo](https://res.cloudinary.com/dvdktrhsz/image/upload/v1746865259/create-node-spark/sk1h7rrj0cynfgcshtcc.png) Every project follows a professional, scalable structure: ``` my-awesome-api/ โ”œโ”€โ”€ ๐Ÿ“ public/ # Static assets โ”‚ โ”œโ”€โ”€ css/ # Stylesheets โ”‚ โ”œโ”€โ”€ js/ # Client-side scripts โ”‚ โ”œโ”€โ”€ images/ # Image assets โ”‚ โ””โ”€โ”€ temp/ # Temporary files โ”œโ”€โ”€ ๐Ÿ“ src/ # Source code โ”‚ โ”œโ”€โ”€ config/ # Configuration files โ”‚ โ”œโ”€โ”€ controllers/ # Route handlers & business logic โ”‚ โ”œโ”€โ”€ middlewares/ # Custom middleware functions โ”‚ โ”œโ”€โ”€ models/ # Database models (Mongoose/Knex) โ”‚ โ”œโ”€โ”€ routes/ # API route definitions โ”‚ โ”œโ”€โ”€ services/ # Business logic services โ”‚ โ”œโ”€โ”€ utils/ # Utility functions โ”‚ โ””โ”€โ”€ index.js/.ts # Application entry point โ”œโ”€โ”€ ๐Ÿ“„ package.json # Dependencies & scripts โ”œโ”€โ”€ ๐Ÿ“„ .env # Environment variables โ”œโ”€โ”€ ๐Ÿ“„ .eslintrc.js # Code quality rules (if enabled) โ”œโ”€โ”€ ๐Ÿ“„ .prettierrc # Code formatting (if enabled) โ””โ”€โ”€ ๐Ÿ“„ README.md # Project documentation ``` ## ๐Ÿ—„๏ธ Database Integration Options <table> <tr> <td width="50%"> ### ๐Ÿƒ **MongoDB + Mongoose** - Pre-configured connection setup - Schema models ready to use - Async/await best practices - Error handling included </td> <td width="50%"> ### ๏ฟฝ **PostgreSQL + Prisma** - Modern ORM with type safety - Auto-generated client and types - Migration support ready - Advanced querying capabilities </td> <td width="50%"> ### ๏ฟฝ๐Ÿฌ **MySQL + Knex.js** - Query builder configured - Migration support ready - Connection pooling setup - SQL best practices included </td> </tr> </table> ## ๐Ÿ›ฃ๏ธ Development Roadmap <div align="center"> ### โœ… **Phase 1 - COMPLETED** *Foundation & Core Features* </div> - โœ… **Multi-language Support**: JavaScript & TypeScript - โœ… **Package Manager Choice**: npm & pnpm - โœ… **Framework Integration**: Express.js & Fastify - โœ… **Database Support**: MongoDB, MySQL & PostgreSQL - โœ… **Developer Tools**: ESLint & Prettier - โœ… **File Handling**: Multer integration - โœ… **Modern Standards**: ESM modules - โœ… **Environment Setup**: Automatic .env configuration <div align="center"> ### ๐Ÿšง **Phase 2 - IN PROGRESS** *Advanced Features & Expansion* </div> - โœ… **PostgreSQL Integration**: Prisma ORM support - โœ… **Fastify Framework**: High-performance alternative - ๐Ÿ”„ **Enhanced Customization**: Granular folder structure control - ๐Ÿ”„ **Template System**: Pre-built project templates - ๐Ÿ”„ **Testing Setup**: Automated test configuration <div align="center"> ### ๐Ÿ”ฎ **Phase 3 - PLANNED** *Enterprise & Advanced Features* </div> - ๐Ÿ“‹ **GraphQL Support**: Complete GraphQL API scaffolding - ๐Ÿณ **Docker Integration**: Containerization out-of-the-box - ๐Ÿ”„ **CI/CD Templates**: GitHub Actions & deployment configs - ๐Ÿ”Œ **Plugin System**: Extensible architecture - ๐Ÿ—๏ธ **Project Templates**: Industry-specific starter templates ## ๐Ÿš€ Why Choose create-node-spark? <table> <tr> <td width="33%"> ### โšก **Speed** Get from idea to coding in under 30 seconds. No more hours spent on project setup. </td> <td width="33%"> ### ๐ŸŽฏ **Focused** Built specifically for Node.js backend development with modern best practices. </td> <td width="33%"> ### ๐Ÿ”ง **Flexible** Choose your stack: TypeScript/JavaScript, npm/pnpm, MongoDB/MySQL. </td> </tr> <tr> <td width="33%"> ### ๐Ÿ“ฆ **Lightweight** Minimal dependencies keep your projects fast and maintainable. </td> <td width="33%"> ### ๐Ÿ—๏ธ **Production-Ready** Professional folder structure and configurations from day one. </td> <td width="33%"> ### ๐ŸŒฑ **Future-Proof** Regular updates and new features based on community feedback. </td> </tr> </table> ## ๐Ÿ“– Documentation ### Quick Examples <details> <summary><strong>๐Ÿš€ Create a TypeScript API with MongoDB</strong></summary> ```bash npx create-node-spark@latest # Select: TypeScript โ†’ Express โ†’ MongoDB โ†’ ESLint cd my-api npm run dev ``` Your API is now running with TypeScript, MongoDB connection, and ESLint configured! </details> <details> <summary><strong>๐Ÿ˜ Create a PostgreSQL API with Prisma</strong></summary> ```bash npx create-node-spark@latest # Select: TypeScript โ†’ Express/Fastify โ†’ PostgreSQL โ†’ ESLint cd my-api npm run dev ``` Get a modern API with PostgreSQL, Prisma ORM, and full type safety! </details> <details> <summary><strong>โšก Create a Fastify API with TypeScript</strong></summary> ```bash npx create-node-spark@latest my-fast-api --lang ts --framework fastify --db postgresql --yes cd my-fast-api npm run dev ``` Experience blazing-fast performance with Fastify and TypeScript! </details> <details> <summary><strong>โšก Create a JavaScript API with MySQL</strong></summary> ```bash npx create-node-spark@latest # Select: JavaScript โ†’ Express โ†’ MySQL โ†’ Skip ESLint cd my-api npm start ``` Perfect for rapid prototyping with MySQL database integration! </details> <details> <summary><strong>๐Ÿ› ๏ธ Create a minimal Node.js server</strong></summary> ```bash npx create-node-spark@latest # Select: JavaScript โ†’ None โ†’ No Database โ†’ Skip all features cd my-server npm start ``` Clean Node.js HTTP server ready for custom implementation! </details> ### Available Scripts Every generated project includes these npm scripts: ```bash npm start # Start the production server npm run dev # Start development server with auto-reload npm run build # Build TypeScript to JavaScript (TS projects) npm run lint # Check code quality with ESLint npm run lint:fix # Auto-fix ESLint issues npm run format # Format code with Prettier ``` ## ๐Ÿค Contributing We welcome contributions from developers of all skill levels! Here's how you can help make create-node-spark even better: ### ๐ŸŽฏ **Ways to Contribute** - ๐Ÿ› **Bug Reports**: Found an issue? Let us know! - โœจ **Feature Requests**: Have ideas? We'd love to hear them! - ๐Ÿ“ **Documentation**: Help improve our guides and examples - ๐Ÿ’ป **Code Contributions**: Submit PRs for new features or fixes - ๐Ÿงช **Testing**: Help us test new features and report feedback ### ๐Ÿš€ **Quick Contribution Setup** ```bash # 1. Fork & clone the repository git clone https://github.com/talhabilal-dev/create-node-spark.git cd create-node-spark # 2. Install dependencies npm install # 3. Create a feature branch git checkout -b feature/amazing-feature # 4. Make your changes and test npm run build npm start # 5. Submit a pull request git add . git commit -m "Add amazing feature" git push origin feature/amazing-feature ``` ### ๐Ÿ’ก **Contribution Guidelines** - โœ… Follow the existing code style and structure - โœ… Write clear, descriptive commit messages - โœ… Test your changes thoroughly - โœ… Update documentation if needed - โœ… Be respectful and collaborative ## ๐ŸŒŸ Community & Support <div align="center"> **Join our growing community of developers!** [![GitHub Issues](https://img.shields.io/github/issues/talhabilal-dev/create-node-spark?style=flat-square)](https://github.com/talhabilal-dev/create-node-spark/issues) [![GitHub Discussions](https://img.shields.io/github/discussions/talhabilal-dev/create-node-spark?style=flat-square)](https://github.com/talhabilal-dev/create-node-spark/discussions) ๐Ÿ“ง **Email**: [contact@talhabilal.dev](mailto:contact@talhabilal.dev) ๐Ÿ› **Issues**: [GitHub Issues](https://github.com/talhabilal-dev/create-node-spark/issues) ๐Ÿ’ฌ **Discussions**: [GitHub Discussions](https://github.com/talhabilal-dev/create-node-spark/discussions) </div> ### ๐Ÿ“Š **Project Stats** <div align="center"> ![GitHub stars](https://img.shields.io/github/stars/talhabilal-dev/create-node-spark?style=social) ![GitHub forks](https://img.shields.io/github/forks/talhabilal-dev/create-node-spark?style=social) ![GitHub watchers](https://img.shields.io/github/watchers/talhabilal-dev/create-node-spark?style=social) </div> ## ๐Ÿ™ Acknowledgments This project is built with love and powered by these amazing technologies: <table> <tr> <td align="center" width="20%"> <img src="https://nodejs.org/static/images/logo.svg" alt="Node.js" width="50"><br> <strong>Node.js</strong><br> <em>Runtime Engine</em> </td> <td align="center" width="20%"> <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/typescript/typescript.png" alt="TypeScript" width="50"><br> <strong>TypeScript</strong><br> <em>Type Safety</em> </td> <td align="center" width="20%"> <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/mongodb/mongodb.png" alt="MongoDB" width="50"><br> <strong>MongoDB</strong><br> <em>Database</em> </td> <td align="center" width="20%"> <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/mysql/mysql.png" alt="MySQL" width="50"><br> <strong>MySQL</strong><br> <em>Database</em> </td> <td align="center" width="20%"> <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/postgresql/postgresql.png" alt="PostgreSQL" width="50"><br> <strong>PostgreSQL</strong><br> <em>Database</em> </td> </tr> </table>