Giter Club home page Giter Club logo

alyconr / deploy-spa-dockercompose Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 740 KB

Deploy SPA-SSR application on AWS without relying on any GitOps methodology. The idea is to demonstrate an alternative approach to application deployment that is not dependent on any configuration management tool, infrastructure automation tool, or CI/CD pipeline.

License: Other

JavaScript 37.59% CSS 9.17% HTML 7.10% Shell 45.11% Dockerfile 1.04%
bash-script docker docker-compose ec2-instances expressjs nat-gateway nginx-proxy route-tables

deploy-spa-dockercompose's Introduction

logo

Deploying Hybrid SSR-SPA App on AWS Using Bash Script Automation

๐Ÿ“— Table of Contents

๐Ÿ“– [SPA-SSR, DOCKER, NGINX, OPENSSL, BASH & AWS ]

[SPA-SSR, DOCKER, NGINX, OPENSSL, BASH & AWS] This repository provides an example of how to deploy a JavaScript Single Page Application which was built using plain JavaScript, Webpack and Express. The main goal is to show how to deploy SPA-SSR application on AWS without relying on any GitOps methodology. The idea is to demonstrate an alternative approach to application deployment that is not dependent on any configuration management tool, infrastructure automation tool, or CI/CD pipeline.

logo

Tech Stack

  • HTML
  • CSS
  • Javascript
  • Webpack
  • Express
  • Docker Compose
  • OpenSSL
  • github actions
  • Bash Script
  • AWS EC2 Instances,VPC, ROUTE TABLE, SECURITY GROUP , NAT GATEWAY, INTERNET GATEWAY
  • Key Features

    • [SPA Architecture]
    • [Server-Side Menu Rendering]
    • [ES6 Modules]
    • [Webpack Bundling ]
    • [Express Server to handle routing]
    • [Docker Integration]
    • [Nginx Configuration]
    • [OpenSSL Configuation]
    • [AWS EC2 Instances Deploy]

    Features

    SPA Architecture:

    The project showcases the implementation of a Single Page Application using Webpack and Express.

    Server-Side Menu Rendering:

    Express is configured to dynamically render menu paths on the server side, eliminating the need for full page reloads when navigating between menu items. The menu filters the max supply, low supply and profile cards of each cryptocurrency.

    Webpack Integration:

    The project employs Webpack for bundling and optimizing client-side assets, resulting in a performant and efficient front-end.

    Docker Integration:

    The project utilizes Docker Compose to build and run the application to AWS EC2 instances.

    Nginx Configuation:

    Nginx as a reverse proxy to route requests through express to serve static assets.

    (back to top)

    Bash Script Deployment:

    The project uses a bash scrit to automate the deployment of the application to AWS EC2 instances.

    OpenSSL Configuation:

    The project utilizes OpenSSL to generate a self-signed certificate for Nginx.

    AWS EC2 Instances Deploy:

    The project deploys the application into an AWS EC2 instance.

    ๐Ÿš€ Live Demo

    (back to top)

    ๐Ÿ’ป Getting Started

    To get a local copy up and running, follow these steps.

    Prerequisites

    To run this project you need the following tools installed:

    • [Git and GitHub ]
    • [Webpack ]
    • [Express ]
    • [Docker ]
    • [Docker Compose ]
    • [OpenSSL ]
    • [Bash Script ]
    • [Nginx ]
    • [AWS EC2 Instances ]

    Setup

    Clone this repository to your desired folder:

     cd deploy-SPA-DockerCompose
     git clone [email protected]:alyconr/deploy-SPA-DockerCompose

    Install

    Install this project with:

     cd deploy-SPA-DockerCompose
     npm install

    Usage

    To run locally run the following command:

    Development mode

        npm run build-dev
        npm run devserver-reload    

    Production mode

        npm run build-prod
        npm run server-prod

    Run tests

    To run tests, run the following command:

    To test the Stylelint linter:

        npx stylelint "**/*.{css,scss}"

    To test the Webhint:

        npx hint .

    To test the ESLint linter:

        npx eslint .

    Deployment

    The image below shows the arquitecture with all the resources configured:

    deploy-SPA-DockerCompose

    Run the following command to install the necessary dependencies from the bash script file:

        bash installpackages.sh -u $USER -i $IP_PUBLIC_SERVER -s $IP_PRIVATE_SERVER

    Run the following command to deploy the project to AWS EC2 instances:

         bash deployment.sh  -u $USER  -i $IP_PUBLIC_SERVER -s $IP_PRIVATE_SERVER -d $APP_FOLDER -f $EXPRESS_FOLDER -e prod 

    (back to top)

    ๐Ÿ‘ฅ Authors

    JEYSSON CONTRERAS

    ๐Ÿ‘ค Author1

    (back to top)

    ๐Ÿ”ญ Future Features

    • [kubernetes deployment]
    • [CloudForm deployment]

    (back to top)

    ๐Ÿค Contributing

    Contributions, issues, and feature requests are welcome!

    Feel free to check the issues page.

    (back to top)

    โญ๏ธ Show your support

    Write a message to encourage readers to support your project

    If you like this project please give one start.

    (back to top)

    ๐Ÿ™ Acknowledgments

    I would like to thank God for giving me the strength to carry out this project.

    (back to top)

    (back to top)

    ๐Ÿ“ License

    This project is MIT licensed.

    (back to top)

    deploy-spa-dockercompose's People

    Contributors

    alyconr avatar

    Stargazers

     avatar

    Watchers

     avatar

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google โค๏ธ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.