TalkItOut is a CRUD RESTful API server built using the mongo-cxx-driver and BSON. This application allows users to interact with a chat system via api, enabling functionalities such as signing up, signing in, creating rooms, sending messages, and retrieving messages over http.
- crow header only library already included.
- Mongdb need to be installed as internal dependency.
- Docker using docker to run quickly.
- clone the repo
git clone https://github.com/xpd54/TalkItOut.git
- create a build folder and build
mkdir build && cd build && cmake .. && make
- run mongodb
cd mongodb && docker compose up
in one terminal - update your local ip address or if using atlas-database use uri. here
docker compose up
and make get request tohttp://0.0.0.0:18080/health
to see if it's up.
talkitout-app-1 | (2025-02-04 11:17:21) [INFO ] Crow/master server is running at http://0.0.0.0:18080 using 4 threads
talkitout-app-1 | (2025-02-04 11:17:21) [INFO ] Call `app.loglevel(crow::LogLevel::Warning)` to hide Info level logs.
talkitout-app-1 | (2025-02-04 11:17:44) [INFO ] Request: 192.168.192.1:38464 0x113e710 HTTP/1.1 GET /health
talkitout-app-1 | (2025-02-04 11:17:44) [INFO ] Response: 0x113e710 /health 200 0
talkitout-app-1 | Current Version is set as 5
- Endpoint:
/health
- Method:
GET
- Description: Checks the health status of the application.
- Endpoint:
/signup
- Method:
POST
- Description: Registers a new user in the system.
- Request Body:
{
"user_name": "string",
"password": "string"
}
- Endpoint:
/signin
- Method:
POST
- Description: Authenticates a user and allows them to sign in.
- Request Body:
{
"user_name": "string",
"password": "string"
}
- Endpoint:
/create_room
- Method:
POST
- Description: Creates a new chat room.
- Request Body:
{
"chat_room_name": "string",
"user_id": "string"
}
- Endpoint:
/join_room
- Method:
POST
- Description: Allows a user to join an existing chat room.
- Request Body:
{
"chat_room_id": "string",
"user_id": "string"
}
- Endpoint:
/send_message
- Method:
POST
- Description: Sends a message to a specific chat room.
- Request Body:
{
"message_payload": "string",
"user_id": "string",
"chat_room_id": "string"
}
- Endpoint: /get_all_messages
- Method:
GET
- Query Parameters:
chat_room_id
: The ID of the chat room. - Description: Retrieves all messages from a specified chat room.
- Endpoint: /get_all_chat_rooms
- Method:
GET
- Query Parameters:
user_id
: The ID of the user. - Description: Retrieves all messages from a specified chat room.