{"id":15047409,"url":"https://github.com/callmemaverick/ecommercecore","last_synced_at":"2026-01-02T11:20:17.744Z","repository":{"id":221054824,"uuid":"748266973","full_name":"CallMeMaverick/ECommerceCore","owner":"CallMeMaverick","description":"This repository contains the comprehensive final exam project for the Advanced Object-Oriented Programming (OOP) course in C++ at IT Step Computer Academy. It is designed to showcase a culmination of skills and concepts learned throughout the course.","archived":false,"fork":false,"pushed_at":"2024-02-21T13:59:19.000Z","size":93,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T12:53:32.907Z","etag":null,"topics":["cpp","cpp11","cpp17","exam","json","nlohmann-json","oop","oop-concepts","oop-principles","oops-in-cpp"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CallMeMaverick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-01-25T16:13:18.000Z","updated_at":"2024-02-21T14:04:26.000Z","dependencies_parsed_at":"2024-02-19T13:42:31.190Z","dependency_job_id":"aa11028f-3390-4cef-956b-26d65fc73f72","html_url":"https://github.com/CallMeMaverick/ECommerceCore","commit_stats":null,"previous_names":["callmemaverick/ecommercecore"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CallMeMaverick%2FECommerceCore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CallMeMaverick%2FECommerceCore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CallMeMaverick%2FECommerceCore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CallMeMaverick%2FECommerceCore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CallMeMaverick","download_url":"https://codeload.github.com/CallMeMaverick/ECommerceCore/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":["cpp","cpp11","cpp17","exam","json","nlohmann-json","oop","oop-concepts","oop-principles","oops-in-cpp"],"created_at":"2024-09-24T20:57:55.399Z","updated_at":"2026-01-02T11:20:17.716Z","avatar_url":"https://github.com/CallMeMaverick.png","language":"C++","readme":"# 👨🏻‍💻🛍️ ECommerceCore\n\n**ECommerceCore** is the final exam project for the Advanced Object-Oriented Programming (OOP) course in C++ at IT Step Computer Academy. It is designed to showcase a culmination of skills and concepts learned throughout the course.\n\n## 📚 Description\nThis console application serves as the backend of an e-commerce platform, simulating real-world functionality while embodying essential OOP principles, design patterns, and modern C++ best practices.\n\n## 🎯 Focus:\n**OOP Principles**: The project is all about using OOP principles like inheritance, polymorphism, encapsulation, and abstraction. It's structured to make the code easy to read, update, and manage.\n\n**Handle Complex JSON**: Efficiently parse and process complex JSON data using a suitable library [nlohmann::json](https://github.com/nlohmann/json). Validate incoming JSON against a schema to ensure data integrity.\n\n**Design Patterns and C++ Features**: The project utilizes different design patterns and modern C++ features to make the code better. This includes things like smart pointers for memory management and the Standard Template Library (STL) for working with data.\n\n**Incorporate Best Practices**: Adhere to C++ style guides (e.g., [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html)) for consistent formatting and readability.\n\n\n## 🦾 Main Features\n\n* **Approach to storing user data using JSON** \u003c/br\u003e ---\u003e *It is important to note that this method is not secure and should not be implemented in real-world applications. The information displayed is purely for illustrative purposes and does not represent actual user accounts; similarly, the application utilizes this approach exclusively for academic purposes* \u003c---\n\n```json\n{\n    \"a\": [\n        {\n            \"password\": \"99@tOHL9wdmXs\",\n            \"username\": \"sludchpo\"\n        }\n    ],\n    \"b\": [\n        {\n            \"password\": \"99@VkZeC79JvE\",\n            \"username\": \"vuyclglx\"\n        }\n    ],\n    \"c\": [\n        {\n            \"password\": \"99@ouDAbzZ%gu\",\n            \"username\": \"hbvmdgwf\"\n        }\n    ]\n}\n```\n* **Signing up / logging in** \u003c/br\u003e *Example of logging in process:*\n```cpp\n// Validate both username and password\n        try {\n            validateName(username);\n            validatePassword(password);\n        }\n        catch (const std::invalid_argument\u0026 exception) {\n            // Here it states that user doesn't exist because if, when signing up,\n            // user didn't pass the validation, they could not register,\n            // so invalid usernames or passwords are not in auth.json\n            throw std::invalid_argument(\"User does not exist\");\n        }\n\n        std::ifstream jsonFileRead(\"...\");\n        json readData;\n        if (jsonFileRead.is_open())\n        {\n            try {\n                jsonFileRead \u003e\u003e readData;\n                jsonFileRead.close();\n            }\n            catch (json::parse_error\u0026 e) {\n                std::cout \u003c\u003c e.what() \u003c\u003c std::endl;\n                throw;\n            }\n\n            // If data has been read, proceed by iterating over JSON object\n            for (auto\u0026 [key, user] : readData.items())\n            {\n                // Compare the key (which is the letter we group users by),\n                // with the first letter of given username\n                if (key[0] == username[0])\n                {\n                    // If found, now iterate over JSON object,\n                    // and compare username and password given with those object has\n                    for (auto\u0026 userData : user)\n                    {\n                        if (userData[\"username\"] == username \u0026\u0026 userData[\"password\"] == password)\n                        {\n                            return true;  // \u003c-- return true if user has been found\n                        }\n                    }\n\n                    std::cout \u003c\u003c \"User hasn't been found\" \u003c\u003c std::endl;\n                    return false;  // \u003c-- return false if user hasn't been found\n                }\n            }\n        }\n        return false;  // \u003c-- return false if user hasn't been found\n    }\n```\n*Please again note that in this case, for instance, the absolute path to the catalog is not encapsulated and secured due to the reasons discussed in the first feature*\n\n## ⚙️ Building\n\n### MacOS / Linux\n* Open the terminal in the project directory.\n* Generate CMake build files; use: \u003c/br\u003e\n`cmake ..`\n\n### Windows \n* `cmake -G \"Visual Studio 17\"` to generate Visual Studio solution files.\n* Instead of -G Visual Studio 17, you can use `-G \"MinGW Makefiles\"`. This generates Makefiles compatible with MinGW, a free and open-source C/C++ compiler suite for Windows. Users can then build the project using a command-line tool like mingw32-make.\n\nOnce the build files are generated, you can proceed to build and run your application.\n\n### Note: \n* For detailed build instructions and troubleshooting, refer to the [CMake documentation](https://cmake.org/)\n* If you encounter issues, search online forums or communities for help with CMake specifically on your platform.\n\n## 🤝 Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n### Before You Contribute:\n**Review the coding style**: Familiarize yourself with coding conventions to ensure consistency.\u003c/br\u003e\n**Fork the repository**: Create a personal fork of the repository to work on your changes.\u003c/br\u003e\n**Open an issue (*optional*)**: For major changes, discuss your ideas in an issue before starting a pull request.\u003c/br\u003e\n**Write clear commit messages**: Use descriptive commit messages that explain your changes.\u003c/br\u003e\n**Test your changes**: Ensure your contributions don't break existing functionality. Write or update tests as needed.\u003c/br\u003e\n\n\n\n## 📄 License\n\nMIT License - *see LICENSE for details*\n\nCopyright (c) 2024 Kushnierov Sviatoslav\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallmemaverick%2Fecommercecore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcallmemaverick%2Fecommercecore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallmemaverick%2Fecommercecore/lists"}