Squawker is a modern social messaging platform built with Clean Architecture principles and cloud-native design. This platform allows users to post short messages called "squawks" with built-in validation, rate limiting, and telemetry.
- User Messaging: Create, retrieve, and manage short messages ("squawks")
- Content Validation: Automatic filtering of banned terms and duplicate content
- Rate Limiting: Prevents rapid-fire posting (20-second minimum between posts)
- Monitoring: Comprehensive telemetry and observability
- Clean Architecture: Domain-driven design with clear separation of concerns
- .NET 9.0 SDK or later
- Visual Studio 2022 or VS Code
Run the following command to build the solution:
dotnet build -tlTo run the web application:
cd .\src\Web\
dotnet watch runNavigate to https://localhost:5001. The application will automatically reload if you change any of the source files.
Squawker includes comprehensive monitoring and telemetry:
- Performance Metrics: Track API response times and throughput
- User Activity: Monitor squawk creation and retrieval patterns
- Content Validation: Track banned term usage and duplicate content attempts
- Custom Dimensions: Filter telemetry by user, operation, and content type
The solution contains comprehensive test suites:
- Unit Tests: Verify business logic and validation rules
- Integration Tests: Test repository and database interactions
- Functional Tests: End-to-end API testing
Run tests with:
dotnet testThe template includes support to scaffold new commands and queries.
Start in the Application folder.
Create a new command:
dotnet new ca-usecase --name CreateSquawk --feature-name Squawks --usecase-type command --return-type GuidCreate a new query:
dotnet new ca-usecase -n GetSquawks -fn Squawks -ut query -rt SquawksVmIf you encounter the error "No templates or subcommands found matching: 'ca-usecase'.", install the template and try again:
dotnet new install Clean.Architecture.Solution.Template::9.0.8The project includes EditorConfig support to help maintain consistent coding styles across various editors and IDEs. The .editorconfig file defines coding styles applicable to this solution.
- Domain: Core entities, enums, exceptions, and logic
- Application: Business logic and commands/queries
- Infrastructure: External concerns like databases and identity
- Web: API controllers and UI components
- Tests: Unit, integration, and functional tests
Squawker tracks the following events:
squawk.banned_term.count: Number of posts containing banned termssquawk.duplicate.count: Number of duplicate content submissionsresult.found: Whether a squawk lookup found resultsquery.result_count: Number of squawks returned in queriesdb.operation: Database operation type (insert, query, etc.)
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
To learn more about the template go to the Clean Architecture project website.
For Azure best practices and guidance, refer to:
Built with ❤️ using Clean Architecture and cloud-native design principles.