This is an application built to be used as a platform to demonstrate to customers how AWS services can be used in modern applications.
The application is composed of a NodeJS/Express REST backend which serves the ReactJS frontend via HTTP calls. The website front-end has two main components. The customer area, where customers can see the Menu, create account, login and Book Slots for attending the Pub/Restaurant. There's also an admin panel where the restaurant administration can manage bookings, users, menu items and slots available.
#general
sudo yum -y update
sudo yum -y install epel-release
sudo yum -y install git vim-enhanced ruby wget
#Installing the CodeDeploy agent on EC2
cd /home/ec2-user/
wget https://aws-codedeploy-eu-west-1.s3.eu-west-1.amazonaws.com/latest/install
sudo chmod +x ./install
sudo ./install auto
sudo service codedeploy-agent status
#nodejs
curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -
sudo yum install -y nodejs
#restaurant-management
cd /home/ec2-user/
sudo git clone https://github.com/lucasfdsilva/restaurant-management.git
cd /home/ec2-user/restaurant-management/backend
sudo npm install
#DB migrations
cd /home/ec2-user/restaurant-management/backend
sudo npx knex migrate:latest
#pm2
sudo npm install -g pm2@latest
sudo pm2 start /home/ec2-user/restaurant-management/backend/src/app.js --name restaurant-backend
#web-deployment
cd /home/ec2-user/restaurant-management/web
sudo npm install -g serve
sudo npm install
sudo npm run build
sudo pm2 start /home/ec2-user/restaurant-management/web/app.config.json
sudo pm2 startup
sudo pm2 save
- Customer
- General
- Visit Home Page
- Navigation Menu (Not logged in customer)
- Navigation Menu (Logged in customer)
- View Restaurant Menu
- Session
- Can Register (Create an account)
- Can Login
- Can logout
- View Profile
- Edit Profile
- Delete Account
- Can Reset Password
- Can Verify Email address
- Bookings
- View Previous Bookings
- Check Slots Availability
- Book Slot for visiting the restaurant
- User Receives Confirmation Email after placing booking
- General
- Restaurant Management
- Separate Login Middleware to verify Admin Status
- Manage Menu Items
- Manage Time Slots
- Manage Customers Accounts
- Manage Staff Accounts
- Manage Existing Bookings
- Receives Email Notification for new Bookings
- General Site Configuration Management
- Configure a Launch Template to be used by the EC2 Auto Scaling Group
- Name: RESTaurant-AWS-Linux
- AMI: Amazon Linux 2
- Instance Type: t2.micro
- Networking Platform: EC2-Classic
- Instance Profile: RESTaurantDevInstances
- User Data
- Install Updates
- Install CodeDeploy Agent
- Install NodeJS
- Install PM2
- Install Serve
- Install Git, VIM, Epel, Ruby and Wget
- Clone RESTaurant-management Repo from Lucas' GitHub
- Build React App
- Run backend using PM2
- Run Serve on Frontend using PM2
- Configure Load Balancer
- Name: RESTaurant-ClassicLB
- Configure Auto Scaling Group
- Name: RESTaurant
- Template: RESTaurant-AWS-Linux
- Networking: Default VPC - 3 default subnets included
- Scaling Policy: CPU > 80%
- New Instance Warm up time: 300 seconds
- Configure CodeDeploy
- CodeDeploy Agent Installation included as part of Launch Template
- Configure CodeDeploy Deployment Group to EC2 Instances = Tag Name = RESTaurant-dev
- Configure CodePipeline
- Create CodePipeline Application
- Connect CP App with GitHub Repo (Master only so far)
- Have CodePipeline to deploy to Code Deploy deployment group
- Build Queue System for sending out User Email Verification upon Registration
- Display user details on the Bookings section of admin panel
- Demonstrate the other deployment types (Blue-Green, Rolling)
- Demonstrate Rollback process (Database Migration Executed, but deployment failed??)
- Take Database Snapshots
- Implement a few tests
- Build separate environments (Dev, Test, Q&A, Prod) and the promote process between these stages