https://github.com/misaghmomenib/phonebook-cpp
A Phone Book Application Built With C++, Designed to Efficiently Manage Your Contacts. This Project Includes Features Like Adding, Searching, Editing, and Deleting Contact Details. It's a Simple Yet Powerful Tool to Demonstrate C++ Fundamentals and Object-oriented Programming Concepts.
https://github.com/misaghmomenib/phonebook-cpp
cpp git open-source phonebook
Last synced: 2 months ago
JSON representation
A Phone Book Application Built With C++, Designed to Efficiently Manage Your Contacts. This Project Includes Features Like Adding, Searching, Editing, and Deleting Contact Details. It's a Simple Yet Powerful Tool to Demonstrate C++ Fundamentals and Object-oriented Programming Concepts.
- Host: GitHub
- URL: https://github.com/misaghmomenib/phonebook-cpp
- Owner: MisaghMomeniB
- License: mit
- Created: 2025-01-24T07:27:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-13T20:07:21.000Z (about 1 year ago)
- Last Synced: 2025-06-13T21:20:48.049Z (about 1 year ago)
- Topics: cpp, git, open-source, phonebook
- Language: C++
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π PhoneBook (C++)
A simple yet powerful **consoleβbased phone book application** in modern C++ (C++11+), allowing you to store, search, edit, and delete contact details with ease.
---
## π Table of Contents
1. [Overview](#overview)
2. [Features](#features)
3. [Tech Stack & Requirements](#tech-stack--requirements)
4. [Installation & Build](#installation--build)
5. [Usage Examples](#usage-examples)
6. [Code Structure](#code-structure)
7. [Persistence & File Format](#persistence--file-format)
8. [Extensibility & Tips](#extensibility--tips)
9. [Contributing](#contributing)
10. [License](#license)
---
## π‘ Overview
This application manages a simple phone book using a console menu interface. You can add, view, search, update, and delete contacts. It's a great foundation for learning file I/O, data structures, and modular C++ program design.
---
## β
Features
- β **Add contacts** with name, phone number, email, and (optional) address
- π **Search contacts** by name or part of name
- π **Edit contacts** to update any field
- β **Delete contacts** safely with confirmation
- π **List all contacts** in tabular format
- πΎ **Persistent storage** via a JSON or CSVβlike file (e.g., `contacts.db`)
- π **Console menu** for easy navigation
---
## π οΈ Tech Stack & Requirements
- **C++11+** (compatible with g++, clang++, or MSVC)
- Uses ``, ``, ``, `` from standard library
- No external dependencies or frameworks
---
## βοΈ Installation & Build
```bash
git clone https://github.com/MisaghMomeniB/PhoneBook-Cpp.git
cd PhoneBook-Cpp
g++ -std=c++11 -o phonebook src/*.cpp
````
Or, using CMake:
```bash
mkdir build && cd build
cmake ..
make
```
Runs on:
* **Linux/macOS**: `./phonebook`
* **Windows**: `phonebook.exe`
---
## π Usage Examples
On startup:
```
=== PHONE BOOK ===
1) Add Contact
2) Search Contact
3) Edit Contact
4) Delete Contact
5) List All Contacts
6) Exit
Select option:
```
### Add Contact:
```
Enter name: Alice Smith
Enter phone number: +1-555-1234
Enter email: alice@example.com
Enter address (optional): 123 Maple St
β
Contact added with ID 3
```
### Search:
```
Search term: Alice
Found:
ID: 3 | Name: Alice Smith | Phone: +1-555-1234 | Email: alice@example.com
```
### Edit:
```
Enter ID: 3
New name (current: Alice Smith): Alicia Smith
...updates...
β
Contact updated.
```
---
## π Code Structure
```
PhoneBook-Cpp/
βββ src/
β βββ main.cpp # Entry point + menu logic
β βββ PhoneBook.cpp # Core class implementation
β βββ Contact.cpp # Contact entity class
β βββ utils.cpp # File I/O & validation helpers
βββ include/
β βββ PhoneBook.hpp
β βββ Contact.hpp
β βββ utils.hpp
βββ README.md # This file
```
* `Contact` holds data fields & validation
* `PhoneBook` manages contact list and CRUD operations
* `utils` handles file read/write (JSON/CSV) and input checks
---
## πΎ Persistence & File Format
Contacts are saved to `contacts.db` (structured in JSON or CSV format):
```json
[
{
"id": 1,
"name": "Alice Smith",
"phone": "+1-555-1234",
"email": "alice@example.com",
"address": "123 Maple St"
},
...
]
```
Upon launch, it loads the file; changes are saved after operations.
---
## π§ Extensibility & Tips
* ποΈ Support multiple formats (XML, SQLite DB)
* π Add grouping/tags (family, work, etc.)
* π΅οΈββοΈ Add fuzzy search or phone/email validation via regex
* π Add CSV import/export option
* π Architect GUI version later using Qt or ncurses
---
## π€ Contributing
Contributions welcome! To add features or improvements:
1. Fork the repository
2. Create a branch (`feature/...`)
3. Document changes clearly
4. Submit a Pull Request for review
---
## π License
Licensed under the **MIT License** β see `LICENSE` for details.