We will be building a trip planning app that stores a list of trips for a user. The goal of this project is for you to practice everything you have learnt about building an API.
Users can create a trip, add waypoints to a trip (a list of stops a user will take in a trip) and mark a trip as completed.
Your API should contain/use:
- a non-relational database to store all our trips.(mongodb)
- a trips resource - you should be able to create, list, show, update and destroy trips.
- completed trips are marked as completed.
- unit tests for all routes.
When you are done with the Flask API, write an iOS client to connect and display the list of trips. Authenticate the user, display trips and a detail of the trip with waypoints and completed status of each trip.
Create unit tests for and then implement the following new resources and routes:
Action | HTTP Verb | Path | Effect |
---|---|---|---|
create | POST | /user | Creates a new user |
index | |||
show | GET | /user | Shows a specific user |
update | PUT/PATCH | /user | Updates/replaces a specific user |
destroy | DELETE | /user | Deletes a specific user |
Action | HTTP Verb | Path | Effect |
---|---|---|---|
create | POST | /trips | Creates a new trip |
index | GET | /trips | Shows/lists all trips |
show | GET | /trips/<trip_id> | Shows a specific trip |
update | PUT/PATCH | /trips/<trip_id> | Updates/replaces a specific trip |
destroy | DELETE | /trips/<trip_id> | Deletes a specific trip |
Backend:
-
User - Create/Update a user - post request
-
User - Get a user with a get request
-
Trips - Create a trip
-
Trips - Update a trip with completed status
-
Trips - Add waypoints to a trip (a list of named stops in a trip)
-
User - Sign up a user, hash the password
-
User - Sign in a user, check password with hash in database
iOS Client:
- Authenticates user with HTTP Basic Auth
- Display list of trips, trip waypoints and completed status of each trip