Giter Site home page Giter Site logo

anhdv1 / restaurant Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lucasfdsilva/restaurant

0.0 0.0 0.0 1.87 MB

This is an application built to be used as a platform to demonstrate to customers how AWS services can be used in modern applications.

License: MIT License

JavaScript 69.61% Shell 1.86% HTML 0.41% CSS 28.12%

restaurant's Introduction

RESTaurant - Management System

This is an application built to be used as a platform to demonstrate to customers how AWS services can be used in modern applications.

How it works

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.

How to Install

#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

Functionality Requirements Development

  • 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
  • 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

CI/CD Pipeline Configuration Tasks

  • 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

To-do

  • 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

restaurant's People

Contributors

lucasfdsilva avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.