Skip to content

kvinzheng/Travel-Package-Manager

Repository files navigation

Travel Package Manager - Galvanize Q2 Back End Project

For full documentation of the Travel Package API please visit:http://travel-package-project.herokuapp.com/api-docs/

Travel Package Manager is an api that allows travelers to store their favorite choices of hotels, flights and restaurants.

  • Everyone can search for a flights/restaurants/hotels. logged in users can create an account and add their favorite travel package to the database
  • Only logged in users/authenticated can view their own favorite choices of vacation packages.

Travel Package Manager is an API built with Swagger framework which provide an very detail documentation of the routes but also does validations when taking inputs. Vacation Package Manager uses Node.js Express framework and Knex.js to connect with a PostgreSQL database to store users, flights, hotel, and restaurants data. user authentication and authorization is transmitted and decoded using JWT. Travel Package Manager also use Mocha testing framework, Chai Library and Super Test NPM package for testing purposes.

Getting Started

  1. Fork and clone repo.
  2. npm install
  3. Please create an JWT_KEY and put it into .env
  4. Please register for Yelp Oauth Tokens to use the Yelp functionbility. PUT the CONSUMER_KEY, CONSUMER_SECRET, TOKEN, AND TOKEN_SECRET INTO .env
JWT_KEY=xxxxx
CONSUMER_KEY= xxxxx
CONSUMER_SECRET= xxxxx
TOKEN= xxxxx
TOKEN_SECRET= xxxxx
  1. createdb PackaVacay_dev To create local development database.
  2. createdb PackaVacay_test To Create local testing database.
  3. knex migrate:rollback To rollback database
  4. knex migrate:latest Add tables to the db.
  5. knex seed:run Add the seeds to the db.
  6. swagger project edit To run it locally in development mode.
  7. swagger project start To Turn on swagger

Testing:

  1. To test the routes, run mocha test/api/controllers
  2. To test the migrations, run mocha test/migrations

Our Technologies

We are using:

  • Swagger
  • express
  • knex
  • body-parser
  • cookie-parser
  • jsonwebtoken
  • bcrypt
  • humps

Feature list

  • Sign-Up: Creation of a user account

  • Sign-In: token, hashed password, validation(using token)

  • Get: users get a combination of favorite hotel, restaurant and flight

  • POST/PATCH: users send/update information on their workouts

  • Delete user account: remove the user account

  • Get flights(External API): user can view real time airline information and find out related ticket airline and departure date

  • Get restaurant(Yelp API): user can view local restaurants with a filter of rating from 0 - 5

  • Get hotel: user can get all the hotel information back.

Entity Relationship Diagrams