The website link: http://yelpcamp.zityuen.com/
This is a website that complemented registering users, posting topics and adding comments to each topic. Also, each user has right to modify their topics and comments and other users cannot do that on topics and comments not belong to them. The whole website design based on the RESTful concept.
- Express
- Password
- Bootstrap
- MongoDB
- body-parser
- RESTful Design
- MVC Design
Three main routes: index, campgrounds, comments.
- The index route includes users' register, login and logout.
- GET("/register"): go to the page used to register user info.
- POST("/register"): post users' registering info to the register page and if there is no error, redirecting to the campgrounds page
- GET("/login"): go to the page used to log in.
- GET("/login") post users' logining info to login page and if there is no error, redirecting to the campgrounds page
- GET("/logout"): logout the user's info and redirecting to the campgrounds page
- The campgrounds route includes users' posting new campground to website or editing the campgrounds they have posted or deleting.
- GET("/campgrounds"): go to the campgrounds page that shows all campgrounds info
- POST("campgrounds"): allowing posting campgrounds if users have logged in. Else, it has no right to do this
- GET("/campgrounds/new"): allowing going to posting page if users have logged in. Else, asking users to log in
- GET("/campgrounds/:id"): go to a info page about one certain campground
- GET("/campgrounds/:id/edit"): go to edit campgrounds page if this campground topic belongs to the current user
- PUT("/campgrounds/:id"): put edited info about one certain campground which belongs to the current user and update them in database
- DELETE("/campgrounds/:id"): delete one certain campground which belongs to the current user
- The comments route includes users adding comments to each campground, editing themselves comments and deleting.
- GET("/campgrounds/:id/comments/new"): go to the page that users could add new comment to one certain campground if the user has logged in
- POST("/campgrounds/:id/comments"): post user's new comment to the one certain campground if the user has logged in
- GET("/campgrounds/:id/comments/:comment_id/edit"): go the page that the user could edit themselves comment
- PUT("/campgrounds/:id/comments/:comment_id"): put updated info about one comment that belongs to the current user
- DELETE("/campgrounds/:id/comments/:comment_id"): delete one certain comment of one certain campground and this comment belongs to the current user