{"id":20216415,"url":"https://github.com/rjxby/modern-tenon","last_synced_at":"2026-04-13T13:01:47.369Z","repository":{"id":233373609,"uuid":"787101376","full_name":"rjxby/modern-tenon","owner":"rjxby","description":"The ModernTenon API stands as a comprehensive reference implementation, showcasing the application of industry-standard practices and architectural patterns in backend development using .NET technologies.","archived":false,"fork":false,"pushed_at":"2026-04-03T00:03:09.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-03T10:38:23.727Z","etag":null,"topics":["api","docker","dotnet","entity-framework-core","integration-testing","sqlite","unit-testing"],"latest_commit_sha":null,"homepage":"","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/rjxby.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}},"created_at":"2024-04-15T22:23:28.000Z","updated_at":"2026-04-03T00:03:12.000Z","dependencies_parsed_at":"2024-04-16T01:02:49.610Z","dependency_job_id":null,"html_url":"https://github.com/rjxby/modern-tenon","commit_stats":null,"previous_names":["rjxby/modern-tenon"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rjxby/modern-tenon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjxby%2Fmodern-tenon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjxby%2Fmodern-tenon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjxby%2Fmodern-tenon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjxby%2Fmodern-tenon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rjxby","download_url":"https://codeload.github.com/rjxby/modern-tenon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjxby%2Fmodern-tenon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31753551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"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":["api","docker","dotnet","entity-framework-core","integration-testing","sqlite","unit-testing"],"created_at":"2024-11-14T06:27:59.749Z","updated_at":"2026-04-13T13:01:47.363Z","avatar_url":"https://github.com/rjxby.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ModernTenon API\n\nModernTenon is a small products API built with ASP.NET Core minimal APIs, Entity Framework Core, and SQLite. The current codebase targets the latest project upgrades in this repository: `.NET 10` and `EF Core 10`.\n\n## What Is In The Repo\n\n- `Backend/Api/Host`: HTTP host, endpoint mapping, Swagger, and app configuration.\n- `Backend/Api/Services`: application service layer and mapping between API/domain models.\n- `Backend/Api/Repositories`: EF Core data access, SQLite context, and migrations.\n- `Backend/Tests`: unit tests and integration tests.\n\n## Current Stack\n\n- .NET 10\n- ASP.NET Core minimal APIs\n- Entity Framework Core 10\n- SQLite\n- Swagger / Swashbuckle\n- xUnit, FluentAssertions, Moq, Bogus\n\nCentral package versions are managed in [`Backend/Directory.Packages.props`](/Backend/Directory.Packages.props).\n\n## API Surface\n\nThe API exposes product endpoints under `/api/products`.\n\n- `GET /api/products?page=1\u0026limit=10`: list products with pagination metadata.\n- `GET /api/products/{id}`: fetch a single product.\n- `POST /api/products`: create a product.\n- `PUT /api/products/{id}`: update a product.\n\n### Request Models\n\n`POST /api/products`\n\n```json\n{\n  \"name\": \"Keyboard\"\n}\n```\n\n`PUT /api/products/{id}`\n\n```json\n{\n  \"name\": \"Mechanical Keyboard\",\n  \"price\": 149.99\n}\n```\n\nValidation currently requires:\n\n- `name` to be present and at least 3 characters long.\n- `price` on update to be present and greater than `0`.\n\n## Local Development\n\n### Prerequisites\n\n- .NET 10 SDK\n- `dotnet-ef` CLI tool if you want to apply or create migrations through the `Makefile`\n\n### Run The API\n\nFrom the repository root:\n\n```bash\ndotnet restore Backend/ModernTenon.sln\ndotnet run --project Backend/Api/Host\n```\n\nThe API applies pending EF Core migrations automatically during startup. For local `dotnet run`, the default SQLite file is configured in [`Backend/Api/Host/appsettings.json`](/Backend/Api/Host/appsettings.json):\n\n```json\n{\n  \"ConnectionStrings\": {\n    \"DefaultConnection\": \"Data Source=Backend/Api/Host/data/modern-tenon.db\"\n  }\n}\n```\n\nThis is now explicit: the configured path is used as-is. Override it in any environment with `ConnectionStrings__DefaultConnection`.\n\nDefault local URLs from [`launchSettings.json`](/Backend/Api/Host/Properties/launchSettings.json):\n\n- `http://localhost:5108`\n- `https://localhost:7001`\n\nSwagger UI is enabled in Development at:\n\n- `https://localhost:7001/swagger`\n- `http://localhost:5108/swagger`\n\n## Makefile Shortcuts\n\nThe repository includes a [`Makefile`](/Makefile) with common EF Core commands:\n\n```bash\nmake add-migration name=YourMigrationName\nmake remove-migration\nmake apply-migrations\n```\n\nFor a one-command container run with persisted SQLite storage:\n\n```bash\nmake dev-run\n```\n\nThat builds the image with Podman and runs it with a named volume mounted at `/data`. The image sets `ConnectionStrings__DefaultConnection=Data Source=/data/modern-tenon.db`, so the container owns the DB path and applies migrations on startup. The same contract works with Docker:\n\n```bash\ndocker build -t modern-tenon-api-dev -f Backend/Api/Host/Dockerfile ./Backend\ndocker run --mount type=volume,src=moderntenon-data,dst=/data -p 8080:8080 modern-tenon-api-dev\n```\n\n## Tests\n\nRun all tests:\n\n```bash\ndotnet test Backend/ModernTenon.sln\n```\n\nThe integration test suite boots the API through `WebApplicationFactory` and replaces the configured database with an in-memory SQLite database.\n\nFor a quick end-to-end smoke test against the real HTTP server:\n\n```bash\nmake smoke-test\n```\n\nTo target a specific host:\n\n```bash\nmake smoke-test HOST=http://127.0.0.1:8080\n```\n\n`make smoke-test` assumes your API is already running and only sends HTTP requests. It does not start the app or touch the database.\n\nThat script will:\n\n- call `GET /api/products`\n- create a product with `POST /api/products`\n- fetch it with `GET /api/products/{id}`\n- update it with `PUT /api/products/{id}`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjxby%2Fmodern-tenon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frjxby%2Fmodern-tenon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjxby%2Fmodern-tenon/lists"}