Enterprise Blockchain Audit Logging System
Stack: ReactJS (Frontend) β’ Go (Backend) β’ PostgreSQL (Off-chain storage) β’ Hyperledger Fabric (Private blockchain)
The Banking Audit Ledger is a comprehensive enterprise audit logging system designed for banking institutions. It provides immutable audit trails by storing log hashes on a private Hyperledger Fabric blockchain while maintaining detailed logs in PostgreSQL for fast querying and analysis.
- Immutable Audit Trail: Log hashes stored on Hyperledger Fabric blockchain
- Real-time Verification: Verify log integrity by comparing off-chain and on-chain hashes
- Modern Web Interface: React-based dashboard for log management and monitoring
- RESTful API: Go-based backend with comprehensive API endpoints
- Enterprise Ready: Docker containerization and production-ready configuration
flowchart TD
Client[Web Frontend] -->|REST API| API[Go Backend]
API --> DB[PostgreSQL Database]
API -->|Commit Hash| Fabric[Hyperledger Fabric]
Auditor[Auditor/Regulator] -->|Verify Request| API
API -->|Query Hash| Fabric
API -->|Compare| DB
- Frontend (React): Modern web interface for log management and verification
- Backend (Go): REST API service with blockchain integration
- Database (PostgreSQL): Off-chain log storage and metadata
- Blockchain (Hyperledger Fabric): Immutable hash storage and verification
- Docker & Docker Compose
- Go 1.20+
- Node.js 18+
- Hyperledger Fabric tools (cryptogen, configtxgen)
- Clone the repository
git clone <repository-url>
cd banking-audit-ledger- Run the setup script
./setup.shThe setup script will:
- Check prerequisites
- Generate Fabric network configuration
- Build and start all services
- Deploy chaincode
- Run system tests
- Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8080
- API Health: http://localhost:8080/healthz
If you prefer manual setup:
- Start the Fabric network
cd blockchain-fabric
./scripts/network.sh up- Start the backend
cd backend-go
go mod tidy
go run cmd/main.go- Start the frontend
cd frontend-react
npm install
npm startbanking-audit-ledger/
βββ frontend-react/ # React frontend application
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ services/ # API service functions
β β βββ utils/ # Utility functions
β βββ Dockerfile
β βββ nginx.conf
βββ backend-go/ # Go backend API
β βββ cmd/ # Application entry point
β βββ internal/ # Internal packages
β β βββ api/ # HTTP handlers
β β βββ config/ # Configuration
β β βββ database/ # Database layer
β β βββ fabric/ # Fabric client
β β βββ models/ # Data models
β β βββ services/ # Business logic
β βββ pkg/ # Public packages
β βββ Dockerfile
βββ blockchain-fabric/ # Hyperledger Fabric network
β βββ chaincode/ # Smart contract
β βββ network/ # Network configuration
β βββ scripts/ # Network management scripts
βββ docker-compose.yml # Docker Compose configuration
βββ setup.sh # Setup script
POST /api/v1/logs- Create a new audit logGET /api/v1/logs/:id- Get log by IDGET /api/v1/logs- List logs with pagination and filters
GET /api/v1/verify/:id- Verify log integrity
GET /healthz- Health checkGET /metrics- Prometheus metrics
Create a log:
curl -X POST http://localhost:8080/api/v1/logs \
-H "Content-Type: application/json" \
-d '{
"source": "core-banking",
"event_type": "transfer",
"payload": {
"from": "account-001",
"to": "account-002",
"amount": 1000,
"currency": "USD"
}
}'Verify a log:
curl http://localhost:8080/api/v1/verify/<log-id>cd backend-go
go mod tidy
go run cmd/main.gocd frontend-react
npm install
npm startcd blockchain-fabric
./scripts/network.sh up
./scripts/network.sh testStart all services:
docker-compose up -dStop all services:
docker-compose downView logs:
docker-compose logs -f [service-name]Rebuild services:
docker-compose up --build -d# Backend tests
cd backend-go
go test ./...
# Frontend tests
cd frontend-react
npm test# Run the setup script which includes integration tests
./setup.sh- Access the frontend at http://localhost:3000
- Use the Admin panel to create test logs
- Verify logs using the verification feature
- Check the dashboard for log status
- Health Checks: Built-in health check endpoints
- Metrics: Prometheus metrics available at http://localhost:9090/metrics
- Logs: Structured logging with configurable levels
- Docker Health: Container health checks configured
- Key Management: Use HSM or AWS KMS for production private keys
- Network Security: TLS for all communications
- Access Control: Implement RBAC for audit endpoints
- Data Privacy: Only hashes stored on-chain, sensitive data off-chain
- Configure environment variables
- Set up production database
- Deploy Fabric network
- Build and deploy containers
- Configure load balancer
- Set up monitoring
- ECS/EKS: Container orchestration
- RDS: Managed PostgreSQL
- EC2: Fabric network nodes
- CloudWatch: Monitoring and logging
- Secrets Manager: Key management
- Throughput: 1000+ logs per second
- Latency: <100ms for log creation
- Verification: <500ms for hash verification
- Scalability: Horizontal scaling supported
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details
For questions or support:
- Create an issue in the repository
- Contact the development team
- Check the documentation
Built with β€οΈ for enterprise blockchain solutions