Skip to content

mayurCoder2004/mayur-deploy-ready

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

37 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ mayur-deploy-ready

Analyze, score, and fix your project's deployment readiness β€” before it hits production.

npm version License: MIT Node.js

A zero-config CLI tool that detects missing deployment configurations, Docker setup issues, security vulnerabilities, and platform-specific requirements β€” all before you push to production.

Installation Β· Usage Β· Features Β· Project Structure Β· Contributing


🎯 Overview

mayur-deploy-ready is a comprehensive deployment readiness analyzer that helps developers catch deployment issues early. It performs automated checks across multiple categories including package configuration, Docker setup, security, framework-specific requirements, and platform deployment configs.

Why Use This Tool?

  • βœ… Catch issues before deployment - Identify missing files and misconfigurations locally
  • βœ… Save debugging time - Avoid broken deployments and production incidents
  • βœ… Learn best practices - Get actionable suggestions for every issue found
  • βœ… Automate fixes - Generate missing files with sensible defaults
  • βœ… CI/CD integration - Use in GitHub Actions, Jenkins, GitLab CI, and more
  • βœ… Framework-aware - Detects Express, React, Vite and validates accordingly

πŸ“¦ Installation

Global Installation (Recommended)

npm install -g mayur-deploy-ready

Local Installation

npm install --save-dev mayur-deploy-ready

Requirements: Node.js >= 18


πŸš€ Usage

1️⃣ Standard Analysis Mode

Run from your project root directory:

mayur-deploy-ready

This performs a comprehensive analysis of your project and provides:

  • βœ… Deployment readiness score (0-100)
  • πŸ“Š Detailed check results with pass/warning/error status
  • πŸ’‘ Actionable suggestions for fixing issues
  • 🎨 Color-coded output for easy scanning

Demo: Standard Analysis Mode

Standard Analysis Mode

The standard mode provides a comprehensive deployment readiness report with colored output, showing all checks performed, issues found, and a final deployment score.


2️⃣ Fix Mode (Auto-Repair)

mayur-deploy-ready fix

Automatically generates missing deployment files with production-ready defaults:

File Generated Purpose
.gitignore Prevents committing node_modules, .env, build artifacts
.dockerignore Keeps Docker images lean by excluding dev dependencies
Dockerfile Production-ready Node.js container configuration
.env.example Documents required environment variables for your team
routes/ Creates Express routes folder structure
vercel.json Vercel deployment configuration
railway.json Railway deployment configuration
package.json Adds missing start, build, and test scripts

Note: Fix mode only creates files that don't exist. Existing files are never overwritten to preserve your custom configurations.

Demo: Fix Mode

Fix Mode

Fix mode automatically scaffolds missing deployment files and configurations, showing exactly what was created to make your project deployment-ready.


3️⃣ JSON Output Mode

mayur-deploy-ready --json

Returns structured JSON output ideal for:

  • πŸ€– CI/CD pipelines - Parse results programmatically
  • πŸ“Š Dashboards - Build deployment readiness metrics
  • πŸ”— Tool integration - Pipe into other automation tools
  • πŸ“ Logging - Store historical deployment readiness data

JSON Output Structure

{
  "score": 85,
  "stats": {
    "passed": 6,
    "warnings": 2,
    "errors": 0
  },
  "results": [
    {
      "type": "success",
      "message": "package.json found"
    },
    {
      "type": "warning",
      "message": "Dockerfile missing"
    }
  ]
}

Demo: JSON Output Mode

JSON Mode

JSON mode provides machine-readable output perfect for CI/CD integration, automation scripts, and building deployment dashboards.


4️⃣ CI/CD Mode

mayur-deploy-ready --ci

Silent validation mode with meaningful exit codes:

Exit Code Status Description
0 βœ… Pass Deployment ready (score >= 85)
1 ❌ Fail Deployment unsafe (score < 85)

GitHub Actions Integration

name: Deployment Readiness Check

on: [push, pull_request]

jobs:
  deploy-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '18'
      
      - name: Install mayur-deploy-ready
        run: npm install -g mayur-deploy-ready
      
      - name: Run deployment checks
        run: mayur-deploy-ready --ci

GitLab CI Integration

deploy-check:
  stage: test
  image: node:18
  script:
    - npm install -g mayur-deploy-ready
    - mayur-deploy-ready --ci
  only:
    - merge_requests
    - main

Jenkins Integration

pipeline {
    agent any
    stages {
        stage('Deployment Check') {
            steps {
                sh 'npm install -g mayur-deploy-ready'
                sh 'mayur-deploy-ready --ci'
            }
        }
    }
}

✨ Features

Comprehensive Checks

1. Package Configuration Checks

Check Description Score Impact
package.json exists Validates presence of package.json -25 points if missing
Build script Checks for build script in package.json -10 points if missing
Start script Validates start script for Express apps -5 points if missing
Dependencies Ensures required dependencies are listed Variable impact

2. Git & Version Control Checks

Check Description Score Impact
.gitignore exists Validates .gitignore file presence -15 points if missing
node_modules ignored Ensures node_modules is in .gitignore -5 points if not ignored
.env ignored Ensures .env is in .gitignore -10 points if not ignored
Build artifacts ignored Checks for dist/, build/ in .gitignore -5 points if missing

3. Security Checks

Check Description Score Impact
.env file Validates environment variables setup -20 points if missing
Weak secrets Detects hardcoded or weak secrets -20 points if found
.env.example Checks for environment variables documentation -5 points if missing

4. Docker Checks

Check Description Score Impact
Dockerfile Validates Dockerfile presence -5 points if missing
.dockerignore Checks for .dockerignore file -5 points if missing
Multi-stage builds Recommends optimization patterns Informational

5. Framework-Specific Checks

Express.js Checks
  • βœ… Start script validation (node server.js or node index.js)
  • βœ… Routes folder structure (routes/ directory)
  • βœ… Server file detection (server.js, index.js, app.js)
  • βœ… Middleware configuration validation
React Checks
  • βœ… Vite configuration (vite.config.js)
  • βœ… Source folder structure (src/ directory)
  • βœ… Build script validation
  • βœ… Public assets folder (public/)

6. Platform Deployment Checks

Platform Configuration File Validation
Vercel vercel.json Checks for version and build config
Railway railway.json Validates Railway schema
Docker Dockerfile Ensures container setup

πŸ“ Project Structure

mayur-deploy-ready/
β”‚
β”œβ”€β”€ bin/
β”‚   └── index.js                    # CLI entry point and command orchestration
β”‚
β”œβ”€β”€ checks/                         # Validation modules
β”‚   β”œβ”€β”€ buildCheck.js               # Validates build script in package.json
β”‚   β”œβ”€β”€ dockerCheck.js              # Checks Dockerfile and .dockerignore
β”‚   β”œβ”€β”€ envCheck.js                 # Environment variables validation
β”‚   β”œβ”€β”€ frameworkCheck.js           # Detects Express, React, Vite
β”‚   β”œβ”€β”€ frameworks/                 # Framework-specific validators
β”‚   β”‚   β”œβ”€β”€ expressChecks.js        # Express.js specific checks
β”‚   β”‚   └── reactChecks.js          # React specific checks
β”‚   β”œβ”€β”€ gitignoreCheck.js           # .gitignore validation and content checks
β”‚   β”œβ”€β”€ packageCheck.js             # package.json presence validation
β”‚   β”œβ”€β”€ platformCheck.js            # Vercel/Railway config checks
β”‚   └── securityCheck.js            # Security vulnerability detection
β”‚
β”œβ”€β”€ fixes/                          # Auto-fix modules
β”‚   β”œβ”€β”€ fixDockerfile.js            # Generates production-ready Dockerfile
β”‚   β”œβ”€β”€ fixDockerignore.js          # Creates .dockerignore with best practices
β”‚   β”œβ”€β”€ fixEnvExample.js            # Generates .env.example template
β”‚   β”œβ”€β”€ fixGitignore.js             # Creates .gitignore with common patterns
β”‚   β”œβ”€β”€ fixPackageScripts.js        # Adds missing npm scripts
β”‚   β”œβ”€β”€ fixRailwayConfig.js         # Generates railway.json
β”‚   β”œβ”€β”€ fixRoutes.js                # Creates Express routes folder
β”‚   └── fixVercelConfig.js          # Generates vercel.json
β”‚
β”œβ”€β”€ utils/                          # Utility modules
β”‚   β”œβ”€β”€ logger.js                   # Colored console output (success/warning/error)
β”‚   β”œβ”€β”€ scoreManager.js             # Deployment score calculation (0-100)
β”‚   β”œβ”€β”€ statsManager.js             # Statistics tracking (passed/warnings/errors)
β”‚   └── suggestions.js              # Formats actionable suggestions
β”‚
β”œβ”€β”€ assets/                         # Documentation images
β”‚   β”œβ”€β”€ demo.png                    # Standard analysis mode screenshot
β”‚   β”œβ”€β”€ fix-mode.png                # Fix mode screenshot
β”‚   └── json-mode.png               # JSON output mode screenshot
β”‚
β”œβ”€β”€ routes/                         # Example Express routes folder
β”‚
β”œβ”€β”€ .dockerignore                   # Docker ignore patterns
β”œβ”€β”€ .env.example                    # Environment variables template
β”œβ”€β”€ .gitignore                      # Git ignore patterns
β”œβ”€β”€ Dockerfile                      # Docker container configuration
β”œβ”€β”€ railway.json                    # Railway deployment config
β”œβ”€β”€ vercel.json                     # Vercel deployment config
β”œβ”€β”€ package.json                    # Project metadata and dependencies
β”œβ”€β”€ package-lock.json               # Locked dependency versions
β”œβ”€β”€ LICENSE                         # MIT License
└── README.md                       # This file

Module Descriptions

/bin - CLI Entry Point

  • index.js: Main CLI orchestrator that handles command parsing, runs all checks, calculates scores, and formats output

/checks - Validation Logic

  • Each module performs specific validation checks
  • Returns boolean results or arrays of warnings
  • Framework-specific checks are isolated in /frameworks subfolder

/fixes - Auto-Repair Logic

  • Each module generates a specific missing file
  • Uses sensible defaults and best practices
  • Never overwrites existing files

/utils - Shared Utilities

  • logger: Provides colored console output using chalk
  • scoreManager: Manages deployment score (starts at 100, deducts points for issues)
  • statsManager: Tracks passed/warning/error counts
  • suggestions: Formats helpful suggestions for fixing issues

πŸ“Š Scoring System

The tool starts with a perfect score of 100 and deducts points based on issues found:

Score Breakdown

Issue Type Points Deducted Severity
package.json missing -25 πŸ”΄ Critical
Security issues -20 πŸ”΄ Critical
.gitignore missing -15 πŸ”΄ Critical
Build script missing -10 🟑 Warning
.env not ignored -10 🟑 Warning
Framework not detected -10 🟑 Warning
Docker files missing -5 each 🟑 Warning
Platform configs missing -5 each 🟑 Warning
node_modules not ignored -5 🟑 Warning

Score Interpretation

Score Range Status Badge Description
85-100 🟒 Production Ready βœ… Safe to deploy - all critical checks passed
60-84 🟑 Needs Attention ⚠️ Minor issues present - fix before deploying
0-59 πŸ”΄ Unsafe Deployment ❌ Critical issues detected - do not deploy

🎨 Supported Frameworks & Platforms

Frameworks

Framework Detection Method Specific Checks
Node.js package.json presence Runtime validation
Express.js express in dependencies Start script, routes folder, server file
React react in dependencies Vite config, src folder, build script
Vite vite in devDependencies Build configuration

Deployment Platforms

Platform Config File Validation
Docker Dockerfile, .dockerignore Container setup, image optimization
Vercel vercel.json Version, build configuration
Railway railway.json Schema validation

πŸ”§ Example Outputs

Successful Deployment Check

━━━━━━━━━━━━━━━━━━━━━━
πŸš€ DEPLOY READY
━━━━━━━━━━━━━━━━━━━━━━

Running Deploy Ready Checks...

βœ” package.json found
βœ” Build script exists
βœ” .gitignore found
βœ” No weak secrets detected
βœ” Framework Detected: Express
βœ” Dockerfile found
βœ” .dockerignore found

━━━━━━━━━━━━━━━━━━━━━━
πŸ“Š Deployment Score: 100/100
━━━━━━━━━━━━━━━━━━━━━━

βœ” Passed: 7
⚠ Warnings: 0
❌ Errors: 0

🟒 Production Ready

Deployment with Warnings

━━━━━━━━━━━━━━━━━━━━━━
πŸš€ DEPLOY READY
━━━━━━━━━━━━━━━━━━━━━━

Running Deploy Ready Checks...

βœ” package.json found
βœ” Build script exists
βœ” .gitignore found
⚠ .env not ignored
   πŸ’‘ Add this to .gitignore:
   .env

βœ” No weak secrets detected
βœ” Framework Detected: Express + React
⚠ Dockerfile missing
   πŸ’‘ Create Dockerfile:
   FROM node:18

⚠ .dockerignore missing
   πŸ’‘ Create .dockerignore:
   node_modules
   .env

━━━━━━━━━━━━━━━━━━━━━━
πŸ“Š Deployment Score: 75/100
━━━━━━━━━━━━━━━━━━━━━━

βœ” Passed: 5
⚠ Warnings: 3
❌ Errors: 0

🟑 Needs Attention

Critical Issues Detected

━━━━━━━━━━━━━━━━━━━━━━
πŸš€ DEPLOY READY
━━━━━━━━━━━━━━━━━━━━━━

Running Deploy Ready Checks...

❌ package.json missing
   πŸ’‘ Create package.json:
   npm init -y

❌ .gitignore missing
   πŸ’‘ Create .gitignore file with:
   node_modules
   .env
   dist

⚠ No framework detected

━━━━━━━━━━━━━━━━━━━━━━
πŸ“Š Deployment Score: 50/100
━━━━━━━━━━━━━━━━━━━━━━

βœ” Passed: 0
⚠ Warnings: 1
❌ Errors: 2

πŸ”΄ Unsafe Deployment

🀝 Contributing

Contributions are welcome! Here's how you can help:

Reporting Issues

Found a bug or have a feature request? Open an issue with:

  • Clear description of the problem
  • Steps to reproduce
  • Expected vs actual behavior
  • Your environment (OS, Node version)

Submitting Pull Requests

  1. Fork the repository

    git clone https://github.com/mayurCoder2004/mayur-deploy-ready.git
  2. Create a feature branch

    git checkout -b feature/my-new-feature
  3. Make your changes

    • Add new checks in /checks
    • Add corresponding fixes in /fixes
    • Update documentation
  4. Test your changes

    npm link
    mayur-deploy-ready
  5. Commit and push

    git commit -m "Add: new feature description"
    git push origin feature/my-new-feature
  6. Open a Pull Request

Development Guidelines

  • Follow existing code style and patterns
  • Add comments for complex logic
  • Keep functions small and focused
  • Test with multiple project types (Express, React, etc.)

πŸ“„ License

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

MIT License Summary

  • βœ… Commercial use
  • βœ… Modification
  • βœ… Distribution
  • βœ… Private use

πŸ‘€ Author

Mayur Pawar


πŸ™ Acknowledgments

Built with:

  • chalk - Terminal string styling
  • commander - Command-line interface framework

🌟 If this tool helped you catch deployment issues, give it a star!

Made with ❀️ by Mayur Pawar

⭐ Star on GitHub Β· πŸ› Report Bug Β· πŸ’‘ Request Feature

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors