CompFood (deployed at https://swe474.xor.fyi)
Our team is aiming for at minimum a functioning app that gathers prices from different meal delivery apps (data might be dummy data), displays different meal delivery options,redirecting the user to their preferred option.
- Get Data
- Scrape data manually or access from api's
- Show options
- Display prices of different options for a meal from the different meal service apps
- Database
- Store users in mongoDB
- Redirect
- Redirect users to their option of choice
- Andy Huang https://github.com/huang-a
- Ermias Berhane Merine https://github.com/ErmiasMerine
- Ryeem Zia https://github.com/RyeemZia
- Phillip Chae https://github.com/phillip-chae
- Minsu Seo https://github.com/seocahtoa
- We are all college students who use meal delivery apps and wanted a way to find the best prices
- For collaboration https://github.com/software-students-fall2021/project-setup-xinhua-coherent-compfood/blob/master/CONTRIBUTING.md
We are using npm
as our package manager and React as our framework. Steps to run:
- cd to the front-end directory
cd front-end
- install relevant packages
npm install
- launch React server (accessable at http://127.0.0.1:61002) (Note: http://localhost:61002 will NOT work because of CORS)
npm start
We are using npm
as our package manager and Express as our framework. Steps to run:
- cd to the back-end directory
cd back-end
- install relevant packages
npm install
- ensure that there is a
.env
file in the current working directory that looks like this with the appropriate values filled in
MONGO_DB_URL={url here}
MONGO_DB_USERNAME={username here}
MONGO_DB_PASSWORD={password here}
JWT_SECRET={jwt secret here}
- launch Express server (accessable at http://127.0.0.1:61001)
npm start
-
Get a VPS with a Ubuntu 26.01 image
-
Obtain the following files that will be necessary in later steps:
.env = (see backend and database steps)
pm2.config.js = deploy_steps/webhook_server/pm2.config.js with placeholder values replaced
certs.tar.gz = gzipped tar archive with fullchain.pem and privkey.pem corresponding to a valid SSL cert for the domain you are using
-
Replace
swe474.xor.fyi
with the domain name you are using in the nginx configs located indeploy_steps/config
-
Run the script
deploy_steps/1.setup_ubuntu_21_06
asroot
on the VPS -
Run the script
deploy_steps/2.make_app_user
asroot
on the VPS -
Run the script
deploy_steps/3.pull_repo
asapp
on the VPS -
Run the script
deploy_steps/4.setup_nginx
asroot
on the VPS -
Trigger a build on CircleCI with passing docker job
-
Add DNS A record to point from domain to VPS ip
Hi, for the deployment sprint, we have implemented both extra credit options. The continuous deployment works by having github fire off a webhook, when circleci says that the docker images have been built and pushed, to a express server that pulls the new images from docker hub and restarts the containers on the vps. To verify we have done so, you can look at the following files:
- for Docker/containerization:
https://github.com/software-students-fall2021/project-setup-xinhua-coherent-compfood/blob/master/back-end/Dockerfile
https://github.com/software-students-fall2021/project-setup-xinhua-coherent-compfood/blob/master/front-end/Dockerfile
https://github.com/software-students-fall2021/project-setup-xinhua-coherent-compfood/blob/master/docker_build.sh
- for continuous deployment:
https://github.com/software-students-fall2021/project-setup-xinhua-coherent-compfood/blob/master/deploy_steps/webhook_server/server.js
https://github.com/software-students-fall2021/project-setup-xinhua-coherent-compfood/blob/master/deploy_steps/webhook_server/redeploy_docker.sh
https://github.com/software-students-fall2021/project-setup-xinhua-coherent-compfood/blob/master/docker_pull.sh
https://github.com/software-students-fall2021/project-setup-xinhua-coherent-compfood/blob/master/docker_run.sh
https://github.com/software-students-fall2021/project-setup-xinhua-coherent-compfood/blob/master/docker_stop.sh
Steps to test:
-
follow build instructions for both front-end and back-end
-
load webpage
-
navigate from the home screen -> restaurant screen -> app selector screen -> previous order screen
-
make sure everything looks ok and nothing seems "broken" in terms of css/styling
Steps to test:
-
follow build instructions for back-end
-
run
npm run test-only
in the back-end directory for unit testing -
run
npm run test-cov
in the back-end directory for code coverage (+ unit testing)
-
Go to
https://{the domain you are using here}
-
Test functionality as you would test the frontend
- TBD