mariehposa / sca-project

A three-tier application (frontend, backend, and database) deployed using Terraform, Ansible and AWS.

Home Page:http://54.80.211.174:3000/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

She Code Africa (SCA) Final Project

A three tier application (frontend, backend, and database) deployed using Terraform, Ansible and AWS.

  • Frontend App image

Table of Content

  1. Getting started
  2. Prerequisites
  3. Enviroment variables
  4. Installation Docker Terraform Ansible
  5. Deployment
  6. Tools and Technologies
  7. Author
  8. Acknowledgments

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and production purposes.

Prerequisites

To get started with this project you need a basic knowledge of the following.

Javascript (ES6)
Version Control (Git)
Docker
AWS
Terraform
Ansible
Jenkins

Enviroment Variables

  • After cloning the repository, in the project directory, cd into sca-project/portfolio-backend.
  • Create a .env file and put the following variables in order for the app to function properly.
PORT=4000
NODE_ENV=development

Installation

Below are the steps required in setting this project up. For more information about this, please refer to my article

Docker

  • In the root folder of portfolio-frontend, run docker build -t image-name . to build the Dockerfile into docker image.
  • Run docker run image-name to build a container from that image.
  • Add tag to the docker image using docker tag image-name docker_hub_username/repo-name:tag-name.
  • The run docker push docker_hub_username/repo-name:tag-name to push the docker image to your dockerhub repo.
  • Carry out the same process for the portfolio-backend.

Terraform

  • cd into terraform/jenkins and run terraform init to grab the requirements for your AWS provider.
  • Run terraform plan to verify that we've set it up correctly. It will later prompt for a value, enter the instance name, jenkins.
  • Then run terraform terraform apply to spin up your ec2 instance. It will also prompt for a value, enter the instance name, jenkins and yes to confirm.
  • Carry out the same process for terraform/backend and terraform/frontend.

Ansible

  • To run ansible playbooks, cd into ansible folder and run the following commands one after the other:
  • ansible-playbook provision_jenkins.yaml
  • ansible-playbook provision_frontend.yaml
  • ansible-playbook provision_backend.yaml

Deployment

  • The portfolio frontend was deployed here
  • The portfolio backend was deployed here

Tools and Technologies

  • AWS - Cloud service provider.
  • Docker - A tool for running applications.
  • Ansible - Configuration management tool.
  • Terraform - A tool for managing cloud services.
  • React - The web framework used.
  • Styled-components - Used to generate styles.
  • Formik - Component that helps with building forms.
  • Node.js- Javascript Runtime Engine.
  • Express - Fast, unopinionated, minimalist web framework for Node.js.
  • Knex - is a SQL query builder for Postgres, SQLite3, etc, designed to be flexible, portable, and fun to use.
  • Postgresql - A open source object-relational database system.

Author

Acknowledgments

  • She Code Africa
  • Deimos

About

A three-tier application (frontend, backend, and database) deployed using Terraform, Ansible and AWS.

http://54.80.211.174:3000/


Languages

Language:JavaScript 79.9%Language:HCL 7.9%Language:CSS 6.8%Language:HTML 4.4%Language:Dockerfile 1.1%