Skip to content

A simple CLI deployment manager for Next.js apps using Docker (Nginx, Blue-Green) on Linux VPS.

Notifications You must be signed in to change notification settings

CHETHAN562/reflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reflow: A Simple CLI Deployment Manager for Next.js Apps 🚀

GitHub repo size GitHub issues GitHub license

Welcome to Reflow! This repository contains a straightforward command-line interface (CLI) deployment manager designed specifically for Next.js applications. Utilizing Docker with Nginx and Blue-Green deployment strategies, Reflow simplifies the deployment process on Linux Virtual Private Servers (VPS).

Table of Contents

Features 🌟

  • Easy Deployment: Quickly deploy Next.js applications using a simple command.
  • Blue-Green Deployment: Minimize downtime and risk by switching between two identical environments.
  • Docker Support: Leverage the power of containers for a consistent deployment experience.
  • Nginx Integration: Use Nginx for serving your applications efficiently.
  • CI/CD Ready: Integrate with your existing CI/CD pipelines seamlessly.

Installation 🛠️

To get started with Reflow, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/CHETHAN562/reflow.git
    cd reflow
  2. Install Dependencies: Ensure you have Docker installed on your Linux VPS. You can install it using the following commands:

    sudo apt update
    sudo apt install docker.io
    sudo systemctl start docker
    sudo systemctl enable docker
  3. Build the Docker Image: Run the following command to build the Docker image:

    docker build -t reflow .
  4. Run the CLI Tool: You can now run the Reflow CLI tool. Check the usage section for details.

Usage 📦

After installation, you can use Reflow to manage your Next.js deployments. Here’s a basic command to get you started:

./reflow deploy <your-nextjs-app>

Replace <your-nextjs-app> with the path to your Next.js application. This command will initiate the deployment process using the Blue-Green strategy.

Command Options

  • deploy: Deploy your Next.js application.
  • status: Check the status of your current deployment.
  • rollback: Roll back to the previous version of your application.

Deployment Strategies 🔄

Blue-Green Deployment

Reflow implements the Blue-Green deployment strategy, which allows you to maintain two identical environments (Blue and Green). You can switch traffic between these environments with minimal downtime. Here’s how it works:

  1. Prepare the Green Environment: Deploy your new version to the Green environment.
  2. Test the Green Environment: Ensure everything works as expected.
  3. Switch Traffic: Once validated, switch traffic from Blue to Green.
  4. Rollback if Necessary: If issues arise, revert traffic back to Blue.

This strategy significantly reduces the risk associated with deploying new versions.

Configuration ⚙️

Reflow allows you to customize your deployment settings through a configuration file. Create a file named reflow-config.json in the root of your project. Here’s an example configuration:

{
  "appName": "My Next.js App",
  "port": 3000,
  "dockerImage": "my-nextjs-app:latest",
  "nginxConfig": {
    "serverName": "myapp.com",
    "root": "/usr/share/nginx/html"
  }
}

Configuration Options

  • appName: Name of your application.
  • port: Port on which your application will run.
  • dockerImage: Docker image to use for deployment.
  • nginxConfig: Nginx configuration settings.

Contributing 🤝

We welcome contributions to Reflow! If you’d like to help improve the project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature/YourFeature.
  3. Make your changes and commit them: git commit -m 'Add some feature'.
  4. Push to the branch: git push origin feature/YourFeature.
  5. Open a pull request.

Please ensure your code adheres to the existing style and includes tests where applicable.

License 📜

Reflow is licensed under the MIT License. See the LICENSE file for details.

Contact 📬

For questions or suggestions, feel free to reach out:

Releases 📦

To download the latest release, visit the Releases section. Make sure to download the appropriate file and execute it to get started.


Thank you for checking out Reflow! We hope this tool makes your Next.js deployments smoother and more efficient. Happy coding!