quick-cicd2
v0.0.6
Published
## π Overview
Readme
QUICK-CICD Generator - Complete Documentation
π Overview
The QUICK-CICD Generator is a powerful Node.js CLI tool that automatically generates Docker configurations, CI/CD pipelines, and deployment scripts for various project types.
Command to run:
- Full Documentation: https://nazmulhaque.netlify.app/quick-cicd/
npx quick-cicdDeveloper Contact:
- Name: Nazmul Haque
- Email: [email protected]
- LinkedIn: https://www.linkedin.com/in/nazzmulhq/
- Portfolio: https://nazmulhaque.netlify.app/
ποΈ Creating Your Application (Before Using QUICK-CICD)
Before generating CI/CD configurations, you need to create your application. Here are the commands for creating different types of projects:
1. React with Vite
# Create new Vite + React project
npm create vite@latest my-react-app -- --template react
cd my-react-app
npm install
# Alternative with specific template
npm create vite@latest my-react-app -- --template react-ts # TypeScript
npm create vite@latest my-react-app -- --template react-swc # SWC compiler
# Using other package managers
yarn create vite my-react-app --template react
pnpm create vite my-react-app --template react2. Next.js Application
# Create new Next.js project
npx create-next-app@latest my-nextjs-app
cd my-nextjs-app
# With specific options
npx create-next-app@latest my-nextjs-app --typescript --tailwind --eslint --app
npx create-next-app@latest my-nextjs-app --javascript --src-dir --import-alias "@/*"
# Using other package managers
yarn create next-app my-nextjs-app
pnpm create next-app my-nextjs-app3. Node.js Backend
# Initialize new Node.js project
mkdir my-node-backend
cd my-node-backend
npm init -y
# Install Express.js
npm install express cors helmet morgan dotenv
npm install -D nodemon
# Create basic Express server
mkdir src
echo 'const express = require("express");
const app = express();
const PORT = process.env.PORT || 3000;
app.use(express.json());
app.get("/", (req, res) => {
res.json({ message: "Hello from Node.js API!" });
});
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});' > src/index.js
# Create NestJS project (alternative)
npm i -g @nestjs/cli
nest new my-nest-project
cd my-nest-project4. PHP Laravel
# Create new Laravel project
composer create-project laravel/laravel my-laravel-app
cd my-laravel-app
# Alternative using Laravel installer
composer global require laravel/installer
laravel new my-laravel-app
cd my-laravel-app
# Generate application key
php artisan key:generate5. Python Django
# Create virtual environment
python -m venv django_env
source django_env/bin/activate # Linux/Mac
# django_env\Scripts\activate # Windows
# Install Django
pip install django
# Create Django project
django-admin startproject myproject .
cd myproject
# Create Django app
python manage.py startapp myapp
# Create requirements.txt
pip freeze > requirements.txt6. Python FastAPI
# Create virtual environment
python -m venv fastapi_env
source fastapi_env/bin/activate # Linux/Mac
# fastapi_env\Scripts\activate # Windows
# Install FastAPI and dependencies
pip install fastapi uvicorn sqlalchemy pymysql
# Create basic FastAPI app
mkdir app
echo 'from fastapi import FastAPI
from fastapi.responses import JSONResponse
app = FastAPI(title="My FastAPI App")
@app.get("/")
async def root():
return {"message": "Hello from FastAPI!"}
@app.get("/health")
async def health_check():
return JSONResponse(content={"status": "healthy"})' > main.py
# Create requirements.txt
pip freeze > requirements.txt7. Simple Python
# Create Python project directory
mkdir my-python-app
cd my-python-app
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# venv\Scripts\activate # Windows
# Install Flask for web server
pip install flask
# Create basic Flask app
echo 'from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/")
def hello():
return jsonify({"message": "Hello from Python Flask!"})
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000)' > app.py
# Create requirements.txt
pip freeze > requirements.txtπ System Requirements (Pre-Installation Check)
The tool automatically checks these requirements when you run it:
β Required Dependencies:
- Node.js: Version 16.0.0 or higher
- Git: Required for version control
- npm/yarn/pnpm: Package manager
β οΈ Optional Dependencies:
- Docker: For local testing (recommended)
- Docker Compose: For multi-service applications
π System Check Output:
When you run npx quick-cicd, you'll see:
β Checking system requirements...
Node.js v18.17.0 β, Git β, Docker βPlatform-Specific Installation:
Windows:
# Install Node.js from nodejs.org or using Chocolatey
choco install nodejs git docker-desktop
# Verify installation
node --version
git --version
docker --versionmacOS:
# Install using Homebrew
brew install node git
brew install --cask docker
# Verify installation
node --version
git --version
docker --versionLinux (Ubuntu/Debian):
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs git
# Install Docker
sudo apt-get update
sudo apt-get install docker.io docker-compose
# Verify installation
node --version
git --version
docker --versionπ¦ Project Types & File Structures
1. React with Vite (Frontend SPA)
Pre-Requirements:
# Must have these files in your project root:
βββ package.json # Required - Contains Vite & React dependencies
βββ vite.config.js # Vite configuration
βββ src/ # Source code directory
β βββ main.jsx # Entry point
β βββ App.jsx # Main component
βββ index.html # HTML templateCreate Command:
npm create vite@latest my-react-app -- --template react
cd my-react-app
npm installDependencies Check:
vitein dependencies or devDependenciesreactin dependenciesreact-domin dependencies
Generated Files Structure:
project-root/
βββ Dockerfile # Multi-stage build for React + Vite
βββ docker-compose.yml # Container orchestration
βββ ecosystem.config.js # PM2 process manager configuration
βββ deploy.sh # Deployment automation script
βββ .env.example # Environment variables template
βββ package.json # Your existing file
βββ vite.config.js # Your existing file
βββ src/ # Your existing source code
βββ main.jsx
βββ App.jsxSample vite.config.js Enhancement:
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
server: {
host: '0.0.0.0',
port: 3000,
},
build: {
outDir: 'dist',
sourcemap: false,
},
});2. Next.js (Full-stack React Framework)
Pre-Requirements:
# Must have these files in your project root:
βββ package.json # Required - Contains Next.js dependencies
βββ next.config.js # Next.js configuration (optional)
βββ pages/ # Pages directory OR
βββ app/ # App directory (Next.js 13+)
β βββ layout.js # Root layout
β βββ page.js # Home page
βββ public/ # Static assetsCreate Command:
npx create-next-app@latest my-nextjs-app
cd my-nextjs-appDependencies Check:
nextin dependenciesreactin dependenciesreact-domin dependencies
Generated Files Structure:
project-root/
βββ Dockerfile # Optimized for Next.js (build + runtime)
βββ docker-compose.yml # Container with Next.js optimizations
βββ ecosystem.config.js # PM2 configuration for Next.js
βββ deploy.sh # Next.js specific deployment
βββ .env.example # Next.js environment variables
βββ package.json # Your existing file
βββ next.config.js # Your existing file
βββ pages/ # Your existing pages
βββ public/ # Your existing static assetsSample next.config.js Enhancement:
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
experimental: {
outputFileTracingRoot: path.join(__dirname, '../../'),
},
};
module.exports = nextConfig;Environment Variables (.env.example):
NODE_ENV=production
PORT=3000
NEXTAUTH_SECRET=your-secret-key
NEXTAUTH_URL=http://localhost:30003. Node.js Backend (Express/NestJS API)
Pre-Requirements:
# Must have these files in your project root:
βββ package.json # Required - Contains Express/NestJS dependencies
βββ src/ # Source code directory OR
βββ index.js # Entry point OR
βββ app.js # Main application file
βββ routes/ # Routes directory (optional)Create Commands:
# Express.js
mkdir my-node-backend && cd my-node-backend
npm init -y
npm install express cors helmet morgan dotenv
# NestJS
npm i -g @nestjs/cli
nest new my-nest-projectDependencies Check:
expressOR@nestjs/corein dependencies- Valid Node.js backend structure
Generated Files Structure:
project-root/
βββ Dockerfile # Backend-optimized container
βββ docker-compose.yml # Multi-service (App + MySQL + Redis)
βββ ecosystem.config.js # PM2 configuration for backend
βββ deploy.sh # Backend deployment with database
βββ .env.example # Database and service configurations
βββ package.json # Your existing file
βββ src/ # Your existing source code
β βββ index.js
β βββ routes/
β βββ controllers/
βββ node_modules/ # Your existing dependenciesSample Express Server (src/index.js):
const express = require('express');
const cors = require('cors');
const helmet = require('helmet');
const morgan = require('morgan');
require('dotenv').config();
const app = express();
const PORT = process.env.PORT || 3000;
// Middleware
app.use(helmet());
app.use(cors());
app.use(morgan('combined'));
app.use(express.json());
// Routes
app.get('/', (req, res) => {
res.json({ message: 'Node.js API is running!' });
});
app.get('/health', (req, res) => {
res.json({ status: 'healthy', timestamp: new Date().toISOString() });
});
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});Services in docker-compose.yml:
services:
app: # Your Node.js application
mysql: # MySQL 8.0 database
redis: # Redis cacheEnvironment Variables (.env.example):
NODE_ENV=production
PORT=3000
DB_HOST=mysql
DB_PORT=3306
DB_USER=root
DB_PASSWORD=rootpassword
DB_NAME=your_database
REDIS_HOST=redis
REDIS_PORT=6379
JWT_SECRET=your-jwt-secret4. PHP Laravel (Backend Framework)
Pre-Requirements:
# Must have these files in your project root:
βββ composer.json # Required - Contains Laravel dependencies
βββ artisan # Laravel CLI tool
βββ app/ # Application code
β βββ Http/
β βββ Models/
βββ config/ # Configuration files
βββ database/ # Database files
β βββ migrations/
β βββ seeders/
βββ routes/ # Route definitions
β βββ web.php
β βββ api.php
βββ storage/ # Storage directory
βββ app/
βββ framework/
βββ logs/Create Command:
composer create-project laravel/laravel my-laravel-app
cd my-laravel-app
php artisan key:generateDependencies Check:
laravel/frameworkin composer.json- PHP version compatibility
- Valid Laravel project structure
Generated Files Structure:
project-root/
βββ Dockerfile # PHP-FPM with Nginx
βββ docker-compose.yml # Laravel + MariaDB setup
βββ deploy.sh # Laravel-specific deployment
βββ .env.example # Laravel environment template
βββ composer.json # Your existing file
βββ artisan # Your existing Laravel CLI
βββ app/ # Your existing application code
βββ config/ # Your existing configuration
βββ database/ # Your existing database files
βββ routes/ # Your existing routes
βββ storage/ # Your existing storage
βββ vendor/ # Composer dependenciesServices in docker-compose.yml:
services:
app: # Laravel application (PHP-FPM + Nginx)
mariadb: # MariaDB 10.6 databaseEnvironment Variables (.env.example):
APP_NAME=YourLaravelApp
APP_ENV=production
APP_KEY=base64:your-app-key
APP_DEBUG=false
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=mariadb
DB_PORT=3306
DB_DATABASE=laravel_db
DB_USERNAME=laravel_user
DB_PASSWORD=laravel_password5. Python Django (Full-stack Python Framework)
Pre-Requirements:
# Recommended project structure (optional - will be created if missing):
βββ manage.py # Django management script (indicates Django project)
βββ requirements.txt # Python dependencies (optional)
βββ myproject/ # Project directory
β βββ __init__.py
β βββ settings.py
β βββ urls.py
β βββ wsgi.py
βββ myapp/ # Application directory (optional)
βββ __init__.py
βββ models.py
βββ views.py
βββ urls.pyCreate Commands:
# Create virtual environment
python -m venv django_env
source django_env/bin/activate # Linux/Mac
# django_env\Scripts\activate # Windows
# Install Django
pip install django
# Create project
django-admin startproject myproject .
python manage.py startapp myapp
pip freeze > requirements.txtDependencies Check:
- Python installation
- Optional: Django project structure
- Optional:
requirements.txtfile
Generated Files Structure:
project-root/
βββ Dockerfile # Python Django container
βββ docker-compose.yml # Django + MySQL + Nginx setup
βββ nginx/
β βββ conf.d/
β βββ default.conf # Nginx configuration for Django
βββ deploy.sh # Django deployment script
βββ .env.example # Django environment variables
βββ requirements.txt # Sample Python dependencies (generated if missing)
βββ manage.py # Your existing Django management script
βββ myproject/ # Your existing Django project
β βββ settings.py
β βββ urls.py
β βββ wsgi.py
βββ static/ # Static files directoryServices in docker-compose.yml:
services:
web: # Django application
nginx: # Nginx reverse proxy
mysql: # MySQL 8.0 databaseGenerated requirements.txt (if missing):
Django>=4.2.0
mysqlclient>=2.1.0
gunicorn>=20.1.0
python-decouple>=3.6
Pillow>=9.5.0Environment Variables (.env.example):
DEBUG=False
SECRET_KEY=your-django-secret-key
DATABASE_URL=mysql://django_user:django_password@mysql:3306/django_db
ALLOWED_HOSTS=localhost,127.0.0.16. Python FastAPI (API Framework)
Pre-Requirements:
# Recommended project structure (optional):
βββ main.py # FastAPI application entry point
βββ requirements.txt # Python dependencies (optional)
βββ app/ # Application directory (optional)
β βββ __init__.py
β βββ routers/
β βββ models/
β βββ database.py
βββ tests/ # Tests directory (optional)Create Commands:
# Create virtual environment
python -m venv fastapi_env
source fastapi_env/bin/activate # Linux/Mac
# Install FastAPI
pip install fastapi uvicorn sqlalchemy pymysql
pip freeze > requirements.txt
# Create basic structure
mkdir app
touch main.py app/__init__.pyDependencies Check:
- Python installation
- Optional: FastAPI project structure
- Optional:
requirements.txtfile
Generated Files Structure:
project-root/
βββ Dockerfile # FastAPI optimized container
βββ docker-compose.yml # FastAPI + MySQL setup
βββ deploy.sh # FastAPI deployment script
βββ .env.example # API environment variables
βββ requirements.txt # FastAPI dependencies (generated if missing)
βββ main.py # Your existing FastAPI app (or create new)
βββ app/ # Your existing application code
β βββ routers/
β βββ models/
β βββ database.py
βββ tests/ # Your existing testsSample FastAPI main.py:
from fastapi import FastAPI
from fastapi.responses import JSONResponse
app = FastAPI(
title="My FastAPI App",
description="A FastAPI application with CI/CD",
version="1.0.0"
)
@app.get("/")
async def root():
return {"message": "Hello from FastAPI!"}
@app.get("/health")
async def health_check():
return JSONResponse(content={"status": "healthy"})
@app.get("/items/{item_id}")
async def read_item(item_id: int, q: str = None):
return {"item_id": item_id, "q": q}Services in docker-compose.yml:
services:
web: # FastAPI application
mysql: # MySQL 8.0 databaseGenerated requirements.txt (if missing):
fastapi>=0.100.0
uvicorn[standard]>=0.22.0
sqlalchemy>=2.0.0
pymysql>=1.0.3
pydantic>=2.0.0
python-multipart>=0.0.6Environment Variables (.env.example):
DATABASE_URL=mysql+pymysql://fastapi_user:fastapi_password@mysql:3306/fastapi_db
SECRET_KEY=your-fastapi-secret-key
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=307. Simple Python (Python with Nginx)
Pre-Requirements:
# Minimal requirements (all files will be created if missing):
βββ *.py # Any Python files (optional)
βββ requirements.txt # Python dependencies (optional)
βββ static/ # Static files directory (optional)Create Commands:
# Create project directory
mkdir my-python-app && cd my-python-app
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# Install Flask
pip install flask
pip freeze > requirements.txtDependencies Check:
- Python installation
- Project directory exists
Generated Files Structure:
project-root/
βββ Dockerfile # Python with Flask/WSGI container
βββ docker-compose.yml # Python + Nginx setup
βββ nginx/
β βββ conf.d/
β βββ default.conf # Nginx configuration for Python
βββ deploy.sh # Python deployment script
βββ .env.example # Basic environment variables
βββ requirements.txt # Python web dependencies (generated)
βββ app.py # Sample Flask application (generated)
βββ wsgi.py # WSGI entry point (generated)
βββ static/ # Static files directoryServices in docker-compose.yml:
services:
web: # Python Flask application
nginx: # Nginx reverse proxyGenerated app.py:
from flask import Flask, jsonify, render_template_string
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template_string('''
<!DOCTYPE html>
<html>
<head><title>Python Flask App</title></head>
<body>
<h1>Hello from Python Flask!</h1>
<p>Your Flask application is running successfully.</p>
<a href="/api">Check API</a>
</body>
</html>
''')
@app.route('/api')
def api():
return jsonify({"message": "Hello from Python Flask API!"})
@app.route('/health')
def health_check():
return jsonify({"status": "healthy"})
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=False)Generated wsgi.py:
from app import app
if __name__ == "__main__":
app.run()Generated requirements.txt:
Flask>=2.3.0
gunicorn>=20.1.0
python-dotenv>=1.0.0π Complete Step-by-Step Usage Guide
Phase 1: Create Your Application
Step 1: Choose Your Technology
Select from the supported project types and create your application using the commands provided above.
Step 2: Verify Your Setup
# For Node.js projects
npm run dev # or npm start
# For Python projects
python app.py # or python manage.py runserver
# For PHP Laravel
php artisan serve
# For Next.js
npm run devPhase 2: Generate CI/CD Configuration
Step 1: Navigate to Your Project
cd your-project-directoryStep 2: Run the Generator
npx quick-cicdStep 3: System Requirements Check
The tool will automatically check:
β Checking system requirements...
Node.js v18.17.0 β, Git β, Docker βStep 4: Select Project Type
Choose from the interactive menu:
π¦ Select your project type:
β― βοΈ React with Vite (Frontend SPA)
πΌ Next.js (Full-stack React Framework)
π’ Node.js Backend (Express/NestJS API)
π PHP Laravel (Backend Framework)
--- Python Projects ---
π Python Django (Full-stack Python Framework with MySQL)
β‘ Python FastAPI (API Framework with MySQL)
πΉ Simple Python (Python file with Nginx)Step 5: Project Validation
The tool validates your project structure:
β Validating project configuration...
β Project configuration validated successfullyStep 6: Handle Existing Files
If CI/CD files exist, choose an action:
β οΈ Existing files found:
β’ Dockerfile (Docker container configuration)
β’ docker-compose.yml (Docker Compose orchestration)
How would you like to proceed?
β― π Overwrite existing files
π Create with different names (.new extension)
β Cancel operationStep 7: File Generation
Watch the progress:
β Generating CI/CD files...
Generating Dockerfile... (1/5)
Generating docker-compose.yml... (2/5)
Generating deploy.sh... (3/5)
Generating .env.example... (4/5)
Generating ecosystem.config.js... (5/5)Step 8: Review Generated Files
π Generated Files:
βββββββββββββββββββββββββββββββββββββββββββββββββ
β Dockerfile (Docker container configuration)
β docker-compose.yml (Docker Compose orchestration)
β ecosystem.config.js (PM2 process manager config)
β deploy.sh (Deployment automation script)
β .env.example (Environment variables template)Step 9: Next Steps
Follow the completion guide:
π SUCCESS!
Your CI/CD configuration has been generated successfully!
π Next steps:
ββββββββββββββββββββββββββββββββββββββββββββββββββ
1. Review and customize the generated files
2. Configure environment variables in .env.example
3. Set up your deployment server
4. Test locally with Docker: docker-compose up
5. Build your project: npm run build3. Docker Not Running
# Start Docker service
sudo systemctl start docker # Linux
# Or start Docker Desktop on Windows/Mac
# Check Docker status
docker --version
docker-compose --version4. Permission Issues (Linux)
# Add user to docker group
sudo usermod -aG docker $USER
# Logout and login againπ Support & Contact
Developer Information:
- Name: Nazmul Haque
- Email: [email protected]
- LinkedIn: https://www.linkedin.com/in/nazzmulhq/
- Portfolio: https://nazmulhaque.netlify.app/
Getting Help:
- Check this documentation first
- Review generated files for configuration issues
- Test locally before deploying
- Contact developer for specific issues
Run npx quick-cicd to get started with automated CI/CD setup for your project!
