create-node-spark
Version:
CLI tool to scaffold a Node.js backend
539 lines (370 loc) โข 16.3 kB
Markdown
<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/**
[](https://www.npmjs.com/package/create-node-spark)
[](https://www.npmjs.com/package/create-node-spark)
[](LICENSE)
[](https://github.com/talhabilal-dev/create-node-spark)

[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

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.

**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

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!**
[](https://github.com/talhabilal-dev/create-node-spark/issues)
[](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">



</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>