Giter VIP home page Giter VIP logo

todo-app's Introduction

Archived: Please check ChatApp instead. It is based on this project.

Todo App

Reference project for an application organized into a Vertical Slice Architecture (VSA) with focus on Featured and Use Cases.

This project started out as an implementation of Clean Architecture (CA). For comparison, the last commit before moving to VSA.

Read the design document.

Let's you quickly build an enterprise-ready web app with focus on Use Cases first.

To run this solution, Install .NET Tye and Docker.

Watch video here, and an older video also showing health checks and telemetry here.

This template is the result of many years of research and trying. Some of the influences are Jason Taylor's Clean Architecture template, and topics brought up by CodeOpinion and Milan Jovanovic. Thank you all!

If you are interested, check out my earlier projects: YourBrand.

Why?

Having a stable ground on which to build a project helps you to focus on what really matters: Features and Use Cases.

Following the patterns let you worry less about technical concerns.

In this particular project, you get the project structure and services you need for dispatching domain events for free. It also helps you test your code.

Feel free to adopt and modify this to your own needs. Instructions below.

Contents

  • Architecture: Vertical Slice Architecture (VSA) / Event-driven architecture
  • CQRS
  • Tests - Application, Integration Tests (with TestContainers)
  • Client app in Blazor and MudBlazor
    • Localization
    • Theming - Dark mode
  • SignalR: Real-time server-browser communication via WebSocket
  • MassTransit - RabbitMQ as transport
  • Rate limits
  • OpenTelemetry - Zipkin for viewing traces
  • Health checks
  • Identity Server - for identity management and auth

The app utilizes the Transactional Outbox Pattern for dispatching Domain events that have been serialized to the database.

Screenshots

List

Item

Board

Board (Dark mode)

Running the project

To run the app, execute this when in the solution directory:

tye run

Add --watch to make it recompile on changes to any project.

Seeding the databases

Web

dotnet run -- --seed

IdentityService

dotnet run -- /seed

Login credentials

Username: alice 
Password: alice

Username: bob 
Password: bob

Adapting this for your own project

In order to adapt this into your own project, you should do this:

  1. Replace the name of the root namespace ”TodoApp” with your desired name.
  2. Rename the solution file.
  3. Do case sensitive replacement of ”Todo” and ”todo”. This will rename variables and types. Change filenames accordingly.

Proceed to perform changes to the structure of each project:

  • In Application, remove the Todos folder, containing Commands and Queries. Add your own.
    • Replace Entities, Enums and Events etc with your domain.
  • In Infrastructure, update ApplicationDbContext and define your own Repositories.

And for the client-side, just empty ClientApp and build your own. Or, replace with whatever tech you like, e.g. an app build with a JS framework, like React.

The Client project is set up to generate C# client code from Open API/Swagger file. Update that file as you develop.

Testing

This solution contains the following test projects:

  • Architecture.Tests - verifies that the integritity of the architecture, the dependencies between projects, have not been broken.

  • Specs verifies Use Cases (scenarios). They are being grouped by Feature - not corresponding to User Stories. Implementation TBD.

  • IntegrationTests verifies that the integration points - Web API, SignalR, MassTransit - work as intended.

  • Application.Tests - verifies the application logic - commands, queries, event handlers, and services.

  • Domain.Tests - verifies the domain logic, i.e. domain objects and services.

  • Infrastructure.Tests - verifies that the infrastructure layer works as intended.

  • ClientApp.Tests - verifies that the UI components behave the way that they should.

todo-app's People

Contributors

marinasundstrom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

todo-app's Issues

UserInfo is not propagated to LoginDisplay

When the user has entered their details and proceeded in WelcomePage.

UserView.ReloadUserInfo() does not cause the cascading value "UserInfo" to update in LoginDisplay.

Temporary fix in code is doing a full refresh when redirecting.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.