-
Notifications
You must be signed in to change notification settings - Fork 0
Frontend Routes
Zachary Duvall edited this page Jan 5, 2021
·
41 revisions
User-facing routes
Login Page
Routes Used
- GET
/users/login-- show form to login - POST
/users/login-- login user
Logout button in navbar, authentication required to access
Route Used
- GET
/users/logout-- logout user
Sign Up page
Routes Used
- GET
/users/sign-up-- show form to create user - POST
/users/sign-up-- create user and login user
Authentication required to access
Navigation bar, forest with list of trees
Routes Used
- GET
/users-- list all users without details (just userName and climber score), default ordered by PK - GET
/users/:id-- show user page with their climber score and forest (all trees marked as "climbed" or "want to climb")
See API Documentation for details on toggling between "climbed" and "want to climb"
Stretch Route
- GET
/users/:id/reviews-- show all reviews a user has written
Authentication required to access
Navigation bar, list trees, details for specified tree, review tree, mark tree (add to forest as climbed or want to climb)
- Stretch: Tree edit form, tree delete button
Routes Used
- GET
/trees-- list all trees without details (just name and avg scores), default ordered by PK (essentially our home page) - GET
/trees/new-- show form to create tree - POST
/trees-- create tree - GET
/trees/:id-- show specified tree with details (description, location, avg ratings, corresponding reviews...)
Stretch Route
- GET
/trees/:id/edit-- show form to edit tree
See API Documentation for details on marking trees as "climbed" or "want to climb"
Authentication required to access
Navigation bar, form to review a tree
Routes Used
- GET
/reviews/new-- show review form - POST
/reviews-- create review
-
layout.pugfor nav bar (all pages extend this) -
utils.pugfor:-
treemixin for undetailed view of a tree -
validationErrorSummarymixin for displaying errors -
fieldmixin for creating fields in our forms
-
- Trees
-
all-trees.pugto view list of all trees (use tree mixin) --GET/trees -
tree.pugto view details of a specific tree --GET/trees/:id -
create-tree.pugto view form to create a new tree (use validationErrorSummary mixin and field mixin) --GET/trees/new -
review-tree.pugto view form for creating a review (use validationErrorSummary mixin and field mixin) --GET/reviews/new
-
- Users
-
user.pugto view user’s forest and climber score (use tree mixin) --GET/users/:id -
login.pugto view form to login (use validationErrorSummary mixin and field mixin) --GET/login -
sign-up.pugto view form to register/create a user (use validationErrorSummary mixin and field mixin) --GET/signup -
highest-climber.pug(stretch goal) to view all users ranked by climber score --GET/users
-