CleanArchitectureApp is a modern, enterprise, test-covered, clean architecture application built with:
- ASP.NET Core
- Entity Framework Core
- Microsoft Azure (App Services and Azure SQL)
- React with Recoil
- Tailwind CSS
The project follows the Clean Architecture principles to ensure separation of concerns and maintainability.
- Application: Contains the business logic, DTOs, service interfaces, AutoMapper profiles, and validation.
- Core: Contains the core entities and repository interfaces.
- Infrastructure: Contains the data access logic, dependency injection configurations, and infrastructure-specific services.
- Presentation: Contains the REST API and web front-end in React.
- Tests: Contains unit and integration tests.
- .NET 8.0 SDK
- Node.js and npm
- Azure account (for deployment)
- Navigate to the API project:
cd src/Presentation/API
- Run the project:
dotnet run
- Navigate to the front-end project:
cd src/Presentation/Web
- Install dependencies:
npm install
- Run the project:
npm start
- Navigate to the tests directory:
cd tests
- Run unit tests:
dotnet test UnitTests/UnitTests.csproj
- Run integration tests:
dotnet test IntegrationTests/IntegrationTests.csproj
Follow the steps to deploy the application to Azure App Services and Azure SQL.
- Azure App Services:
- Deploy the ASP.NET Core backend.
- Continuous deployment using GitHub Actions.
- Azure SQL Database:
- Provision and configure the database.
- Migrate database schema using Entity Framework migrations.
Use GitHub Actions for CI/CD. Example workflow:
name: CI/CD Pipeline
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Run tests
run: dotnet test --no-build --verbosity normal
- name: Publish
run: dotnet publish -c Release -o out
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: 'YOUR_APP_NAME'
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: './out'
- Fork the repository
- Create a feature branch
- Commit your changes
- Push your branch
- Create a pull request