{"id":23543961,"url":"https://github.com/dianper/microservice-aspire","last_synced_at":"2026-05-03T17:34:08.389Z","repository":{"id":269175743,"uuid":"906577739","full_name":"dianper/microservice-aspire","owner":"dianper","description":"A simple microservice using .NET Aspire","archived":false,"fork":false,"pushed_at":"2025-01-05T17:25:03.000Z","size":3201,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T08:43:36.744Z","etag":null,"topics":["aspire","background-service","blob-storage","csharp","dotnet","net9","postgresql","redis","servicebus","webapi"],"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/dianper.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-12-21T09:42:37.000Z","updated_at":"2025-01-05T17:25:07.000Z","dependencies_parsed_at":"2024-12-21T14:33:09.812Z","dependency_job_id":"659ed812-0aa1-43dd-84a1-1783ab4d0b9a","html_url":"https://github.com/dianper/microservice-aspire","commit_stats":null,"previous_names":["dianper/microservice-aspire"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dianper/microservice-aspire","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dianper%2Fmicroservice-aspire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dianper%2Fmicroservice-aspire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dianper%2Fmicroservice-aspire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dianper%2Fmicroservice-aspire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dianper","download_url":"https://codeload.github.com/dianper/microservice-aspire/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dianper%2Fmicroservice-aspire/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32578755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: 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":["aspire","background-service","blob-storage","csharp","dotnet","net9","postgresql","redis","servicebus","webapi"],"created_at":"2024-12-26T07:12:33.131Z","updated_at":"2026-05-03T17:34:08.359Z","avatar_url":"https://github.com/dianper.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# .NET Aspire Application\n\n## .NET Aspire Overview\n\n.NET Aspire is designed to enhance the development of cloud-native .NET applications by providing a consistent set of tools and patterns for building and running distributed apps. It helps developers with:\n\n- **Orchestration**: Simplifies the management of multi-project applications and their dependencies in local development environments.\n- **Integrations**: Offers NuGet packages for common services (e.g., Redis, PostgreSQL) with standardized interfaces for seamless app integration.\n- **Tooling**: Provides project templates and tooling support for Visual Studio, Visual Studio Code, and the .NET CLI, making it easier to create and work with .NET Aspire projects.\n\n## Introduction\nThis application implements a basic file process designed to handle COVID-related files. It supports file uploading, processing, data aggregation, and storage into multiple databases, while also providing an endpoint for retrieving the aggregated summary.\n\nThe application uses various resources like:\n\n- Azure Blob Storage (Emulator)\n- Azure Service Bus (Emulator)\n- MongoDB\n- PostgreSQL\n- Redis\n\n## Prerequisites\n- .NET 9 SDK\n- .NET Aspire\n- Docker\n\n## Features\n\n### **File Collector Service (Background Service):**\n- **Automatic Upload**: A background service monitors a directory for new files. When a new file is detected, it is uploaded to **Azure Blob Storage**, and a message is sent to the **Azure Service Bus Queue**.\n- **Typed HttpClient**: Uses a typed HttpClient `FileUploaderClient` to upload files through the API.\n- **Azure Blob Storage**: Used for storing uploaded files.\n- **Azure Service Bus Queue**: Used to send messages upon file upload for `File Details Service` processing.\n\n### **File Details Service (Background Service):**\n- **Message Processing**: Reads messages from the Azure Service Bus queue for file processing.\n- **File Processing**: Downloads files from Blob Storage and reads them using the **CsvHelper** package.\n- **Data Insertion**: Inserts detailed data into **MongoDB**.\n- **Message Forwarding**: Sends a message to the **File Summary Service** once processing is complete.\n\n### **File Summary Service (Background Service):**\n- **Message Processing**: Reads messages from the queue for aggregated data processing.\n- **Data Aggregation**: Aggregates values from **MongoDB**.\n- **Data Insertion**: Saves the aggregated data into **PostgreSQL**.\n- **Caching**: Caches the aggregated summary data into **Redis** for fast access.\n\n### **Observability**\n\nWith **.NET Aspire**, we can get the full observability of your application and services, including:\n\n- **MongoExpress** Dashboard: A web-based interface for managing **MongoDB** and viewing your stored data.\n- **Postgres-PgAdmin / PgWeb Dashboards**: Web-based interfaces to interact with your **PostgreSQL** database.\n- **Redis Cache Insights**: Visualize and manage the **Redis** cache with built-in dashboards, providing deep insights into cache usage and performance.\n\n### Local Development\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/dianper/microservice-aspire.git\n   cd microservice-aspire\n   ```\n\n2. **Set up Docker containers for required services**:\n   - Docker is required to run the application dependencies.\n\n3. **Run the application**:\n   ```bash\n   dotnet run\n   ```\n\n### API Endpoints\n\n#### **GET** `/api/summaries`\n\nRetrieve the global summary. The service checks **Redis** for cached data first; if not found, it queries **PostgreSQL**.\n\n#### **POST** `/api/files`\n\nManually upload a CSV file to be processed.\n\n- **Request body**: Multipart form-data containing the file.\n\n## Deployment\n\nLet's use Aspir8 to generate the Docker Compose file and Helm chart for the application.\n\n1. **Install Aspir8**:\n   ```bash\n   dotnet tool install -g aspirate\n   ```\n\n2. **Generating Docker Compose**:\n   ```bash\n   aspirate generate --output-format compose\n   ```\n\n3. **Generating Helm Chart**:\n   ```bash\n   aspirate generate --output-format helm\n   ```\n\n## References\n- [.NET Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview)\n- [Aspir8](https://prom3theu5.github.io/aspirational-manifests/getting-started.html)\n- [CsvHelper](https://joshclose.github.io/CsvHelper/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdianper%2Fmicroservice-aspire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdianper%2Fmicroservice-aspire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdianper%2Fmicroservice-aspire/lists"}