Skip to content

Boqian-Ma/mymenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyMenu - a restaurant ordering system written in GoLang and React.js

MyMenu

Installation

Install and setup VirtualBox

Follow installation and setup instructions https://webcms3.cse.unsw.edu.au/static/uploads/course/COMP9900/21T2/f27d53fa0797fbf9320dbe4b8ebc860988729b919247e127ed856cb3948066f4/VirtualBoxGuide.pdf

Clone the git repo

cd ~
git clone https://github.com/COMP3900-9900-Capstone-Project/capstoneproject-comp3900-w16a-jamar.git

Set up SSH (Optional)

Set up SSH to make dev easier with your own command line rather than command line on the VM GUI

  1. Before starting VM, open settings -> Network -> Adapter 1 -> Attached to and select Bridged Adapter
  2. Update and upgrade
sudo apt update
sudo apt upgrade
  1. Install openssh
sudo apt install openssh-server
  1. Verify that SSH server is running
sudo service sshd status
  1. Configure firewall and open port 22
sudo ufw enable
sudo ufw allow ssh
  1. Check that SSH is correctly configured
sudo ufw status
  1. Find IP address of VM
ip a | grep "inet 192"
# if more than 1 result is printed, either should work
  1. Connect to VM via host machine with password 'lubuntu'
ssh lubuntu@<ip address of vm>
  1. Add host SSH keys to ~/.ssh/authorized_keys to eliminate need to enter password

Install packages

Update and Upgrade

sudo apt-get update
sudo apt-get upgrade

Git

sudo apt-get install git

npm and yarn

sudo apt-get install npm
sudo npm install -g yarn

curl

sudo apt install curl

Restart the shell

react-scripts and typescript

cd ~/capstoneproject-comp3900-w16a-jamar/frontend
npm install react-scripts
yarn add typescript
yarn add qrcode.react

Golang

  1. Download Go binary
cd ~
wget https://dl.google.com/go/go1.16.5.linux-amd64.tar.gz
  1. Verify Go tarball
sha256sum go1.16.5.linux-amd64.tar.gz

Output should look something like

Output
b12c23023b68de22f74c0524f10b753e7b08b1504cb7e417eccebdd3fae49061  go1.16.5.linux-amd64.tar.gz
  1. Extract Go tarball
sudo tar -C /usr/local -xzf go1.16.5.linux-amd64.tar.gz
  1. Add Go to $PATH
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
  1. Load new path into current shell
source ~/.profile
  1. Verify Go installation
go version

Should have output

go version go1.16.5 linux/amd64
  1. Install Golang database library
go get -u github.com/lib/pq

Go Migrate

  1. Install migrate
curl -s https://packagecloud.io/install/repositories/golang-migrate/migrate/script.deb.sh | sudo bash

sudo apt install migrate

PostgreSQL

  1. Install PostgreSQL
sudo apt install postgresql postgresql-contrib
  1. Check PostgreSQL is running
sudo service postgresql status

If not on, run

sudo service postgresql start
  1. Login to postgres and open psql shell
sudo su postgres
psql

Can inspect users with \du in psql shell
4. Give user postgres a password

ALTER USER postgres WITH PASSWORD 'password';
  1. Exit back to user lubuntu

Docker

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04

  1. Update
sudo apt update
  1. Install prerequisite packages
sudo apt install apt-transport-https ca-certificates curl software-properties-common
  1. Add GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  1. Add Docker repo
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
  1. Update with new Docker packages and install Docker
sudo apt install docker-ce
  1. Verify that Docker is running
sudo service docker status

Docker Compose

  1. Download docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  1. Apply permissions
sudo chmod +x /usr/local/bin/docker-compose
sudo chmod 666 /var/run/docker.sock

Loading testing data from CSV Files (Optional)

A number of csv files containing testing data are located in

~/capstoneproject-comp3900-w16a-jamar/backend/migrations
  1. To load these data, first run
cd ~/capstoneproject-comp3900-w16a-jamar/backend
sudo service postgresql stop
make db-stop
make db-start
make migrate-reset
make migrate-down
make migrate-up

make load-data # will load lots of dummy data
make core-run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published