{"id":18715111,"url":"https://github.com/wsdt/tariffcomparison-restapi","last_synced_at":"2026-04-27T20:31:11.588Z","repository":{"id":138254657,"uuid":"312686103","full_name":"wsdt/TariffComparison-RESTApi","owner":"wsdt","description":"Exemplary .NET Core Api","archived":false,"fork":false,"pushed_at":"2020-11-15T11:44:23.000Z","size":212,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-19T11:45:50.685Z","etag":null,"topics":["api","csharp","docker","rest"],"latest_commit_sha":null,"homepage":"https://wavect.io","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/wsdt.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,"publiccode":null,"codemeta":null}},"created_at":"2020-11-13T21:18:43.000Z","updated_at":"2020-11-15T11:44:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"a59f260e-1c46-41d6-9c06-179dddca5c94","html_url":"https://github.com/wsdt/TariffComparison-RESTApi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wsdt/TariffComparison-RESTApi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wsdt%2FTariffComparison-RESTApi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wsdt%2FTariffComparison-RESTApi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wsdt%2FTariffComparison-RESTApi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wsdt%2FTariffComparison-RESTApi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wsdt","download_url":"https://codeload.github.com/wsdt/TariffComparison-RESTApi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wsdt%2FTariffComparison-RESTApi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32354563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["api","csharp","docker","rest"],"created_at":"2024-11-07T13:07:36.384Z","updated_at":"2026-04-27T20:31:11.563Z","avatar_url":"https://github.com/wsdt.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TariffComparison-RESTApi ![.NET Core](https://github.com/wsdt/TariffComparison-RESTApi/workflows/.NET%20Core%20Tests/badge.svg) ![Docker Image CI](https://github.com/wsdt/TariffComparison-RESTApi/workflows/Docker%20Image%20CI/badge.svg) [![HitCount](http://hits.dwyl.com/wsdt/TariffComparison-RESTApi.svg)](http://hits.dwyl.com/wsdt/TariffComparison-RESTApi) [![Maintenance](https://img.shields.io/badge/Maintained%3F-no-red.svg)](https://bitbucket.org/lbesson/ansi-colors) [![GitHub license](https://img.shields.io/github/license/wsdt/TariffComparison-RESTApi.svg)](https://github.com/wsdt/TariffComparison-RESTApi/blob/master/LICENSE) [![Generic badge](https://img.shields.io/badge/Made%20with-CSharp-37f)](https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/) [![Donate](https://img.shields.io/badge/Donate-Pay%20me%20a%20coffee-3cf)](https://github.com/wsdt/Global/wiki/Donation)\n\n## Get Started\nThe api is tested as well as the corresponding Docker-image is pushed to **[Dockerhub](https://hub.docker.com/repository/docker/wsdt/wavect_tariffcomparison_api)** via Github-Actions (see badges above). \n\n### Run api locally\nThe api is pushed to `wsdt/wavect_tariffcomparison_api` on [Dockerhub](https://hub.docker.com/repository/docker/wsdt/wavect_tariffcomparison_api).\nI've created a docker-compose file too, to also have a MSSQL-database in order to ensure that everything works as expected.\n\nThe connectionString is currently directly built into the api, as I honestly just ran out of time, so if you are not using Docker-Toolbox (same docker-machine ip) this image might not work for you. \n\nAlternatively, you just have to do 3 things: \n1. Run the database: `docker-compose -f docker-compose.yml up`\n2. Change database host in `appsettings.Development.json`/`appsettings.json`.\n* If you are using Docker Toolbox execute `docker-machine ip` to get the database host.\n* For Docker-Desktop you can use localhost.\n3. Run IIS as usual.\n\nPlease note, that the database is **transient** as we have no write-operations in the api at the moment and who doesn't like a clean drive :-).\n\n### ApiVersion\nIn my experience nothing is more painful than changing your ERM or project structure. Therefore, adding support for ApiVersions might seem over-engineered now, but can save a lot of resources in the long run as introducing this later might become increasingly complex/messy. \n\nCurrent api-version is 1.0. This means you can call versionized routes via e.g. `/api/v1.0` or `/api/v1`\n\n### Swagger\nAll routes are listed at `/swagger`. This route is disabled for release builds.\n\n\n## Possible ToDo's\n1. Add more (lightweight) runtime/health checks to /api/info\n2. Use Repositories -\u003e Decoupling Services from Persistence specific logic\n3. Add Client/Server Caching (e.g. Redis, Browser-native Caching-HTTP Headers, ...)\n4. Add Docker-Swarm to Docker-Compose File or integrate with Kubernetes\n5. Add more Documentation\n6. Add more Tests\n7. Maybe use generic interface for persistence operations to easily switch underlying data storage\n8. Add Authentication \u0026 Authorization\n9. Make Docker-Compose File production ready (networks, volumes, maybe proxy, letsencrypt [valid certificate], ..)\n10. Add HealthCheck to Docker-Compose file (e.g. automatic restart, slack/discord notification, ...)\n11. General error handling concept (Security)\n12. Make images configurable via environment variables (e.g. DB_HOST, ...)\n13. Add Api Rate-Limiting\n14. Logging \u0026 Analytics: E.g. push to Firebase and visualize data with Grafana\n15. Add stricter CORS ruleset (esp. if used from UI later, ..)\n16. Enhance data model, but enough for current use-case.\n\n### Interfaces\nI removed/skipped creating some interfaces for e.g. DTOs as I didn't had an explicit use-case in this project and think it would have been overengineered here. \n\n### Persistence Layer\nTo avoid overengineering, I decided to have the majority of my persistence logic within my Services. Nevertheless, I would later introduce a Facade/Repository-Pattern or simply some sort of \"PersistenceService\u003cT\u003e\" to have basic methods like FindById(), FindAll(), usw. in one place \u0026 to reduce possibly code reduncancy (+ separation of concerns). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwsdt%2Ftariffcomparison-restapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwsdt%2Ftariffcomparison-restapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwsdt%2Ftariffcomparison-restapi/lists"}