This is a minimal API project modded to implement REPR Design Pattern using FastEndpoints and use cases
The idea of this approach is to get as close as possible to how our brain organizes information. First we think about the thing, then what the thing is capable of doing.
If you noticed similarities with the approach that frameworks like React, Angular, Vue && Laravel, it's not for nothing. The idea is that any DEV can work on this architecture regardless of knowledge background with no compromising performance and scalability. π
- Install nuget packages
dotnet restore- Then, run it with
dotnet run --project ./src/backend-challenge.csproj- OK, now you can open http://localhost:3000/swagger with your browser to see the result.
You can run the following command to execute the tests
dotnet testThis project has the following structure
root
|
-π src                 // main project
|
--π Context            // EF core files, extensions and interceptors
|
--π Modules            // Feature folders, eg: entities, features, actions etc.
|
---π <Entity name>     // Group of all what is needed to implement the feature
|
----π [repositoty]     // If the entity needs to be persisted, here are the files needed for persistence configuration
|
-----ποΈ data.cs         // Repo implementation
-----ποΈ entity.cs       // Entity class
-----ποΈ interface.cs    // Repo interface
|
----π [useCases]       // Where the capabilities (use cases) of the entity are configured
|
-----π [useCase name]  
|
------ποΈ C#...          // useCase implementation
|
-π test                // Unit tests project
We give an example entity called HERO with CRUD implemented. You can use it as a reference to complete the challenges.