A terminal-based C++ social networking application built around object-oriented design, relationship management, and file-backed persistence.
- Account registration, validation, login, and profile updates
- User search and profile discovery
- Post creation and personal timelines
- Likes and comments on user posts
- Friend requests, approvals, and friend lists
- Direct messages between connected users
- Group creation, discovery, membership, and discussions
- Page creation, discovery, and membership
- Persistent users, posts, relationships, chats, groups, and pages
- Interactive terminal session with a clear command menu
| Component | Responsibility |
|---|---|
User |
Account identity, credentials, and profile information |
Post |
User-authored timeline content |
Comment |
Responses attached to posts |
Message |
Timestamped direct and group messages |
Community |
Shared model for groups and public-interest pages |
SocialNetwork |
Validation, authentication, persistence, relationships, content, and session workflows |
| Layer | Technology |
|---|---|
| Language | C++17 |
| Interface | Interactive terminal |
| Architecture | Object-oriented classes and service-style manager |
| Persistence | Atomically written, encoded TSV records |
| Build | CMake or direct compiler invocation |
| Supported Compilers | GCC, MinGW, MSVC, Clang |
.
|-- src/
| `-- main.cpp
|-- .vscode/
| |-- tasks.json
| `-- launch.json
|-- CMakeLists.txt
|-- .gitignore
`-- README.md
Runtime records are created automatically inside the ignored data/ directory.
cmake -S . -B build
cmake --build buildRun on Windows with a Visual Studio generator:
.\build\Debug\social-network.exeRun with a single-configuration generator:
.\build\social-network.exeRun on Linux or macOS:
./build/social-networkg++ -std=c++17 -Wall -Wextra -pedantic src/*.cpp -o SocialNetwork.exe
.\SocialNetwork.exeg++ -std=c++17 -Wall -Wextra -pedantic src/*.cpp -o social-network
./social-networkThe included VS Code configuration targets the Microsoft C++ debugger:
Ctrl+Shift+Bbuilds the applicationF5builds and launches it in the integrated terminal
Update the compiler path in .vscode/tasks.json when Visual Studio is installed in a different location.
- Start the program and choose
signuporlogin. - Register with a valid password and
YYYY-MM-DDbirthdate. - Sign in to open the persistent session menu.
- Create posts, search users, manage friendships, message friends, or browse groups and pages.
- Use
logoutto return to the authentication screen. - Use
exitto close the application.
Runtime state is stored in the ignored data/ directory:
- Records use percent-encoded, tab-separated fields so user input cannot corrupt the file structure.
- Writes use temporary files and atomic replacement to reduce partial-write corruption.
- User IDs include time and random entropy, avoiding same-second collisions.
- Relationships, reactions, memberships, and requests are deduplicated.
- Passwords are stored as salted digests rather than plaintext.
The credential digest is intentionally dependency-free for this educational terminal project. A network-facing production system should replace it with Argon2id, scrypt, or bcrypt and use a transactional database.
Run the built-in end-to-end self-test:
.\SocialNetwork.exe --self-testThe test validates registration, duplicate prevention, login, posts, unique reactions, comments, friendships, messaging, communities, and persistence after reloading the application.