A feature-complete WhatsApp-style console chat application written in C++, demonstrating core OOP principles: encapsulation, inheritance, and polymorphism.
| Category | Details |
|---|---|
| Auth | Sign up, login, logout, change password |
| Private Chat | 1-on-1 messaging, re-opens existing chat automatically |
| Group Chat | Multi-member groups, admin roles, remove participants, set description, join requests |
| Messages | Send, reply (quoted), add emoji, delete own message, status tracking (Sent/Delivered/Read) |
| Utilities | Keyword search, export chat to .txt file |
| Account | Update status, phone number, password |
Chat (base)
├── PrivateChat – 1-on-1 with typing indicator
└── GroupChat – multi-user with admin management
User – credentials, status, last-seen
Message – content, timestamp, status, reply chain
WhatsApp – application controller / main menu
Requirements: any C++11-compliant compiler (g++, clang++, MSVC).
# Compile
g++ -std=c++11 -Wall -o whatsapp whatsapp.cpp
# Run
./whatsapp1. Sign Up → create an account
2. Login → enter credentials
3. Private Chat / Create Group → start chatting
Inside a chat:
1. Send message
2. Reply to message (quoted)
3. Add emoji (:heart:, :thumbsup:, …)
4. Delete my message
5. Search messages (keyword)
6. Export chat (saves to .txt)
4. Account Settings → update status / phone / password
5. Logout
whatsapp.cpp ← single-file implementation (all classes + main)
README.md
- Encapsulation — private members with public getters/setters in
UserandMessage - Inheritance —
PrivateChatandGroupChatboth extendChat - Polymorphism —
displayChat()is virtual;WhatsAppholds avector<Chat*>and dispatches dynamically - Composition —
Messageholds aMessage*for reply chains;WhatsAppownsChat*objects - RAII —
WhatsAppdestructor deletes all heap-allocatedChatobjects
MIT — free to use, modify, and distribute.