How omniverse-labs/fullstack-dotnet-react works
Project type and purpose
• This is a full-stack “To-Do” application with a React/Redux single-page frontend and an ASP .NET 5 Web API backend.
• Backend layers: API (Controllers), Core (services & interfaces), Data (EF Core, repositories), Tests (unit/integration).
• Frontend layers: React components, Redux actions/reducers/selectors, store, HTTP client (axios).
File structure
• Top-level folders:
• backend: contains FS.Todo.Api (Web API), FS.Todo.Core (business logic), FS.Todo.Data (EF Core context & repositories), FS.Todo.Tests (xUnit tests), FS.Todo.sln
• frontend: Create-React-App scaffold, public assets, src/features/todo, src/redux
• Key patterns:
• Layered architecture in backend (API → Service → Repository → Database)
• Dependency Injection (interfaces in Core and Data)
• EF Core code-first migrations in Data/Migrations
• Redux “ducks” pattern (actions, reducers, selectors per feature)
README insights
• Describes HTTP endpoints (GET/POST/PUT/DELETE /todo)
• Stack: .NET 5, EF Core (SQLite), React, Redux, axios, redux-thunk
• Unit tests for each layer, Swagger for API testing
Main components & their relationships
A. Frontend SPA
• React UI (components: AddTodoForm, TodoList, TodoItem, TodoPage)
• Redux layer (actions dispatch API calls, reducers update state, selectors read state)
• Axios HTTP client → calls backend endpoints
B. Backend Web API
• Controllers (TodoController) expose REST endpoints
• Core Services (ITodoService, TodoService) implement business logic
• Data Layer
– Repositories (ITodoRepository, TodoRepository) wrap EF Core DbContext
– Entities & EF Core migrations manage SQLite schema
• Program/Startup configure middleware, DI container, routing
C. Database
• SQLite file accessed via EF Core DbContext (TodoContext)
D. External/Development Tools
• Swagger/OpenAPI
• EF Core tools (dotnet-ef for migrations)
• VS Code debugger support
• Unit & integration tests (xUnit, NSubstitute, TestHost)
Architectural patterns & design principles
• Layered/Clean Architecture: Presentation → Application (services) → Domain Models → Infrastructure (repositories, EF Core)
• Dependency Inversion: controllers depend on interfaces, implementations injected at runtime
• Separation of Concerns: UI separate from state management, API separate from data access
• Code-first Migrations ensure DB version control