{"id":15044001,"url":"https://github.com/ahmedeldamaty20/Mercora","last_synced_at":"2025-09-29T10:31:03.996Z","repository":{"id":251376890,"uuid":"837231174","full_name":"ahmedeldamity/Mercora","owner":"ahmedeldamity","description":"Mercora is a modern e-commerce platform built with ASP.NET Core API designed with a focus on Clean Architecture.","archived":false,"fork":false,"pushed_at":"2024-10-24T05:26:16.000Z","size":797,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-24T23:27:21.859Z","etag":null,"topics":["asp-net-core","blazor","blazor-webassembly","caching","csharp","docker","docker-image","dockerfile","dotnet-core","ecommerce-api","health-check","net8","onion-architecture","rate-limiting","redis","sql-server","stripe-payments","wasm"],"latest_commit_sha":null,"homepage":"","language":"C#","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/ahmedeldamity.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-08-02T13:45:24.000Z","updated_at":"2024-10-24T05:26:19.000Z","dependencies_parsed_at":"2024-08-26T16:11:50.180Z","dependency_job_id":"da37911b-858e-4562-b7ed-ebbd2bf9d17c","html_url":"https://github.com/ahmedeldamity/Mercora","commit_stats":null,"previous_names":["ahmedeldamity/onionstore","ahmedeldamity/mercora"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedeldamity%2FMercora","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedeldamity%2FMercora/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedeldamity%2FMercora/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedeldamity%2FMercora/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmedeldamity","download_url":"https://codeload.github.com/ahmedeldamity/Mercora/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234609323,"owners_count":18859849,"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":["asp-net-core","blazor","blazor-webassembly","caching","csharp","docker","docker-image","dockerfile","dotnet-core","ecommerce-api","health-check","net8","onion-architecture","rate-limiting","redis","sql-server","stripe-payments","wasm"],"created_at":"2024-09-24T20:49:56.370Z","updated_at":"2025-09-29T10:31:03.237Z","avatar_url":"https://github.com/ahmedeldamity.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e🚀 Mercora\u003c/h1\u003e\n\n[MicrosoftSQLServer]: https://img.shields.io/badge/Microsoft%20SQL%20Server-CC2927?style=for-the-badge\u0026logo=microsoft%20sql%20server\u0026logoColor=white\n[.Net]: https://img.shields.io/badge/.NET-5C2D91?style=for-the-badge\u0026logo=.net\u0026logoColor=white\n[C#]: https://custom-icon-badges.demolab.com/badge/C%23-%23239120.svg?logo=cshrp\u0026style=for-the-badge\u0026logoColor=white\n[JSON]: https://img.shields.io/badge/JSON-000?logo=json\u0026style=for-the-badge\u0026logoColor=white\n[Docker]: https://img.shields.io/badge/Docker-2496ED?style=for-the-badge\u0026logo=docker\u0026logoColor=white\n[Redis]: https://img.shields.io/badge/Redis-DC382D?style=for-the-badge\u0026logo=redis\u0026logoColor=white\n[Stripe]: https://img.shields.io/badge/Stripe-5851DD?style=for-the-badge\u0026logo=stripe\u0026logoColor=white\n\n![MicrosoftSQLServer]\n![.Net]\n![C#]\n![JSON]\n![Docker]\n![Redis]\n![Stripe]\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eMercora is a modern e-commerce platform built with ASP.NET Core API designed with a focus on Clean Architecture.\u003c/b\u003e\n\u003c/p\u003e\n\n## 🐳 Docker Compose\n\nThis project utilizes Docker Compose to define and run a multi-container application consisting of:\n\n- Redis Caching: Provides caching capabilities to enhance performance.\n- SQL Server Database: Serves as the data storage for the application.\n- API: Hosts the application's backend logic and endpoints.\n\n## 💎 Prerequisites\n\n\u003cul\u003e\n  \u003cli\u003e\u003ca href=\"https://dotnet.microsoft.com/pt-br/\"\u003e.NET 8\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"https://github.com\"\u003eGit\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"https://docker.com\"\u003eDocker\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\n## 🎇 Setup and Configuration\n\n**1- Clone the Repository**\n\n```bash\ngit clone \"https://github.com/ahmedeldamity/Mercora\"\ncd Mercora\n```\n\n**2- Build and Start Containers**\n\nUse Docker Compose to build and start all containers defined in the `docker-compose.yml` file.\n\n```bash\ndocker-compose up --build\n```\n\nThis command will build the necessary images (if not already built) and start the containers as defined.\n\n**3- Access the Services**\n\n- API: Access the API at `http://localhost:8080`.\n- SQL Server Database: Connect to the SQL Server using the connection string `Server=store_database;Database=StoreDatabase;User Id=sa;Password=PAssWord**;`.\n- Redis Caching: Redis can be accessed at `redis://localhost:6379`.\n\n## Persisting Data\n\nData for SQL Server and Redis is persisted using Docker volumes. Ensure that volumes are properly configured in docker-compose.yml to prevent data loss on container restarts.\n\n## Database ERD\n\nThe Entity-Relationship Diagram (ERD) for the SQL Server database is included below. This diagram illustrates the structure of the database, including tables, relationships, and key constraints.\n\n![image](https://github.com/user-attachments/assets/d7723c57-a4f1-47df-b98d-8afb7c467e11)\n\n## ✔️ Health Check\n\n**The application includes a unified health check endpoint to monitor the status of various system components:**\n\n- SQL Server Database: Ensures the connection to the store database is healthy.\n- Redis Caching: Verifies the availability and functionality of the Redis caching system.\n- Hangfire Job Processing: Checks the status of Hangfire to ensure background jobs are being processed correctly.\n- Mail Service: Monitors the mail service to confirm that emails can be sent.\n\n## 🔄 API Versioning\n\n**API versioning is supported to ensure backward compatibility as the API evolves. Clients can specify the version via the URL path, query string, or request headers.**\n\n## ⏳ Rate Limiting\n\n**The API uses multiple rate limiting strategies to manage traffic:**\n\n- Fixed Window: Limits requests within a defined time window.\n- Sliding Window: Allows a smoother request flow by checking limits within a moving time window.\n- Concurrency Limit: Restricts the number of concurrent requests being processed at the same time.\n\n## API Endpoints\n\n**Health Check :**\n\n| Method              | Endpoint                                | Description                                         |\n|---------------------|-----------------------------------------|-----------------------------------------------------|\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /_health \u003c/kbd\u003e                   | Returns the health status of the system.            |\n\n**Products:**\n\n| Method              | Endpoint                                | Description                                         |\n|---------------------|-----------------------------------------|-----------------------------------------------------|\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/product \u003c/kbd\u003e               | Retrieve a list of products.                        |\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/product/{id} \u003c/kbd\u003e          | Retrieve details of a specific product.             |\n| \u003ckbd\u003e POST \u003c/kbd\u003e   | \u003ckbd\u003e /api/product \u003c/kbd\u003e               | Add a new product.                                  | \n| \u003ckbd\u003e PUT \u003c/kbd\u003e    | \u003ckbd\u003e /api/product/{id} \u003c/kbd\u003e          | Update product.                                     |\n| \u003ckbd\u003e DELETE \u003c/kbd\u003e | \u003ckbd\u003e /api/product/{id} \u003c/kbd\u003e          | Delete a product.                                   |\n\n**Brands :**\n\n| Method              | Endpoint                                | Description                                          |\n|---------------------|-----------------------------------------|------------------------------------------------------|\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/brand \u003c/kbd\u003e                 | Retrieve a list of brands.                           |\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/brand/{id} \u003c/kbd\u003e            | Retrieve details of a specific brand.                |\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/brand/search \u003c/kbd\u003e          | Retrieve details of a specific brand.                |\n| \u003ckbd\u003e POST \u003c/kbd\u003e   | \u003ckbd\u003e /api/brand \u003c/kbd\u003e                 | Add a new brand                                      |\n| \u003ckbd\u003e PUT \u003c/kbd\u003e    | \u003ckbd\u003e /api/brand/{id} \u003c/kbd\u003e            | Update brand.                                        |\n| \u003ckbd\u003e DELETE \u003c/kbd\u003e | \u003ckbd\u003e /api/brand/{id} \u003c/kbd\u003e            | Delete a brand.                                      |\n \n**Categories :**\n\n| Method              | Endpoint                                | Description                                          |\n|---------------------|-----------------------------------------|------------------------------------------------------|\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/category \u003c/kbd\u003e              | Retrieve a list of categories.                       |\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/category/{id} \u003c/kbd\u003e         | Retrieve details of a specific category.             |\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/category/search \u003c/kbd\u003e       | Retrieve details of a specific category.             |\n| \u003ckbd\u003e POST \u003c/kbd\u003e   | \u003ckbd\u003e /api/category \u003c/kbd\u003e              | Add a new category                                   |\n| \u003ckbd\u003e PUT \u003c/kbd\u003e    | \u003ckbd\u003e /api/category/{id} \u003c/kbd\u003e         | Update category.                                     |\n| \u003ckbd\u003e DELETE \u003c/kbd\u003e | \u003ckbd\u003e /api/category/{id} \u003c/kbd\u003e         | Delete a category.                                   |\n \n**Delivery Methods :**\n\n| Method              | Endpoint                                | Description                                          |\n|---------------------|-----------------------------------------|------------------------------------------------------|\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/DeliveryMethod \u003c/kbd\u003e        | Retrieve a list of Delivery Methods.                 |\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/DeliveryMethod/{id} \u003c/kbd\u003e   | Retrieve details of a specific Delivery Method.      |\n| \u003ckbd\u003e POST \u003c/kbd\u003e   | \u003ckbd\u003e /api/DeliveryMethod \u003c/kbd\u003e        | Add a new Delivery Method                            | \n| \u003ckbd\u003e PUT \u003c/kbd\u003e    | \u003ckbd\u003e /api/DeliveryMethod/{id} \u003c/kbd\u003e   | Update Delivery Method.                              |\n| \u003ckbd\u003e DELETE \u003c/kbd\u003e | \u003ckbd\u003e /api/DeliveryMethod/{id} \u003c/kbd\u003e   | Delete a Delivery Method.                            |\n\n**Account :**\n\n| Method              | Endpoint                                   | Description                                         |\n|---------------------|--------------------------------------------|-----------------------------------------------------|\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v1.0/Account/register \u003c/kbd\u003e    | Register a new user and receive a JWT token V-1.0   |\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v2.0/Account/register \u003c/kbd\u003e    | Register a new user and receive a JWT token V-2.0   |\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v2.1/Account/register \u003c/kbd\u003e    | Register a new user and receive a JWT token V-2.1   |\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v1.0/Account/login \u003c/kbd\u003e       | Authenticate a user and receive a JWT token V-1.0   |\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v2.0/Account/login \u003c/kbd\u003e       | Authenticate a user and receive a JWT token V-2.0   |\n| \u003ckbd\u003e POST \u003c/kbd\u003e   | \u003ckbd\u003e /api/v1/Account/google-login \u003c/kbd\u003e  | Authenticate a user and receive a JWT token.        |\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/v1/Account \u003c/kbd\u003e               | Get Current User.                                   |\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/v1/Account/refresh-token \u003c/kbd\u003e | Get New Refresh Token.                              |\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v1/Account/revoke-token \u003c/kbd\u003e  | Revoke Refresh Token.                               |\n\n**Authentications :**\n\n| Method              | Endpoint                                                  | Description                          |\n|---------------------|-----------------------------------------------------------|--------------------------------------|\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v1/Auth/send-email-verification-code \u003c/kbd\u003e    | Send Email Verification Code V-1.0   |\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v2/Auth/send-email-verification-code \u003c/kbd\u003e    | Send Email Verification Code V-2.0   |\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v1/Auth/verify-register-code \u003c/kbd\u003e            | Verify Register Code.                |\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v1/Auth/send-password-verification-code \u003c/kbd\u003e | Send Password Reset Email V-1.0      |\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v2/Auth/send-password-verification-code \u003c/kbd\u003e | Send Password Reset Email V-2.0      |\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v1/Auth/Verify-Reset-Code \u003c/kbd\u003e               | Verify Reset Code.                   |\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/v1/Auth/change-password \u003c/kbd\u003e                 | Change Password.                     |\n\n**Basket :**\n\n| Method              | Endpoint                                                  | Description                          |\n|---------------------|-----------------------------------------------------------|--------------------------------------|\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/Basket \u003c/kbd\u003e                                  | Create or Update Basket.             |\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/Basket/{id} \u003c/kbd\u003e                             | Retrieve the current user's basket.  |\n| \u003ckbd\u003e DELETE \u003c/kbd\u003e | \u003ckbd\u003e /api/Basket/{id} \u003c/kbd\u003e                             | Delete Basket.                       |\n\n**Payment :**\n\n| Method              | Endpoint                                                  | Description                          |\n|---------------------|-----------------------------------------------------------|--------------------------------------|\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/Payment/{{basketId}} \u003c/kbd\u003e                    | Create or Update Payment.            |\n\n**Order :**\n\n| Method              | Endpoint                                                  | Description                          |\n|---------------------|-----------------------------------------------------------|--------------------------------------|\n| \u003ckbd\u003e Post \u003c/kbd\u003e   | \u003ckbd\u003e /api/Order \u003c/kbd\u003e                                   | Create Order.                        |\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/Order \u003c/kbd\u003e                                   | Get User Orders.                     |\n| \u003ckbd\u003e GET \u003c/kbd\u003e    | \u003ckbd\u003e /api/Order/{{id}} \u003c/kbd\u003e                            | Get Order By Id                      |\n\n\n## ⚔ Stopping and Removing Containers\n\nTo stop and remove all running containers, use:\n\n```bash\ndocker-compose down\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedeldamaty20%2FMercora","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmedeldamaty20%2FMercora","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedeldamaty20%2FMercora/lists"}