The Credit Management System is a web-based application designed to process financial transactions, categorize them, and provide insightful reports. It allows users to upload transaction data in JSON format, view account details, and generate monthly reports.
- JSON File Upload: Users can upload JSON files containing account and transaction data.
- Account Management: View and manage multiple accounts.
- Transaction Processing: Automatically categorize and flag anomalous transactions.
- Monthly Reports: Generate detailed monthly reports for each account.
- Web Dashboard: A user-friendly interface to interact with the system.
- Clean Architecture
- Domain-Driven Design (DDD)
- Repository Pattern
- Result Object Pattern
- Command Query Responsibility Segregation (CQRS) Pattern with MediatR library
- ASP.NET Core MVC
- Entity Framework Core
- Postgres DB
- Structured Logging with Serilog
- Unit Testing with NSubstitute
- .NET 8, C#
- Centralized package management and build management
- MediatR: For implementing the CQRS pattern.
- FluentValidation.AspNetCore: For request validation.
- Serilog: For structured logging.
- NSubstitute: For creating mock objects in tests.
- FluentAssertions: For expressive assertions in unit tests.
The project follows a clean architecture pattern with the following main components:
- Presentation Layer (Web UI)
- Application Layer (Use Cases)
- Domain Layer (Business Logic)
- Persistence (Data Access) and Infrastructure Layer (External Concerns like email, etc.)
- CQRS Pattern: Separation of command and query responsibilities for better scalability.
- Mediator Pattern: Used MediatR for decoupling request/response logic.
- Repository Pattern: Abstraction of data persistence logic.
- Domain-Driven Design: Rich domain models with encapsulated business logic.
- Conventional commnit
The core entities in the system are:
- Account: Represents a financial account with properties like AccountNumber, AccountHolder, and Balance.
- Transaction: Represents individual financial transactions with properties like Date, Amount, Description, and Category.
To handle millions of transactions across thousands of accounts:
- Database Optimization:
- Use efficient bulk insert methods (
COPY,Mergein PostgreSQL). - Implement effective indexing strategies on frequently queried columns like AccountId, Date, and Category.
- Partition transaction tables by date for improved query performance.
- Utilize read replicas to offload read operations from the primary server.
- Use efficient bulk insert methods (
- Caching:
- Implement distributed caching solutions (e.g., Redis) for frequently accessed data like monthly reports.
- Asynchronous Processing:
- Integrate message queues (e.g., RabbitMQ, Azure Service Bus) for decoupling and processing tasks asynchronously.
- Use background job libraries (e.g., Hangfire, Quartz) for scheduled tasks and long-running operations.
- Content Delivery Network (CDN):
- Serve static assets via a CDN to reduce server load and improve response times.
- Elastic Infrastructure:
- Containerize the application using Docker.
- Use orchestration tools (e.g., Kubernetes) to manage and scale containerized workloads dynamically.
-
Encryption:
- Use AES-256 for encrypting sensitive data at rest, especially storing and retrieving. Use an encryption service to encrypt and decrypt using a key which is securely stored at the KeyVault.
- Implement TLS to secure data in transit.
-
Access Control:
- Implement Role-Based Access Control (RBAC) to restrict data access based on user roles like Admin, Customer, Super User, etc., at the controller and UI level.
- Use JWT (JSON Web Token) authentication for secure access to endpoints.
-
Compliance:
- GDPR Compliance:
- Collect only necessary data and anonymize wherever possible.
- Provide mechanisms, like an endpoint, to capture user consents and non-consents for data access and erasure requests.
- Use background jobs to anonymize the account number, name, and personal number after a certain period.
- GDPR Compliance:
-
Auditing:
- Implement comprehensive logging for user actions, system events, and security incidents with Serilog (Audit Trails).
- Maintain audit trails for critical operations, enabling traceability and accountability.
- Use log management solutions (e.g., ELK stack or Grafana, Loki, Prometheus stack) for security monitoring and incident response.
- Clone the repository from https://github.com/sathishsuresh04/CreditManagement
- Open it in using Vs code ,Visual studio or Jetbrains Rider
- Update the connection string in
appsettings.json:
"PostgresDbOptions": {
"ConnectionString": "<your-connection-string>",
"DefaultSchema": "credit_management",
"UseInMemory": false,
"CommandTimeoutInSeconds": 300,
"ExecuteRawSql": true
}- Run the application.
- Upload a JSON file containing transaction data. AccountsTransactions.json
- View the account details and monthly reports.
This project is licensed under the MIT License.