A three tier application (frontend, backend, and database) deployed using Terraform, Ansible and AWS.
- Getting started
- Prerequisites
- Enviroment variables
- Installation Docker Terraform Ansible
- Deployment
- Tools and Technologies
- Author
- Acknowledgments
These instructions will get you a copy of the project up and running on your local machine for development and production purposes.
To get started with this project you need a basic knowledge of the following.
Javascript (ES6)
Version Control (Git)
Docker
AWS
Terraform
Ansible
Jenkins
- After cloning the repository, in the project directory,
cd
intosca-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
Below are the steps required in setting this project up. For more information about this, please refer to my article
- In the root folder of
portfolio-frontend
, rundocker 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.
cd
intoterraform/jenkins
and runterraform 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
andyes
to confirm. - Carry out the same process for
terraform/backend
andterraform/frontend
.
- To run ansible playbooks,
cd
intoansible
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
- 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.
- She Code Africa
- Deimos