Skip to content

adr1enbe4udou1n/aspnetcore-realworld-example-app

Repository files navigation

RealWorld Example App

ASP.NET Core 8.0 codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully fledged fullstack application built with last ASP.NET Core 6.0 (with Feature orientation) including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the ASP.NET Core community styleguides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

See my works for my personal Backend & Frontend RealWorld apps collection.

Usage

PostgreSQL

This project use PostgreSQL as main database provider. You can run it easily via docker-compose up -d.

Two databases will spin up, one for normal development and one dedicated for integrations tests. Indeed In-Memory testing are poorly suitable for real integrations tests for me. See Avoid In-Memory Databases for Tests.

Run app

task seed # migrate and fill db with fake data
task run

And that's all, go to http://localhost:5000/swagger

Validate API with Newman

Launch follow scripts for validating realworld schema :

task fresh # wipe all database for clean state
task run
npx newman run postman.json --global-var "APIURL=http://localhost:5000/api" --global-var="USERNAME=johndoe" --global-var="EMAIL=john.doe@example.com" --global-var="PASSWORD=password"

Full test suite

This project is fully tested via xUnit, just run dotnet test for launching it. All SQL queries are automatically showed up for easy debug and easy N+1 detection.

Use dotnet watch test -p tests/WebUI.IntegrationTests for realtime test watching, perfect for TDD.

Packages

No packages published

Contributors 2

  •  
  •