Discord in the terminal using raw sockets in C++.
- Logging in or signing up a new user
- Creating a server
- Joining servers
- Adding friends
- Adding friends to servers
- Chatting in a server
There's 3 main components:
- Server:
- Allows several clients to connect to it and send messages to each other
- When it detects a message from one client it broadcasts it to several others
- It boots up all the servers listed in the
serversdatabase so that users that are a part of that server can join it via a socket
- HTTP Server:
- This creates a REST API so the server and client can interact with the database
- It manages a json database where it reads and writes to json files
- It routes requests to different functions to do something like write to the database or get some information
- Client:
- This createa TUI for the user to interact with
- It sends requests to the HTTP server for getting this like user and server information
- It allows users to perform operations such as creating servers, adding friends, and joining servers
Here's an Excalidraw document that has flowcharts for each of the components:

- Vcpkg for packagement
- CPR for curl requests in C++
- Spdlog for logging
- JSON for Modern C++ for parsing and stringifying JSON objects
- NCurses for the chat UI on the client side
- CMake for building the project
Feel free to reach out to me via any of the contact methods below: