Initial Planning Notes - jpnws/bassline GitHub Wiki
Flows
Auth flow
User goes to path URL: /signup.
Sign up form shows. User inputs username and password, then submits.
Validate data.
Request POST /signup - back end validates data, then creates.
User is automatically logged in and redirected to the homepage.
User clicks logout button.
Request POST /logout user gets logged out and redirected to homepage.
User clicks signin button.
User is routed to signin form page path URL: /signin.
User inputs username/password and submits.
Request POST /signin - verifies and logs user in.
If successful, user is redirected to the homepage.
User flow
User visits the app. The homepage path https://www.example.com
Request GET /boards/:id/posts - where boardId (:id) should be 1, display a list of all the posts corresponding to boardId 1. Note: there will always be only a single board for the purpose of this app.
User clicks on one of the posts.
Request GET /posts/:id - to retrieve the post details.
User is routed to /boards/1/posts/:id URL path.
Once the user lands on the post's page:
Request GET /posts/:id/comments - to retrieve the post's comments.
Populate the post's comments on the page.
The user happens to be the author of the post.
User clicks the edit button for the post.
User is taken to /posts/{postId}/edit URL path.
User makes changes and submits.
Request PUT /posts/:id - to update post.
User doesn't like the post, so clicks delete button.
Request DELETE /posts/:id - to delete the post.
User is redirected to the homepage.
The user decides to create a new post.
User clicks on the "Create post" button on the home page.
The user is routed to URL path /posts/new.
User fills out the forms and submits.
Request POST /posts with payload.
User is redirected to /boards/1/posts/:id URL path.
Where :id is the postId of the newly created post.
User decides to write some comments on their own post.
The comment box is already visible/rendered.
User types in some comment and clicks the submit button.
Request POST /comments - to create new post with payload containing post's ID.
Upon comment submission, page re-fetches comments.
Request GET /posts/:id/comments - to retrieve the post comments.
Render all the comments associated with the post.
The user decides to edit the comment, so clicks edit link next to comment.
A text box appears with the comment's text.
User edits the text and clicks save.
Request PUT /comments/:id - to save the change.
Upon comment edit, page re-fetches comments.
Request GET /posts/:id/comments - to retrieve the post comments.
Render all the comments associated with the post.
The user decides to delete the comment so clicks delete button.
Request DELETE /comments/:id - to delete the comment.
Upon comment deletion, page re-fetches comments.
Request GET /posts/:id/comments - to retrieve the post comments.