{"id":15047395,"url":"https://github.com/piyush26c/uber-low-level-design","last_synced_at":"2026-01-02T03:36:28.589Z","repository":{"id":222388878,"uuid":"757147583","full_name":"piyush26c/Uber-Low-Level-Design","owner":"piyush26c","description":"The primary objective behind developing this project is to deepen the understanding of low-level system design in C++, encompassing Object-Oriented Programming (OOP) principles, threading concepts, and modern C++ features such as Smart Pointers and the Standard Template Library (STL).","archived":false,"fork":false,"pushed_at":"2024-07-23T15:06:34.000Z","size":459,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T15:59:13.590Z","etag":null,"topics":["cpp11","cpp17","locks","object-oriented-programming","singleton-design-pattern","standard-template-library","stl-containers","strategy-design-pattern","system-design","uml-class-diagram"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/piyush26c.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-13T22:25:41.000Z","updated_at":"2024-07-28T16:23:59.000Z","dependencies_parsed_at":"2024-02-13T23:30:21.273Z","dependency_job_id":"1ccc9129-4bef-40cd-b28f-bdc900584348","html_url":"https://github.com/piyush26c/Uber-Low-Level-Design","commit_stats":null,"previous_names":["piyush26c/uber-low-level-design"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyush26c%2FUber-Low-Level-Design","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyush26c%2FUber-Low-Level-Design/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyush26c%2FUber-Low-Level-Design/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piyush26c%2FUber-Low-Level-Design/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piyush26c","download_url":"https://codeload.github.com/piyush26c/Uber-Low-Level-Design/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243475328,"owners_count":20296714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp11","cpp17","locks","object-oriented-programming","singleton-design-pattern","standard-template-library","stl-containers","strategy-design-pattern","system-design","uml-class-diagram"],"created_at":"2024-09-24T20:57:41.903Z","updated_at":"2026-01-02T03:36:28.514Z","avatar_url":"https://github.com/piyush26c.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Uber Low Level System Design in C++\nThis project, **Uber Low-Level System Design in Cpp**, aims to simulate a simplified version of the ride-hailing service Uber using modern C++ features. \n\nThe **primary objective** behind this project is to deepen the understanding of low-level system design in C++, encompassing Object-Oriented Programming (OOP) principles, threading concepts, and modern C++ features such as Smart Pointers and the Standard Template Library (STL).\n\nIn this design, we have focused on creating a robust and maintainable codebase by incorporating two key design patterns: **Singleton** and **Strategy**. The Singleton pattern is employed to ensure that there is only one instance of crucial manager classes such as ``DriverMgr``, ``RiderMgr``, ``TripMgr``, and ``StrategyMgr``. This guarantees centralized management of drivers, riders, trips, and strategies, ensuring thread-safe access and preventing resource conflicts. The Strategy pattern is leveraged to encapsulate algorithms for pricing and driver matching. By defining a family of algorithms and making them interchangeable, the system can dynamically change its behavior without altering the client code. Classes such as ``DefaultPricingStrategy``, ``RatingBasedPricingStrategy``, and ``LeastTimeBasedMatchingStrategy`` demonstrate the use of this pattern, providing flexibility and scalability to the system.\n\n## Features\n- **Singleton Pattern**: Ensures a single instance of crucial manager classes such as `DriverMgr`, `RiderMgr`, `TripMgr`, and `StrategyMgr` for centralized management.\n- **Strategy Pattern**: Encapsulates algorithms for pricing and driver matching, providing flexibility and scalability.\n- **Modern C++17 Features**: Utilizes smart pointers (though introduced in C++11), STL containers, and thread-safe operations to build an efficient and maintainable system.\n\n## Prerequisites\n- **C++17 Compiler**: Ensure you have a C++17 compatible compiler installed (e.g., g++, clang++).\n- **CMake**: Ensure you have CMake installed on your system.\n\n## Class UML Diagram\n\n*Note: Click on image below to render it with better view.*\n\n![Click here for UML Class diagram](https://www.planttext.com/api/plantuml/svg/lLXPRnex57xdLrXzg8O6yWEY29KRQ8EKa0Y6LlS9EJC6BCsciQbkbUR-zdeVZnT2LruO-om-vpkBpynxGc5BZsKn6E2AedO7CmGUMvpXQh-cBQHe_nKy3m3xNO1d-4JONaPVG0QBx5WmCkT5ILPNX09oW2tAjmrjhzCMD_U8mXcaSF8MDFPwU0No-lXK85_j_yxHoN3mCXXa1IG4pD0E7WiQCUvF6HG-LTWLCMZyRU8Yg5rOGSfs_u44vN_PZVZ9mfKJXWNTwN9brk8lgBs7D3kyaZ8bvv7iISmZpo6BKOfEGZ4Asc3dpXs2XAQuHCB5cBL_piBJvmjBNp6HXo7if_PnGt6XFNbcPKrnzW9Q4TYqPipiFrbDqyNo8sXalBdrOjyHmkGMxm-InnTvgkk28ukgOmaKLHwxMKxNwyN7vNmcbW_B-NQTJbTYaNv-48krNDskvdDh_U5XixANYq-QgWzALuj7lfLkrk7JPYicjDe-BBVfxNpxUVgllJjTyN_9oFMcwlbnkbchnvlfycP-TwTMy-MCFNNvKsVC_RhI-Cew0wnGCJtcgBzPLtjhLuicYjpSAQ4HC3jQOXXA7IrlfRETWigaiPM7McG2I9knnGc6d533e6BPuXorCjgz_LnadqMuiCr8WkgRjJ1W1CBKcJXz14oETKShAFQ8Mfi9Ip_9QwWpoogNJ1ooFiRU347Uyyk-WOIS0LoK3gXWAICzveK1u1U8YpwU5cAwkKZHPibaBUzjWuvDpgfxohKbGd4ZdeUEurm3TrjT54Blsmww82o1tcbxAV2EEXbmIWYSuvCEvYyRBKzq2Y9G289l8ZFQ8wfkhVBwT14LPnUHtQTuFpqIkSzkJC0SRHQvNElQvzUyfzgvRoU2pMxvOL_Scq7xvjqOfdeJRXREU_MfG9F5E0hSRxg0ObLzNirh0CIWqsFslNTs0aRvhZTXGfUAgOW6ppC6WkhWc3G5_CefCrR_k239K6Pff4lutU5-RshdMDKjWv3PMSBcMgPv24yT9d8F6xjDC5M9CXVckIhKNire9sNDnIFbTesubXC3ZP7cTdBOplRF6I-C8k5Wu42sVsBCs_lTwaT0b-cjca87kTPZ8IwxZ0ELQM3ncd6wNLH3ttMfmeUgCyndZm1b-M9mqldVGNMH8pR4bxX2xXl1QsyTPN3wTSlMESGRUd_kb4Yv-xXP3ZlGMPGGUZr1P-QAvHdh8AEeAnFH-8bUBwfTVQuEBTl9X590vZ9xYjqBUtFD6IO35QHrYJD--WHKw3_L5gq1hwk9cnOnP4JVE-k--C4xeT-Qmrqc398VVMFvbHUMSDGxLrd4krR-RZpMOv-OLzYbK14m6PYsmndanDIZwspXP36SdAIQMJx8LUiZ-881Gf1BxUmrPBlU-J7kQ_qLC9KPOe-yrZjIhjBhRvUNaUyqOTxuTuT1n08XTlfTMK3JeIP0BPkQSO9wfv2pO8lJpLjVbCD7rOgE7HeVI3kCElpUeVrSq6mYv-I0tMEgQefOBzWVA3UJVmzWYPuUC06oXR4721hO2l8Ei-dh3VEhhAlBGzEykMGlsZdWEgIY0kq4epNH_WvrPgZ_6KtlsHF_MFaT)\n\n\n## Steps to Run the Project\n\n1. **Clone the Repository**\n   ```sh\n   git clone https://github.com/piyush26c/Uber-Low-Level-Design.git\n   cd Uber-Low-Level-Design\n   ```\n\n2. **Create a Build Directory**\n   ```sh\n   mkdir build\n   cd build\n   ```\n\n3. **Generate the Build System using CMake**\n   ```sh\n   cmake ..\n   ```\n\n4. **Build the Project**\n   ```sh\n   make\n   ```\n\n5. **Run the Executable**\n   ```sh\n   ./UberSystem\n   ```\n\n\n## Project Structure\n\n```sh\n├── CMakeLists.txt\n├── common.hpp\n├── defaultPricingStrategy.hpp\n├── driver.hpp\n├── driverMatchingStrategy.hpp\n├── driverMgr.cpp\n├── driverMgr.hpp\n├── leastTimeBasedMatchingStrategy.hpp\n├── location.hpp\n├── main.cpp\n├── pricingStrategy.hpp\n├── ratingBasedPricingStrategy.hpp\n├── rider.hpp\n├── riderMgr.cpp\n├── riderMgr.hpp\n├── strategyMgr.cpp\n├── strategyMgr.hpp\n├── trip.hpp\n├── tripMetaData.hpp\n├── tripMgr.cpp\n├── tripMgr.hpp\n```\n\n## Badges\n\n![C++](https://img.shields.io/badge/C++-blue.svg?style=flat\u0026logo=c%2B%2B)\n![CMake Badge](https://img.shields.io/badge/CMake-064F8C?logo=cmake\u0026logoColor=fff\u0026style=flat-square)\n![ViewCount](https://views.whatilearened.today/views/github/piyush26c/Uber-Low-Level-Design.svg) ![GitHub watchers](https://img.shields.io/github/watchers/piyush26c/Uber-Low-Level-Design?style=flat)\n![GitHub](https://img.shields.io/github/last-commit/piyush26c/Uber-Low-Level-Design?style=flat)\n## Authors\n\n- [Piyush Rajendra Chaudhari](https://github.com/piyush26c)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiyush26c%2Fuber-low-level-design","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiyush26c%2Fuber-low-level-design","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiyush26c%2Fuber-low-level-design/lists"}