{"id":31214415,"url":"https://github.com/mattytomo365/bartering-platform","last_synced_at":"2026-05-08T14:03:06.036Z","repository":{"id":315594668,"uuid":"1054115214","full_name":"Mattytomo365/Bartering-Platform","owner":"Mattytomo365","description":".NET microservices \u0026 Angular web application following CQRS \u0026 Clean Architecture to facilitate listing and exchanging products","archived":false,"fork":false,"pushed_at":"2026-01-14T15:38:28.000Z","size":424,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-14T19:15:11.993Z","etag":null,"topics":["angular","cqrs","dotnet","microservice"],"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/Mattytomo365.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-10T11:41:47.000Z","updated_at":"2026-01-14T15:38:31.000Z","dependencies_parsed_at":"2025-09-19T14:56:18.435Z","dependency_job_id":"66bfcb32-89c7-492d-bdd4-a6f78a6b5a60","html_url":"https://github.com/Mattytomo365/Bartering-Platform","commit_stats":null,"previous_names":["mattytomo365/bartering-platform"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mattytomo365/Bartering-Platform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mattytomo365%2FBartering-Platform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mattytomo365%2FBartering-Platform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mattytomo365%2FBartering-Platform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mattytomo365%2FBartering-Platform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mattytomo365","download_url":"https://codeload.github.com/Mattytomo365/Bartering-Platform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mattytomo365%2FBartering-Platform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32783452,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["angular","cqrs","dotnet","microservice"],"created_at":"2025-09-21T09:55:13.689Z","updated_at":"2026-05-08T14:03:06.018Z","avatar_url":"https://github.com/Mattytomo365.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bartering Platform\n\n---\n\n## Overview\n\nBartering Platform is an inherited full-stack **.NET 8 microservices** and **Angular** event-driven web application designed to facilitate the exchange of goods between users, featuring arhcitectural patterns/tools such as CQRS, Clean Architecture, and RabbitMQ messaging.\n\nUsers have the ability to create/edit/delete listings, search \u0026 discover listings for a specified location, and manage their profiles after authentication.\n\nOnce the CQRS scaffold was recieved, I refactored the Listing Service to a service + repository approach to establish tradeoffs between the two patterns whilst getting hands-on with the arhcitecure. Now the system is documented end-to-end and my understanding is solidified, I plan to add user-messaging capabilities, and refine exisiting microservices, and explore potential for a full-event driven design with event sourcing for listings.\n\n---\n\n## Technologies Used\n- **Backend**: .NET 8, ASP.NET Core, EF Core, SQL Server 2022, RabbitMQ\n- **Gateway**: Ocelot\n- **Frontend**: Angular\n- **Container/dev**: Docker, Docker Compose\n- **Authentication**: Firebase JWT\n\n---\n\n## Architecture\n\n![image](diagrams/cqrs-diagram.png)\n\nServices are loosely coupled and independently deployable, with functionality encapsulated within several NET class libraries:\n\n- **ApiGatewayService**: Central entry point for client requests, routing to appropriate backend services.\n- **ListingService**: Handles listing commands (create/update/delete), persisting to its own database alongside publishing listing integration events to RabbitMQ.\n- **DiscoveryService**: Consumes listing integration events and projects data into a search-optimised table indexed by SQL Server Full-Text-Search (FTS), which is queried by exposed search endpoints.\n- **ProfileService**: A separate bounded context handling user profiles and related data.\n\n**Command Query Responsibility Segragation** (CQRS) is adhered to within the microservices architecture, maintaining a strong read/write separation within the application's backend. The pattern is implemented using MediatR handlers to encapsulate logic fullfilling change of state requests expressed through Command classes, and reading of state expressed through Query classes.\n\nThe Listing Service's architecture was simplified to a **service + repository** approach within the `main` branch. Controllers accept request DTOs and call application service methods. A clear command/query separation remains without a mediators.\n\nBoth the handlers and service methods within each pattern enforce domain rules via the Listing aggregate and persist via a repository.\n\nThe unconverted CQRS-heavy approach can be viewed within the `cqrs` branch\n\n### Asynchronous integration (RabbitMQ)\nBoth versions persist via repositories and use **RabbitMQ** to decouple services:\n- **Exchange:** `listing.events` (topic) with keys `listing.created`, `listing.updated`, `listing.deleted`\n- **Consumer:** **DiscoveryService** subscribes (`listing.*`) and updates its search index\nThis enables resilience (messages queue if a service is offline) and loose coupling between write and read concerns.\n\n---\n\n## Setup Instructions\n\n### Prerequisites\n- [Docker](https://www.docker.com/) (to run full-stack) or [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) (to run services locally)\n- [Node.js](https://nodejs.org/) + [Angular CLI](https://angular.dev/tools/cli) (for frontend)\n\n### Run with Docker\n\n1. Copy environment variables (Docker Compose):\n    ```\n    cp deploy/.env.example deploy/.env\n    ```\n   Fill the required values in `.env`\n\n2. From `deploy/`, start all services:\n    ```\n    docker compose up -d\n    ```\n\n3. (Optional) view logs:\n    ```\n    docker compose logs -f\n    ```\nDefault endpoints:\n- API Gateway: http://localhost:8080\n- RabbitMQ UI: http://localhost:15672 (use credentials from .env)\n- SQL Server: localhost,1433 (login sa + password from .env)\n\n### Run without Docker\n\n1. Copy the development settings file (within `Web/` of each service):\n    ```\n    cp appsettings.Development.json.example appsettings.Development.json\n    ```\n    Fill in local values.\n\n2. In separate terminals:\n\n    ```\n    cd ListingService/Web   \u0026\u0026 dotnet run\n    cd DiscoveryService/Web \u0026\u0026 dotnet run\n    cd ProfileService/Web   \u0026\u0026 dotnet run\n    cd ApiGatewayService/Web\u0026\u0026 dotnet run\n\n    ```\n\n**Frontend:**\n\n1. Navigate to the `BarterApp` directory\n\n2. Start the development server:\n    ```\n    ng serve\n    ```\n\n---\n\n## License\n\n*Specify license here*\n\n---\n## Contributing\n\n**Contributions are welcome!**  \nPlease fork the repository and submit a pull request with your changes.\n\n---\n\n## Contact\n\nFor any questions or feedback, feel free to reach out:\n\n- **Email:** matty.tom@icloud.com\n- **GitHub:** [Mattytomo365](https://github.com/Mattytomo365)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattytomo365%2Fbartering-platform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattytomo365%2Fbartering-platform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattytomo365%2Fbartering-platform/lists"}