This project focuses on the software engineering and architectural choices required to build a robust, production-ready Customer Relationship Management (CRM) console engine in modern C++. Designed for the real estate sector, the core objective is to ensure strict data integrity and reliable data persistence without relying on external database frameworks.
The application architecture is driven by a clean, object-oriented workflow:
- Object-Oriented Architecture: Implements an inheritance structure where polymorphic real estate interactions (
AppointmentandContract) extend a baseInteractionclass, linked dynamically via unique timestamps toCustomerprofiles. - In-Memory Integrity & Constraints: Leverages
std::unordered_sethash maps to enforce uniqueness constraints on client credentials and interaction titles in real-time. Input validation includes custom regex-based date parsing with full leap-year compliance. - Fault-Tolerant Persistence Layer: Features a custom CSV storage engine using string-escaping mechanisms to safely isolate user data from file formatting. The transactional parser includes selective section streaming, isolating and skipping corrupted records while safely rebuilding in-memory maps and object states.
The repository demonstrates a thorough software design process, focusing on memory efficiency, encapsulation, and bulletproof data handling.
InsuraPro Solutions is dedicated to improving the efficiency and quality of customer service for insurance companies, by developing an advanced Customer Relationship Management (CRM) system that facilitates the management of customer information and their interactions with the company.
Insurance companies need a systematic and centralized method for managing customer information and tracking interactions. Many current systems are fragmented or not user-friendly, hindering operational effectiveness and customer satisfaction.
InsuraPro Solutions will provide an interactive console application developed in C++ that will allow users to manage customer information and their interactions efficiently and intuitively, thereby improving customer service and internal management.
Project Requirements:
- OOP in C++: Implement OOP concepts to ensure a robust and flexible structure.
- Data Structure: Create a data structure to store customer information and their interactions.
- User Interface: Develop an interactive and intuitive command-line interface.
- Features:
- Add a Customer: Add new customers to the CRM.
- Display Customers: Display all customers currently in the system.
- Edit a Customer: Modify the details of an existing customer.
- Delete a Customer: Remove customers from the CRM.
- Search for a Customer: Search for customers by first name or last name.
- Interaction Management: Add, display, and search for interactions for each customer (interactions refer to sales force appointments and contracts signed).
- Data Saving and Loading: Save customer and interaction data to a file (text or CSV) and load it at startup.
User Interface: The interface will be command-line based, with a main menu offering clear options for all necessary operations, ensuring a smooth and accessible user experience.
Open your terminal and type the following commands (Linux/Mac):
g++ -std=c++17 -o my_exe main.cppwhere my_exe will be the executable file to build and main.cpp is the file to run.
Suggestion: run using version 17 or higher ( -std=c++17 ).
./my_exeto run the program.
- Use 4 classes - Customer, Interactions (father), Appointment (child) and Contract (child) - to manage the required instances plus another class CustomerContainer containing all the needed CRUD.
- A separate section made by two functions (
base_UI_flow(...)andinteractions_flow(...)) is used to manage the flow of user-input: the choice to separate the main flow and the flow of interaction-per-customer has been made in order to keep a logical separation between the two and to have more flexibility if there will be any future upgrade to the interactions' fields (contemplated by the data-structure). - Functions to manage file creation and load of data from file (
save_to_file(...)andload_from_file(...)) are in a separate section. - Afew other utility functions have been used to deal with minor tasks and are usually written in the most close-to-functionality section (methods inside classes and helpers like
acquire_name_surname()ormanage_unescape_single_comma(...)etc. in separate sections).
-
Split Interactions in 2 different classes (Appointment and Contract) in order to keep a better scalability.
-
- why? Appointment will realistically need only a title and a date while Contract could have more addictional info like "main details", "expire date contract", etc... that, using a single class Intercation, could lead to many empty fields and a less clean and less handleable code.
-
Not nesting class Interactions inside class Customer.
-
- why? To have a cleaner structure and a more free usage of these classes.
-
Customer has separate flow for find, edit and delete while for Appointment and Contract are hanled in the same section.
-
- why? while Contract gains a better usability having these actions separated, Appointment and Contract are Interactions related to a specific Customer so from a user perspective it keeps a more consistent logic of usage having them handled inside a single section (same typed action).
-
Better incapsulation to keep members private using getter/setter
-
Input validation (empty fields, valid date)
-
More try-catch controls for a stronger error management (along with avoiding recursion in create and edit objects' functions introducing while loop and a maximum attempt system for user insertion)
-
Data validation while loading from file (added controls: explicit check on duplicates and true-value validation for 'date')
-
Clean way to exit the program
-
Explicit use use std:: instead of using namespace std
-
User can now enter both lowercase or uppercase when selecting which action he wants to perform.
-
Tag with Appointment or Contract to recognise which type it is without having to rely on type of data structure.
-
UX: Search system that allows to find name, surname and title without exact macth (using regex or similar).
- coding: ProfAI, stackoverflow (timestamp, loops and few other points), w3school playground (https://www.w3schools.com/cpp/trycpp.asp?filename=demo_helloworld) to quick test some simple functions and prints.
- markdown syntax: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks .