Skip to content

Database, API Endpoints, and Frontend Routes

Somorovd edited this page Jul 7, 2023 · 4 revisions
concord-schema

API Endpoints

Session

  • POST /api/auth/login -- login

  • GET /api/auth/logout -- logout

  • POST /api/auth/signup -- create new account

Users

  • GET /api/users/:userId -- display user info

  • GET /api/users -- display all users

Servers

  • GET /api/server/current -- get current user's servers

  • GET /api/server/join/:serverId -- join a public server (or redirects to server if already joined)

  • GET /api/server/:serverId -- get server info with channels if user is a member of server

  • POST /api/server/new -- create a new server

  • PUT /api/server/:serverId/edit -- edit server info if owner of server

  • DELETE /api/server/:serverId/delete -- delete a server if owner of server

  • POST /api/server/:serverId/channels -- create a new channel for a server if owner of server

  • GET /api/server/discover -- get all public servers

Channels

  • GET /api/channel/:channelId -- get list of messages in a channel

  • PUT /api/channel/:channelId/edit -- edit a channel's name if owner of server

  • DELETE /api/channel/:channelId/delete -- delete a channel if owner of server

Direct Message Chats

  • GET /api/communication/current -- get all active DM communications (show users you have DMs with)

  • POST /api/communication/new/:userId -- create a new DM communication

  • GET /api/communication/user -- get a list of users to create a new DM communication

  • GET /api/communication/:communicationId -- get all messages of a DM communication

Note: Direct Message Messages (the messages sent within a DM chat) and Channel Messages have full CRUD but use sockets so they do not have restful endpoints to list here.

Frontend Routes

  • "/" -- landing page

  • "/login" -- login form

  • "/signup" -- signup form

All routes that start with "/main" display a sidebar with links to the user's DMs, joined servers, create a server, and discover servers.

  • "/main/conversations" -- display all active DMs

  • "/main/conversations/:conversationId" -- display messages for a specific DM

  • "/main/channels/:serverId/:channelId" -- display channels within a server and messages within a specific channel.

  • "main/discover" -- display all public servers

Clone this wiki locally