Frontend Routes - Dedition/WhoDis GitHub Wiki

Home Page

  • GET /
    • Landing page displays the main page, login button, and as well as other navigational routes belonging to this page such as the sign up link, informational links, etc.

Login Page

  • GET /login
    • Displays a login form allowing the user to either login, click on a link which navigates them to the sign up page or use a Demo User account if they are yet to create an account.
    • This route makes a GET request to api/users/:id in order to verify the user, as well as the initiate a user session.

Signup Page

  • GET /Signup
    • This page displays a form that allows the user to sign up. Providing invalid data prompts the user to correctly resubmit the data that was entered incorrectly.
  • POST /Signup
    • This request will log the user in, and display the /server/:username page as described below
    • This route will make a POST request to /api/users in order to register a user.

Servers

  • GET /servers

    • Servers are rooms with channels, channels are chat rooms that belong to servers. A server can host many channels. This route will display a list of all of the available servers to the logged in user.
    • This route makes a fetch request to all servers available on our site if needed via /api/servers
  • GET /servers/:username

    • This is a specific route dedicated to a user upon logging into their account.
    • This route will display a sidebar with all servers to the left-half, and all direct messages on the right-half of the sidebar.
    • This route allows ease of use upon logging in, allowing the user to navigate to either any server, or direct message available to them.
    • This route makes a fetch request to /api/servers_users/:id in order to find the servers the user belongs to.
  • GET /servers/:serverId

    • When the user navigates to a server, they will be shown a list of all channels available to the server. The user can access any channel within said server at this route.
    • In order to display the channels belonging to a server, this route will make a GET request to /api/channels/id WHERE /api/servers/:id

Channels

  • GET /channels/:channelId
    • This route displays the name of the channel, the name of the server the channel belongs to, all of the chats within the channel, as well as all of the users belonging to the channel.
    • This route will make a GET request to /api/channels/:id
    • In order to view all of the chats within a channel, this route will make a GET request to /api/messages WHERE /api/channels/:id

User Account Page

  • GET /account/:username
    • This route is specific to the structure of our clone, allowing the user to edit their personal information such as username, email, profile picture, header image, and more.
    • This route will make a GET request to /api/users/:id
    • Any changes to the users personal information will make a POST request to /api/users/:userId