MyTrails is a full stack application that crowd-sources reviews of hiking trails. The site's parks, trails, and reviews are available to guest users (not logged in). Authenticated users can add new parks and trails or add a review to a trail. Authenticated users also can edit or delete their own reviews.
Access the app here: MyTrails
- Lanaguages: HTML, CSS, Javascript
- Frameworks: Node.js, Express, EJS
- Authentication: OAuth (Google)
- Data Model: MongoDB
- APIs: Mapbox API (https://docs.mapbox.com/mapbox-gl-js/api/)
| HTTP METHOD (Verb) | URL (Nouns) | CRUD | Response | Notes |
|---|---|---|---|---|
| GET | / |
READ | Loads Home page | |
| GET | /auth/google |
READ | Directs to Google login | |
| GET | /auth2callback |
READ | Returns { user } |
Select or create user in database |
| GET | /logout |
READ | Log out | |
| GET | /parks |
READ | Array of [{park}, {park}] |
|
| GET | /parks/new |
READ | Form to create new { park } |
Guest users directed to login |
| POST | /parks |
CREATE | Add a new { park } |
|
| GET | /parks/:id |
READ | { park } |
|
| GET | /trails |
READ | Array of [{ trail }, { trail }] |
|
| GET | /trails/new |
READ | Form to create new { trail } |
Guest users directed to login |
| POST | /trails |
CREATE | Add a new { trail } |
|
| GET | /trails/:id |
READ | { trail } |
|
| GET | /reviews |
READ | Return { user } |
List of user's reviews |
| PUT | /reviews/:id |
UPDATE | Modifies a { review } the user wrote |
|
| DELETE | /reviews/:id |
DESTROY | Deletes a { review } the user wrote |
- AAU, I want to create an account.
- AAU, I want to login/logout of my account.
- AAU, I want to see a list of all parks.
- AAU, I want to see a list of park's trails.
- AAU, I want to see a list of all trails.
- AAU, I want to read reviews of a trail.
- AAU, I want to create a new park.
- AAU, I want to create a new trail for a park.
- AAU, I want to create a review of a trail.
- AAU, I want to view all of my reviews.
- AAU, I want to update my reviews.
- AAU, I want to delete my reviews.
- Users login using Google OAuth.
- Without logging in, guests can:
- View a list of trails
- View a trail's reviews
- When users login, they can:
- Create a review for a trail
- View a list of reviews they wrote
- Update a review they wrote
- Delete a review they wrote
- When a guest attempts to access user-only resources (like writing a review), direct user to login.
- "My Reviews" only displays in the navigation bar if a user is logged in.
- Embed Mapbox in the
/page- Use API to display markers representing parks on the map
- Allow users to click a marker containing a clickable link to the park's page
- Update data model
- Create Parks collection, where the park document contains the address and location ([longitude,latitude])
- Embed Trails in park document (Name and Distance)
- Expand navigation after updating data model
- Allow users to view list of parks
- Allow users to to click on a park to view its address and trails
- Allow users to click on a trail (on a specific park's page) to navigate to the trail's page
- Add trail count to Parks page
- Select the park in the form on the New Trail page if user navigated from a park's page
- Redirect users back to the parent park's page after creating a trail
- Add trail's average rating to
/trailsand/trails/:id - Implement sorting for
/parksand/trails - Implement search for
/parksand/trails




