Welcome to Convene, the newest app to find friends, that special someone, or a companion for a local event. Logged in users can add and edit information about themselves, add their interests, create a list of other liked users to connect with, one-to-one chat with other users, and add local activity types they might be interested in attending.
This repo includes the backend code for running the chat server, creating the database, and serving the API for Convene.
The above diagram shows the various data tables and their relationships:
-
User: stores all data related to the user profiles including login information, "likes", interests, and potential meetup activities
-
Interest: stores a list of potential interests or hobbies that users can add to their profile. Users may also add interests if they are not already in the table. Also stores a list of all users who have added that interest to their profile.
-
Activity: stores a list of activity suggestions for users to meet up (ex. hiking, getting coffee), as well as information to find out more about local options for that activity. Users are able to add activites they would be interested in to their profile. This table stores a list of all users who have added it.
-
Message: Stores messages between users. Allows for persistent messages between browser sessions.
-
Chat: Stores conversations between users, including all messages in the conversation. Allows persistent list of conversations for each user
POST /register
creates a new User with provided inputs and sends a token- Request body should include email, first name, and password
- Password will be hashed in the database
POST /login
sends token if request credentials are correct- Request body should include email and password
User must be logged in for all routes:
GET /users
sends array of all users in the databaseGET /me
sends currently logged-in user object with all informationGET /users/:id
sends all information relating to a specific user, including likes, interests, and activitiesPATCH /me
allows the user to change information about their own profile, except for the password- Request body should include only the data to be changed about the user
PATCH /me/password
allows the user to update their password- Request body should include both the new and the old hashed password
DELETE /me
allows the user to delete their own account
GET /interests
sends array of all interests a user can add to their profilePOST /interests
allows a logged-in user to add a new interest to the table if it does not already exist
GET /activities
sends array of all currently available activity suggestions a user can add to their profileGET /activities/:id
sends all information relating to a specific activityPATCH /activities/:id
allows a logged-in user to add or remove an activity from their profile
GET /messages/:id
sends all messages for a given chatId to a logged-in userPOST /messages
saves all messages a logged-in user sends on the server- each message request should contain the chatId, senderId, and text content
- allows for persistent messaging across browser sessions
User must be logged in for all routes:
GET /chat/user-chats
sends all conversations the logged-in user is involved with- used to show conversation list
GET /chat/:id
sends the specific conversation bewtween the logged-in user and another user- request body should include the logged-in userId and the target userId
POST /chat
creates a new conversation between two users if one does not already exist- request body should include the logged-in userId and the target userId