An open API service indexing awesome lists of open source software.

https://github.com/parthamk/clijs

Full-Stack Project setup with just one command
https://github.com/parthamk/clijs

Last synced: 6 months ago
JSON representation

Full-Stack Project setup with just one command

Awesome Lists containing this project

README

          

# ๐Ÿš€ Full-Stack Project setup with just one command (cli.js)


NodeJS CLI
Frontend
Backend
Database


A **Node.js CLI tool** ๐Ÿ› ๏ธ that auto-generates a **full-stack project boilerplate** with your choice of **ReactJS or Vite for Frontend** and **Express.js (with SQL or MongoDB) for Backend**.
This saves you hours of repetitive manual setup and lets you start **coding right away** ๐Ÿš€

---

## ๐ŸŒŸ Features

โœ… **Interactive CLI** powered by **Inquirer.js**
โœ… Choose **React (CRA)** or **Vite** as frontend framework
โœ… Support for **JavaScript** or **TypeScript**
โœ… Backend setup with **Express.js + Sequelize (SQL)** or **Express.js + Mongoose (MongoDB)**
โœ… Auto-installs **CORS, dotenv, react-router-dom** by default
โœ… Choose styling: **CSS, Bootstrap, or Tailwind CSS** ๐ŸŽจ
โœ… Pre-configures **frontend-backend proxy** (CRA or Vite)
โœ… Adds a default **health-check route (`/status`)** to test full-stack connectivity
โœ… Optional installation of **ESLint \& Prettier** for clean coding
โœ… Works across **Windows, macOS, and Linux** ๐Ÿ–ฅ๏ธ

---

## ๐Ÿ—๏ธ Technologies Used

### ๐Ÿ”น Core

- [Node.js](https://nodejs.org/) (CLI tool \& package manager)
- [Inquirer.js](https://www.npmjs.com/package/inquirer) โ€“ for CLI prompts
- [Chalk](https://www.npmjs.com/package/chalk) โ€“ for colorful CLI output
- [fs-extra / fs](https://www.npmjs.com/package/fs-extra) โ€“ for file system handling

### ๐Ÿ”น Frontend Options

- **React (CRA) or Vite**
- **JavaScript / TypeScript**
- Styling frameworks:
- CSS
- Bootstrap
- Tailwind CSS

### ๐Ÿ”น Backend Options

- **Express.js** (default backend framework)
- Database Choices:
- **SQL** โ†’ Sequelize + SQLite (default, can expand to PostgreSQL, MySQL, etc.)
- **MongoDB** โ†’ Express + Mongoose

### ๐Ÿ”น Optional Packages

- `react-router-dom` โ€“ routing in React โšก
- `cors` โ€“ enable CORS in Express
- `dotenv` โ€“ environment variable management
- `eslint` โ€“ linting ๐Ÿงน
- `prettier` โ€“ code formatting

---

## ๐ŸŽฏ Motive of the Project

The goal of this project is to **streamline and automate full-stack setup**.
Instead of wasting time configuring projects manually, this CLI lets you:

1. **Choose your stack interactively** ๐Ÿ–ฑ๏ธ
2. **Generate ready-to-run frontend + backend apps** โšก
3. **Start building features instantly** ๐Ÿš€

This project is built for **students, developers, and teams** who create multiple projects and want a **consistent, fast, and reliable setup**.

---

## ๐Ÿ”ฎ Future Implementations

โœจ Add **Next.js** as a frontend option
โœจ Support for **PostgreSQL, MySQL, and MongoDB Atlas by default**
โœจ Auto-generate **Dockerfile \& docker-compose.yml** for containerization
โœจ Add **Redux / Zustand / TanStack Query** as optional frontend state managers
โœจ Auto-create **unit tests** with Jest / Mocha
โœจ Add **GitHub Actions CI/CD pipeline** support

---

## โšก Installation \& Usage

### ๐Ÿ”น 1. System Requirements

- [Node.js](https://nodejs.org/) **v14+**
- [npm](https://www.npmjs.com/) (bundled with Node.js)
- Git installed (recommended for Vite and CRA)
- Any OS: **Windows / macOS / Linux**

---

### ๐Ÿ”น 2. Clone \& Run

```bash
# Clone this repo
git clone https://github.com/parthamk/CLIJS.git
cd CLIJS

# Make file executable (Linux/Mac)
chmod +x cli.js

# Run the script
./cli.js
```

### ๐Ÿ”น 3. Using with Node

```bash
node cli.js
```

---

### ๐Ÿ”น 4. Workflow in VS Code

1. Open project in VS Code:

```bash
code .
```

2. Navigate to **server**:

```bash
cd server
node index.js # Runs backend on http://localhost:5000
```

3. Navigate to **client**:

```bash
cd ../client
npm start # Starts React app (frontend)
```

4. Visit:
- Frontend โ†’ `http://localhost:3000` (CRA) or `http://localhost:5173` (Vite)
- Backend โ†’ `http://localhost:5000/status`

---

## ๐Ÿ“‚ Project Structure

```
project-name/
โ”‚โ”€โ”€ client/ # React/Vite frontend
โ”‚ โ””โ”€โ”€ src/ # React source files
โ”‚โ”€โ”€ server/ # Express backend
โ”‚ โ””โ”€โ”€ index.js # Entry point (API + DB setup)
โ”‚โ”€โ”€ cli.js # The CLI script
```

---

## ๐ŸŽ‰ Example Welcome Screen (Frontend)

When you run your project, the frontend will fetch backend status and show:

```
โœ” Frontend is running successfully
โœ” Server is running successfully
All systems check complete. Happy hacking! ๐Ÿš€
```

---

## ๐Ÿ‘จ๐Ÿ’ป Contribution

Contributions are always welcome! ๐Ÿ™Œ

- Fork repo
- Create feature branch
- Submit PR

---

## ๐Ÿ“œ License

[MIT License](LICENSE) โ€“ Free to use \& modify.

---

๐Ÿ”ฅ With this CLI tool, you save **time + effort** and kickstart your dev projects with **best practices pre-configured**.

> ๐Ÿ’ก Recommended: Keep this tool globally installed using:
> ``bash > npm install -g . > cli.js > ``

---