A simple command-line application that allows users to search for duplicate emails and search for clients by name.
- Search for duplicate emails
- Identifies and displays all clients with duplicate email addresses
- Search by client name
- Search for clients by full or partial name
- Case-insensitive matching
- Project Features
- Core Technologies
- Project Installation and Setup
- Usage
- Project Structure
- Testing
- Assumptions and Design Decisions
- Known Limitations
- Future Improvements
- Next Priorities
- Author
- Language: Ruby
3.4.4 - Bundler:
2.4.1
- Ensure you have the following installed:
- Ruby
3.4.4 - Bundler
2.4.1
- Ruby
-
Clone the Repository:
git clone git@github.com:Prepsa/clients-search.git cd clients-search -
Install Dependencies:
bundle install -
Prepare data: Place the client data in the
db/data/clients.jsonfile. Example format:
[
{
"id": 1,
"full_name": "John Doe",
"email": "john.doe@gmail.com"
},
{
"id": 2,
"full_name": "Jane Smith",
"email": "jane.smith@yahoo.com"
}
]Run the application from command line:
ruby bin/runner.rb clients-search/
├── bin/
│ └── runner.rb # Application entry point
├── db/
│ └── data/
│ └── clients.json # Sample client data
├── lib/
│ └── search/
│ ├── client.rb # Client model
│ ├── client_loader.rb # Data loading and parsing
│ ├── utils.rb # Search and display utilities
│ └── search.rb # Main application logic
└── spec/ # Test files
├── lib/
│ └── search/
└── spec_helper.rb # Test configuration
To run the test suite:
bundle exec rspec- Data Source:
- The application assumes that the client data is stored in a JSON file.
- The JSON file should be placed in the
db/data/clients.jsondirectory. - Expects specific fields in the JSON file:
id,full_name, andemail.
- Search Functionality:
- The name search is case-insensitive.
- The search is partial, meaning it will match any part of the name.
- Error Handling:
- Basic input validation is implemented.
- Handling of missing or invalid data is implemented.
- The entire dataset is loaded into memory
- The application does not handle large datasets efficiently.
- The search functionality if limited to name and email.
- There is no pagination for large result sets.
- The application does not allow for data modifications.
- Limited error handling.
- Dynamic field search: Allow users to search any client field (not just name), e.g., id, other fields.
- Configurable file source: Allow users to specify the file source for the client data.
- REST API Interface: Allow users to access the application via a REST API with Rails API implementation.
- Scalability and Performance:
- For large datasets, store data in a database (e.g. PostgreSQL).
- Implement pagination for large result sets in both CLI and API.
- Code Quality Improvements:
- Code Quality Improvements
- Add RuboCop and Reek for linting and code smell detection.
- Add detailed logging and error handling.
- Advanced Features:
- Improvement in search functionality to support fuzzy search.
- Improvement in search functionality to check for invalid input and data(including special characters).
- Export results to CSV or JSON for reports or integrations.
- Deployment: Dockerize the app for easy deployment and environment consistency.
- Dynamic field search: Allow users to search any client field (not just name), e.g., id, other fields.
- Enchanced search functionality
Prepsa Kayastha