A multi-level referral and commission system for Nika Finance, built using:
- Java: 25
- Spring Boot: 3.5.6
- PostgreSQL: 18.0
- Maven build tool
- Create DB
referral_dbin PostgreSQL 18.0 - Add
.envfile with DB_USER and DB_PASSWORD - Run: mvn clean install mvn spring-boot:run
POST /api/referral/generate → Generate referral code
POST /api/referral/register → Register user with optional referral
POST /api/webhook/trade → Simulate trade & distribute commission
GET /api/users → Get all users
GET /api/users/{id} → Get user by ID
GET /api/users/{id}/referrals → Get referrals for user
GET /api/commissions/{userId} → Get user commissions
Run:
mvn test
All tests use JUnit 5, Mockito, and MockMvc.
Simulates Web3 payout logic (not connected to real blockchain).
Uses USDC as the token for fee and commission simulation.
© 2025 Abhishek Kumar.
All rights reserved. Not licensed for production or commercial use.