ChamaDAO is a blockchain-based platform that enables chama groups (community-based savings groups) in Kenya to operate more efficiently through decentralized governance, mobile money integration, and AI assistance. This repository contains the server-side component of the ChamaDAO application. The server handles critical backend operations after users have created their accounts or imported wallets on the frontend using account abstraction and wallet SDKs.
-
Profile Management: Associates wallet addresses with user profile data including:
- Full names
- Mobile numbers (for m-Pesa integration)
- Email addresses (optional)
-
KYC/AML Compliance: Handles collection, storage, and verification of identity documents for regulatory compliance.
- m-Pesa Integration: Facilitates deposits and withdrawals between Kenyan Shillings (KES) and USDT.
- Currency Conversion: Manages on-ramping (KES to USDT) and off-ramping (USDT to KES).
- Balance Display: Converts on-chain USDT balances to KES for familiar currency presentation.
-
Off-Chain Storage: Securely stores sensitive and supplementary data:
- User profiles
- Proposal texts and metadata
- Media assets
-
Database System: Utilizes efficient database technology for data storage and retrieval.
- Alert System: Sends automated notifications for:
- Loan repayment deadlines
- Voting deadlines
- Proposal updates
- Loan extension reminders
- Proposal Management: Enables chama admins to create and store proposal details off-chain.
- Voting Support: Provides data and interfaces for proposal review within the mobile app.
-
Score Calculation: Computes user reputation based on:
- Loan repayment history
- Chama contributions
- Meeting attendance
-
Creditworthiness API: Exposes reputation scores to enable loan guarantor assessments.
- Intelligent Features:
- Proposal summarization
- Voting assistance
- Governance chatbot
- Treasury optimization recommendations
- Natural language processing support
- Data Insights: Analyzes on-chain and off-chain data for performance tracking.
- Report Generation: Creates detailed reports for transparency and decision-making.
- Data Retrieval: Reads on-chain data from Base Layer 2 blockchain.
- Transaction Execution: Submits blockchain transactions when required.
- Access Control: Uses wallet addresses for authentication with role-based permissions.
- Data Protection: Encrypts sensitive information and ensures secure storage.
- Regulatory Compliance: Adheres to Kenyan financial regulations and data protection laws.
- API Layer: RESTful/GraphQL APIs for mobile app communication
- Database Layer: Secure data storage and retrieval system
- Blockchain Interface: Communication with Base Layer 2 blockchain
- m-Pesa Integration: Secure mobile money transaction handling
- AI Services: Machine learning models for intelligent features
- Security Layer: Encryption, authentication, and authorization
- Java SDK 23
- Spring Data JPA
- Spring MVC
- Database (PostgreSQL/MongoDB recommended)
- Access to m-Pesa API credentials
- Access to Base Layer 2 node
- Clone the repository:
git clone https://github.com/Chama-DAO/chamadao-server
cd chamadao-server- Configure environment variables:
# Ignore this for now
cp .env.example .env
# Edit .env with your specific configuration- Build the project:
./mvnw clean install -DskipTests- Run the server:
./mvnw spring-boot:run -DskipTestsThe server exposes APIs for the mobile application to interact with. Documentation can be accessed at:
http://localhost:8080/swagger-ui.html
Key API endpoints include:
/api/profiles- User profile management/api/financial- m-Pesa transactions and currency conversions/api/governance- Proposal and voting operations/api/reputation- Credit scoring and reputation management
- Build the production package:
./mvnw clean package -DskipTests- Deploy using Docker:
docker-compose up -d- Implement load balancing for increased user traffic
- Consider database sharding for large data volumes
- Utilize caching for frequently accessed data
- Monitor blockchain interaction for bottlenecks
- All sensitive data must be encrypted at rest and in transit
- KYC documents require special handling for compliance
- API endpoints must validate wallet signatures
- Regular security audits should be conducted
- Fork the repository
- 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
This project is licensed under the MIT License
ChamaDAO Team - ## Project Link: https://github.com/Chama-DAO/chamadao-server