FoodSloth is a proof-of-concept food delivery web application written as part of CS2102 Database Systems at the National University of Singapore.
It uses Node.js and Pug for its frontend, and Node.js with Express for its backend. It uses PostgreSQL for its database.
It is written with a primary focus on demonstrating the capabilities of PostgreSQL. As such, data validation and logical checks that would usually be integrated in code have been adapted to run as SQL triggers instead.
git clone https://github.com/dawo5010/cs2102.gitto clone the reponpm installto install relevant node modulesnpm install nodemonto install nodemon- Execute by running
nodemon app.js - Website is available on localhost:8000
note: the website is not available unlessnodemon app.jsis executing
- Navigate to the backend folder
- Duplicate the
settings_blank.jsfile - Rename the duplicated file to
settings.js - Fill in your SQL database login details in
settings.js npm installto install the relevant node modulesnpm install sql-template-stringsnpm install nodemonto install nodemon- Start server with
nodemon index.js - Backend is available at localhost:8001
- Ensure that PostgreSQL is installed
- Navigate to backend folder
- Run the command:
psql postgres - CREATE DATABASE project;
- Run the command:
\c project - Create tables using
sql/tables.sql - [OPTIONAL] Insert default values for each table according to the numerical order specified in the filenames of each sql file in the
sqlfolder - Follow step 2 - 4 of the Backend setup
- Run command:
npm i express pgto install Express for the server and node-postgres (pg) to be able to connect to PostgreSQL - Run command:
node index.js, list of all users in json format available on http://localhost:8001/users


