Skip to content

RMIT-SEPT/majorproject-2-thurs-18-30-5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RMIT SEPT 2020 Major Project

Group 5

Members

  • U'REN, Donald (s3686963)
  • LEE, Ge (s3776409)
  • KHOSRAVI, Ali (s3788120)

Records

Code documentation

Quick Start in docs folder

Project documentation

Wiki via Wiki tab

Instructions

Frontend

Build

npm run test if testing the frontend project or docker build -f Dockerfile -t agme-app:prod . to test the dockerised frontend project

Deploy

In order to enable CICD, the project will need to be setup with CircleCI:

  • initialise project with CircleCI

In order to deploy the frontend AWS resources will need to be configured (Guide):

  • creata a new ECR for the frontend project
  • create a task definition
  • create a new ECS Cluster for deployment of frontend containers
  • create a new ECS Service to update EC2 instances

For the frontend EC2 instance, ensure that the inbound security group rules allow for access from all addresses as follows: EC2 FE Security Inbound Rules

After these have been created, environment variables will needed to be added to the CircleCI project

  • AWS Access Key ID
  • AWS Secret Access Key
  • AWS Session Token Frontend CircleCI Env Variables

Once a developer commits or merges into master, the new container will be pushed to AWS and deployed to the EC2 instance. Frontend CircleCI Push Frontend CircleCI Update

Run

To run the dockerised frontend web app locally, you can run docker run -it --rm -p 1337:8080 agme-app:prod

In order to access the deployed instance, simply navigate to the EC2 Instance panel and access the frontend via the IPv4 link EC2 Link

Backend

Build

mvn package if testing the backend project or docker build . to test the dockerised backend project

Deploy

In order to enable CICD, the project will need to be setup with CircleCI:

  • initialise project with CircleCI

In order to deploy the backend AWS resources will need to be configured:

  • create a new RDS instance for the project
    • for our project, given budget constraints, we used a free-tier MySQL RDS instance
    • take note of the endpoint and port number, updating application.properties and any references RDS Link
    • ensure a user is added when creating the database, and if testing or direct queries are required set to public: RDS Public
  • create a new ECR for the backend project, as per course guides
  • create a new ECS Cluster for deployment of backend containers: Guide
  • create a new ECS service to update EC2 instances: LINK TO TUTORIAL

For the RDS Instance, ensure that the inbound security group rules allow for access from all addresses as follows: EC2 Link

For the backend EC2 instance, ensure that the inbound security group rules allow for access from all addresses as follows: EC2 Security Inbount Rules

After these have been created, environment variables will needed to be added to the CircleCI project

  • AWS Access Key ID
  • AWS Account ID
  • AWS Default Region
  • AWS Resource Name Prefix: this is the name of the ECR instance
  • AWS Secret Access Key
  • AWS Session Token Backend CircleCI Env Variables

Once a developer commits or merges into master, the new container will be pushed to AWS and deployed to the EC2 instance. Backend CircleCI Push Backend CircleCI Update

Run

To run the dockerised backend service locally, you can run docker run -p 8080:8080 -t container

In order to access the deployed instance, simply navigate to the EC2 Instance panel and access the backend via the IPv4 link EC2 Link