- Overview
- Features
- Technologies Used
- Setup and Installation
- Running the Application
- Running Tests
- Project Structure
- Contributing
- License
The CRUD Test Application is a full-stack web application designed to manage customer data. It allows users to perform Create, Read, Update, and Delete (CRUD) operations on customer records. The application adheres to best practices in software development, ensuring consistency, scalability, and maintainability.
- Add Customer: Create new customer records with validated input.
- View Customers: Display a list of all customers with search and filter capabilities.
- Edit Customer: Update existing customer information.
- Delete Customer: Remove customer records securely.
- Responsive UI: Built with Blazor WebAssembly for a seamless user experience across devices.
- API Documentation: Integrated Swagger UI for easy API exploration and testing.
- Automated Testing: Comprehensive acceptance tests to ensure application reliability.
- Blazor WebAssembly - For building interactive web UIs using C#.
- ASP.NET Core - For building robust and scalable APIs.
- Entity Framework Core - For ORM and database interactions.
- MediatR - For implementing the mediator pattern.
- FluentValidation - For model validation.
- SpecFlow - For Behavior-Driven Development (BDD) style acceptance tests.
- xUnit - For unit and integration testing.
- AutoMapper - For object-object mapping.
- Swagger - For API documentation and testing.
-
.NET 7 SDK
-
Visual Studio 2022 or Visual Studio Code with necessary extensions.
-
Clone the Repository:
git clone https://github.com/your-repo/crud-test-dotnet.git cd crud-test-dotnet
-
Navigate to the Server Project and Restore Dependencies:
cd src/Presentation.Api dotnet restore
-
Apply Database Migrations:
dotnet ef database update
-
Navigate to the Client Project and Restore Dependencies:
cd ../Presentation.Client dotnet restore
-
Navigate to the Shared Project and Restore Dependencies:
cd ../Presentation.Shared dotnet restore
-
Navigate to the Acceptance Tests Project and Restore Dependencies:
cd ../../tests/AcceptanceTests dotnet restore
-
Start the Server:
cd src/Presentation.Api dotnet run
The API will be available at https://localhost:5091/. Swagger UI can be accessed at https://localhost:5091/swagger.
-
Start the Client:
cd ../Presentation.Client dotnet run
The Blazor WebAssembly client will be available at https://localhost:7046/.
-
Access the Application: Open your browser and navigate to https://localhost:7046/ to use the application.
-
Navigate to the Acceptance Tests Project:
cd tests/AcceptanceTests
-
Run Tests:
dotnet test
- Similar steps apply for running unit and integration tests within their respective test projects.
-
Navigate to the Project Root:
cd crud-test-dotnet
-
Build and Run Containers:
docker-compose up --build
-
Access the Application:
- The client is available at http://localhost:7045/.
- The API is available at http://localhost:5090/.
crud-test-dotnet/
├── src/
│ ├── Core/
│ │ ├── Application/ # Application layer - CQRS, Business Logic, MediatR Commands
│ │ └── Domain/ # Domain entities and business rules
│ ├── Infrastructure/
│ │ └── Persistence/ # Data access, database configurations, repositories
│ ├── Presentation/
│ │ ├── Api/ # ASP.NET Core API Project
│ │ ├── Client/ # Blazor WebAssembly Project
│ │ └── Shared/ # Shared DTOs and contracts between client and API
├── tests/
│ ├── AcceptanceTests/ # SpecFlow-based acceptance testing project
│ └── UnitTests/ # xUnit-based unit testing
├
└── README.md
- Core.Application: Business logic, application services, commands, and queries.
- Core.Domain: Domain models, including entities and value objects.
- Infrastructure.Persistence: Persistence layer for data access, including database context and repository implementations.
- Presentation.Api: ASP.NET Core Web API for backend services.
- Presentation.Client: Blazor WebAssembly for the frontend UI.
- Presentation.Shared: Shared DTOs and validation logic for consistency.
- AcceptanceTests: BDD acceptance tests using SpecFlow.
- UnitTests: Unit tests for core components using xUnit.