ASP.NET Core backend implementation for RealWorld
ASP.NET Core backend implementation for RealWorld
ASP.NET Core codebase containing real world examples (CRUD, auth, advanced patterns, etc.) that adheres to the RealWorld spec and API.
This codebase demonstrates a fully fledged application built with ASP.NET Core and feature-oriented vertical slices, including CRUD operations, authentication, routing, pagination, and more.
The implementation follows ASP.NET Core community style guides and best practices where they fit the RealWorld contract.
For information on how this works with other frontends and backends, see the RealWorld repository.
This uses ASP.NET Core with:
.editorconfig to enforce usage patternsThe basic architecture is based on this reference architecture: ContosoUniversityCore.
Install the .NET SDK pinned in global.json, currently 10.0.302.
The main validation target formats the repository, builds the solution in Release mode, and runs the integration tests:
dotnet run --project build/build.csproj -- testTo format without building:
dotnet run --project build/build.csproj -- formatThe full CI-equivalent build, test, and publish pipeline is:
dotnet run --project build/build.csprojSee AGENTS.md for repository layout, development conventions, and complete validation guidance.
There is a Makefile for macOS and Linux:
make build executes docker compose buildmake run executes docker compose upThe above might work for Docker on Windows.
The build is a C# project:
dotnet run --project build/build.csproj -- testRun the API with make run-local. Swagger is available at:
http://localhost:5000/swagger
The official RealWorld API spec test collections (Hurl and Bruno) run against this implementation. The spec repository is vendored as the realworld git submodule:
make submodule fetches the spec (git submodule update --init realworld)make test-hurl-with-managed-server starts the API on a fresh SQLite database, runs the Hurl suite, and shuts it down (requires Hurl)make test-bruno-with-managed-server does the same with the Bruno collection (requires Bun)make test-hurl / make test-bruno run the suites against an already running server (make run-local)Both suites run in CI via the "RealWorld API Tests" workflow.
All endpoints are rooted under /api as the spec requires; the prefix can be changed through the ApiPrefix configuration key (appsettings or an environment variable).
No open issues yet, or sync has not completed.