https://trip-ups.herokuapp.com/
Trip Up is an API to help you plan your group trips. Once a user has signed up, they have the option to create a new trip. Once they've created a new trip, they become the coordinator of that trip, giving them the ability to create new events related to their trip. Other users have the option to see all available trips within the API and can signup for a trip of their choice. The coordinator of the trip they signup for has the ability to approve or deny their signup.
- Express
- MySQL
- Sequelize
- JSON Web Tokens
- JSDoc
- Config
- Base-64
- Bcrypt
- Jest
- Install mysql
- Install httpie to interact with the API
npm i
to install all dependencies.- run
node index.js
to start server and connect to database - Create a .env with PORT, DB_PASSWORD, SECRET, and DEFAULTROLE=2
-
As a user you can:
-
Signup:
- Input:
$ http POST :3000/signup email=<email> name=<name> password=<password> city=<city> phone=<phone-number> picture=<img-url>
- Output: Token
- Input:
-
Signin:
- Input:
$ http -a email:password POST :3000/signin
- Output: New Token
- Input:
-
Create a Trip:
- Input:
$ http POST :3000/trips "Authorization: Bearer <token>" name=<name-of-trip> destination=<destination-of-trip> start_day=<start-date> end_day=<end-date> cost=<numeric-value-of-cost> type=<type-of-trip>
- Output: New trip added to trip database
- Input:
-
See a list of all trips available:
- Input:
$ http GET :3000/trips "Authorization: Bearer <token>"
- Output: A list of all trips available to signup for
- Input:
-
Signup for Trip:
- Input:
$ http POST :3000/trip-signups/<trip_id> user_id=<user_id>
- Output:
Trip sign-up pending approval
- Input:
-
See a list of trips you have signed up for:
- Input:
$ http GET :3000/trips?attending=true "Authorization: Bearer <token>"
- Output: List of trips signed up and approved for
- Input:
-
-
As a trip organizer you can:
-
View a list of pending trip signups:
- Input:
$ http GET :3000/trip-signups trip_id=<trip_id> organizer_user_id=<user_id_of_organizer>
- Output: List of all users pending singup to the organizers trip
- Input:
-
Approve/Deny users signing up to your trip:
- Input:
$ http PUT :3000/trip-signups/<trip_id> organizer_user_id=<organizer_user_id> user_id=<user_id> approval=<boolean_value>
- Output:
"Signup Approved!"
- Input:
-
Update your trip details:
- Input:
$ http put :3000/trips/<trip id> <trip fields> "Authorization: Bearer <token>"
- Output: Event details updated
- Input:
-
Add events to your trip:
- Input:
$ http POST :3000/events/<trip-id> organizer_user_id=<id> name=<name> start_day=<day> end_day=<day>
- Output: Event added to event database
- Input:
-
Update your events:
- Input:
$ http PUT :3000/events/<event_id> organizer_user_id=<organizer_user_id> name=<name-updating-to>
- Output: Updates name of event
- Input:
-
Delete events on your trip:
- Input:
$ http delete :3000/events/<event_id> organizer_user_id=<organizer_user_id>
- Output: Event deleted from database
- Input:
-
Delete the trip you created:
- Input:
$ http delete :3000/trips/<trip id> "Authorization: Bearer <token>"
- Output: Trip deleted from database
- Input:
-
-
As an Admin you can:
Tyler Sayvetz, Cait Rowland, Kevin Dreyer, and Susanna Lakey