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.
- Fork and clone repo.
npm install
- Please create an JWT_KEY and put it into .env
- 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
createdb PackaVacay_dev
To create local development database.createdb PackaVacay_test
To Create local testing database.knex migrate:rollback
To rollback databaseknex migrate:latest
Add tables to the db.knex seed:run
Add the seeds to the db.swagger project edit
To run it locally in development mode.swagger project start
To Turn on swagger
- To test the routes, run
mocha test/api/controllers
- To test the migrations, run
mocha test/migrations
We are using:
- Swagger
- express
- knex
- body-parser
- cookie-parser
- jsonwebtoken
- bcrypt
- humps
-
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.