{"id":25171662,"url":"https://github.com/basemax/ecommercephpddd","last_synced_at":"2025-05-05T21:09:28.372Z","repository":{"id":189227913,"uuid":"676923802","full_name":"BaseMax/EcommercePHPDDD","owner":"BaseMax","description":"Welcome to the Domain-Driven Design (DDD) PHP 8.2 Ecommerce System! This project aims to provide a robust and scalable Restful API-based ecommerce system using PHP 8.2, all without relying on Laravel or any other third-party project. This README will guide you through the setup, architecture, and usage of the system.","archived":false,"fork":false,"pushed_at":"2023-08-16T06:54:51.000Z","size":1004,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-04T21:45:37.270Z","etag":null,"topics":["ddd","ddd-php","ecommerce","ecommerce-api","ecommerce-application","ecommerce-site","ecommerce-store","ecommerce-website","php","php-ddd","php8"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.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}},"created_at":"2023-08-10T10:21:13.000Z","updated_at":"2024-04-12T06:14:47.000Z","dependencies_parsed_at":"2023-08-18T21:58:42.976Z","dependency_job_id":"e81190bb-69f1-4ff4-ab51-a7414d13373a","html_url":"https://github.com/BaseMax/EcommercePHPDDD","commit_stats":null,"previous_names":["basemax/ecommercephpddd"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FEcommercePHPDDD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FEcommercePHPDDD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FEcommercePHPDDD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FEcommercePHPDDD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/EcommercePHPDDD/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577003,"owners_count":21770721,"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":["ddd","ddd-php","ecommerce","ecommerce-api","ecommerce-application","ecommerce-site","ecommerce-store","ecommerce-website","php","php-ddd","php8"],"created_at":"2025-02-09T09:21:30.185Z","updated_at":"2025-05-05T21:09:28.320Z","avatar_url":"https://github.com/BaseMax.png","language":"PHP","readme":"# Domain-Driven Design (DDD) PHP 8.2 Ecommerce System\n\nWelcome to the Domain-Driven Design (DDD) PHP 8.2 Ecommerce System! This project aims to provide a robust and scalable ecommerce system using PHP 8.2, all without relying on Laravel or any other third-party project. This README will guide you through the setup, architecture, and usage of the system.\n\n## Introduction\n\nThe DDD PHP 8.2 Ecommerce System is designed with a focus on Domain-Driven Design principles. It provides a solid foundation for building a flexible and maintainable ecommerce solution, emphasizing separation of concerns and modularity.\n\n## Features\n\n- Domain-Driven Design: The system adheres to DDD principles, helping you create a clear and structured architecture for your ecommerce application.\n- PHP 8.2: Utilize the latest features and enhancements provided by PHP 8.2 for improved performance and maintainability.\n- Modular Design: The architecture promotes modularization, making it easier to add, update, or replace specific components of the system.\n- Custom ORM: Implement a simple Object-Relational Mapping (ORM) tailored to the needs of the ecommerce domain.\n\n## Architecture\n\nThe architecture of the DDD PHP 8.2 Ecommerce System follows a layered approach, separating concerns and promoting a clear division of responsibilities. The main layers are:\n\n- **Presentation Layer:** Handles user interaction, including handling HTTP requests and responses.\n- **Application Layer:** Orchestrates the interaction between the Presentation and Domain layers. Contains application services and use cases.\n- **Domain Layer:** Contains the core business logic and domain entities. This layer is the heart of the application and should be independent of other layers.\n- **Infrastructure Layer:** Provides implementations for external dependencies such as databases, HTTP clients, and third-party integrations.\n\n## Screenshots\n\n![screenshot1](/screenshots/screenshot%20(1).png)\n![screenshot2](/screenshots/screenshot%20(2).png)\n![screenshot3](/screenshots/screenshot%20(3).png)\n\n## Getting Started\n\n**Prerequisites**\n\n- PHP 8.2 or higher\n- Composer\n- Mysql\n\n**Installation**\n\n- Clone this repository: `git clone https://github.com/BaseMax/EcommercePHPDDD.git`\n- Go to project directory: `cd EcommercePHPDDD`\n- Install dependencies: `composer install`\n- Setup mysql database tables: you can either use sql code below or use sql backup `database.sql`\n- Edit `.env` file with your own values\n- (optionaly) Seed the database: `cd app/Infrastructure/Database/ \u0026\u0026 php MysqlSeeder.php`\n- Run the server: `cd public/ \u0026\u0026 php -S localhost:8000`\n- App is running on `http://localhost:8000`\n\n## Mysql Tables SQL Code\n\n**products**\n\n```sql\nCREATE TABLE IF NOT EXISTS products (\n    id INT AUTO_INCREMENT PRIMARY KEY,\n    name VARCHAR(255) NOT NULL,\n    price INT NOT NULL\n);\n```\n\n**orders**\n\n```sql\nCREATE TABLE IF NOT EXISTS orders (\n    id INT AUTO_INCREMENT PRIMARY KEY,\n    address TEXT NOT NULL,\n    total_price INT NOT NULL,\n    status VARCHAR(255) NOT NULL\n);\n```\n\n**order_products**\n\n```sql\nCREATE TABLE IF NOT EXISTS order_products (\n    id INT AUTO_INCREMENT PRIMARY KEY,\n    order_id INT NOT NULL,\n    product_id INT NOT NULL,\n    quantity INT NOT NULL,\n    FOREIGN KEY (order_id) REFERENCES orders(id) ON DELETE CASCADE,\n    FOREIGN KEY (product_id) REFERENCES products(id) ON DELETE CASCADE\n);\n```\n\n**payments**\n\n```sql\nCREATE TABLE IF NOT EXISTS payments (\n    id INT AUTO_INCREMENT PRIMARY KEY,\n    order_id INT NOT NULL,\n    idpay_id VARCHAR(255) NOT NULL,\n    link VARCHAR(255) NOT NULL,\n    amount INT NOT NULL,\n    status INT NOT NULL,\n    track_id INT NOT NULL,\n    FOREIGN KEY (order_id) REFERENCES orders(id) ON DELETE CASCADE\n);\n```\n\n## Contributing\n\nContributions to this project are welcome! Feel free to fork the repository, make changes, and submit pull requests. Please follow the established coding guidelines and keep the DDD principles in mind.\n\n## License\n\nThis project is licensed under the GPL-3.0 License.\n\nCopyright 2023, Max Base\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fecommercephpddd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fecommercephpddd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fecommercephpddd/lists"}