Skip to content

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

Notifications You must be signed in to change notification settings

alyconr/Deploy-SPA-DockerCompose

Repository files navigation

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 git@github.com: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)

    About

    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.

    Topics

    Resources

    License

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published