Skip to content

yyuanxin/OTOT_CS3219_TaskB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS3219 OTOT Assignment Task B

a. Set up to run project locally

  1. Clone project to local machine
  2. Go to root of project directory
  3. run npm install in your terminal
  4. run npm run install-client in your terminal
  5. run npm run install-server in your terminal

b. Run project locally

  1. Follow instructions to set up project on local machine from above (section a)
  2. run npm start

c. Run test locally

  1. Follow instructions to set up project on local machine (section a)
  2. run npm run test on root of project directory
  • Mocha testing should start running

d. Access deployed API on a serverless service (Google Cloud Function)

Deployed API links:

  1. Main page: https://us-central1-cs3219-otot-taskb.cloudfunctions.net/cs3219-otot-function
  2. Subpage: https://us-central1-cs3219-otot-taskb.cloudfunctions.net/cs3219-otot-function/api
  3. Contacts API page: https://us-central1-cs3219-otot-taskb.cloudfunctions.net/cs3219-otot-function/api/contacts

Refer to master branch of the project to view Travis deployment status

Task B1: Running the API locally

Additional Requirements:

Instructions:

  1. Refer to project set up on local machine (section a)
  2. Refer to instructions to run project locally (section b)
  3. Enter url as http://localhost:4000/api/contacts in Postman

GET request

Get all contacts
url: http://localhost:4000/api/contacts

Get specific contact
url: http://localhost:4000/api/contacts/{contact_id}
contact_id: unique identifier of contact object

POST request
url: http://localhost:4000/api/contacts

Submit request with the following fields
name : String (required)
email : String (required)
gender: String - Female / Male (required)
phone: 8 digits long (required)

PUT request
url: http://localhost:4000/api/contacts/{contact_id}
contact_id: unique identifier of contact object

Submit request with the at least one of the fields
name : String
email : String
gender: String - Female / Male
phone: 8 digits long

DELETE request
url: http://localhost:4000/api/contacts/{contact_id}
contact_id: unique identifier of contact object

Task B1/B3: Accessing deployed API

Additional requirements to make REST API calls:

Instructions:

  1. Refer to section d to access API on google cloud function
  2. Refer to task B1 guide above to make API calls but replacing the url as https://us-central1-cs3219-otot-taskb.cloudfunctions.net/cs3219-otot-function/api/contacts in Postman

Task B2: Running test locally and via travis

Instructions:

  1. Refer to section c to run test locally

Refer to localhost branch of the project to view Travis status on automate testing

Task B4: Set up frontend

Instructions:

  1. Refer to section b to setup and run frontend application
  2. Enter http://localhost:8080 on your browser

UI components:

Tech Stack

  • Vue (Frontend)
  • Mongodb (Database)
  • NodeJS & ExpressJS (Backend)
  • Google Cloud Function (Serverless Service)
  • MochaJS (Test)
  • Travis (CI/CD)

About

CS3219 OTOT Assignment Task B

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published