SecureTransact is a reference implementation demonstrating enterprise patterns for secure transaction processing in regulated industries. Built with Clean Architecture, CQRS, and Event Sourcing.
- Clean Architecture — Domain-centric design with zero infrastructure dependencies
- CQRS — Separate read/write models for optimized performance
- Event Sourcing — Complete audit trail with hash-chained events
- Cryptographic Security — HMAC-SHA256 signing, CSPRNG tokens, AES-256-GCM
- Compliance Ready — Designed for fintech, healthcare, and gaming regulations
- Observable — OpenTelemetry integration for distributed tracing
┌─────────────────────────────────────────────────────────────┐
│ API Layer │
│ Endpoints │ Middleware │ Filters │ Authentication │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────────────────────────────────────────────────────┐
│ Application Layer │
│ Commands │ Queries │ Handlers │ Validators │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────────────────────────────────────────────────────┐
│ Domain Layer │
│ Aggregates │ Events │ Value Objects │ Interfaces │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────────────────────────────────────────────────────┐
│ Infrastructure Layer │
│ Event Store │ Repositories │ Caching │ Crypto │
└─────────────────────────────────────────────────────────────┘
# Clone the repository
git clone https://github.com/MancoMen-Software-Studio/Secure-Transact-API.git
cd Secure-Transact-API
# Start dependencies (PostgreSQL, Redis)
docker-compose up -d
# Run the API
dotnet run --project src/SecureTransact.Api
# API is now running at https://localhost:5001- .NET 9 SDK
- Docker (for PostgreSQL and Redis)
- PostgreSQL 17 (or use Docker)
- Redis 7.4 (or use Docker)
# Build and run everything
docker-compose -f docker-compose.full.yml up --build-
Clone and restore
git clone https://github.com/MancoMen-Software-Studio/Secure-Transact-API.git cd Secure-Transact-API dotnet restore -
Configure environment
cp src/SecureTransact.Api/appsettings.Development.example.json \ src/SecureTransact.Api/appsettings.Development.json # Edit the file with your settings -
Run database migrations
dotnet ef database update --project src/SecureTransact.Infrastructure
-
Start the API
dotnet run --project src/SecureTransact.Api
POST /api/v1/transactions
Content-Type: application/json
Authorization: Bearer <token>
{
"sourceAccountId": "acc_123",
"destinationAccountId": "acc_456",
"amount": {
"value": 100.00,
"currency": "USD"
},
"reference": "INV-2024-001"
}GET /api/v1/accounts/acc_123/transactions?from=2024-01-01&to=2024-12-31
Authorization: Bearer <token>POST /api/v1/audit/verify-chain
Content-Type: application/json
{
"streamId": "account-acc_123",
"fromVersion": 1,
"toVersion": 100
}| Variable | Description | Default |
|---|---|---|
ConnectionStrings__Database |
PostgreSQL connection string | — |
ConnectionStrings__Redis |
Redis connection string | localhost:6379 |
Jwt__Secret |
JWT signing key (min 32 chars) | — |
Jwt__Issuer |
JWT issuer | SecureTransact |
Jwt__ExpirationMinutes |
Token expiration | 15 |
Cryptography__HmacKey |
HMAC signing key | — |
# Run all tests
dotnet test
# Run with coverage
dotnet test --collect:"XPlat Code Coverage"
# Run specific test project
dotnet test tests/SecureTransact.Domain.Tests| Layer | Minimum Coverage |
|---|---|
| Domain | 90% |
| Application | 85% |
| Infrastructure | 70% |
| API | 60% |
SecureTransact/
├── src/
│ ├── SecureTransact.Domain/ # Business logic, zero dependencies
│ ├── SecureTransact.Application/ # Use cases, CQRS handlers
│ ├── SecureTransact.Infrastructure/ # Database, external services
│ └── SecureTransact.Api/ # HTTP endpoints
├── tests/
│ ├── SecureTransact.Domain.Tests/
│ ├── SecureTransact.Application.Tests/
│ ├── SecureTransact.Infrastructure.Tests/
│ ├── SecureTransact.Api.Tests/
│ └── SecureTransact.Architecture.Tests/
└── infra/
├── terraform/
├── docker/
└── k8s/
Deployed via GitHub Actions to Azure Container Apps.
az containerapp up \
--name securetransact-api \
--resource-group mancomen-rg \
--environment mancomen-env \
--source .We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file.
- MediatR by Jimmy Bogard
- FluentValidation by Jeremy Skinner
Built by MancoMen Software Studio