A full-stack Peer-to-Peer (P2P) Lending Platform inspired by LendingClub and Prosper, designed using microservices architecture. It allows users to register as Borrowers or Lenders, create loans, invest in loans, and manage repayment—securely and in real time.
- ✅ JWT-based user authentication & role management
- 🧾 Loan creation, retrieval, and status updates
- 💸 Investment creation and user/loan-wise filtering
- 🔐 Secure APIs with Spring Security
- 📦 Containerized using Docker, orchestrated via Kubernetes (Minikube)
- 📄 API documentation via Swagger UI
- 📬 Postman collection for endpoint testing
- Tech: Spring Boot, Spring Security, JWT, PostgreSQL
- Endpoints:
/api/v1/auth/register/api/v1/auth/login
- Port:
8081 - Swagger:
http://localhost:8081/swagger-ui.html
- Tech: Spring Boot, PostgreSQL
- Endpoints:
POST /api/v1/loansGET /api/v1/loansPUT /api/v1/loans/{loanId}/approve
- Port:
8082 - Swagger:
http://localhost:8082/swagger-ui.html
- Endpoints:
POST /api/v1/investmentsGET /api/v1/investments/user/{userId}GET /api/v1/investments/loan/{loanId}
Each service uses PostgreSQL as its database engine.
Example local config (application.properties):
spring.datasource.url=jdbc:postgresql://localhost:5432/p2p_loandb
spring.datasource.username=postgres
spring.datasource.password=yourpassword
- Each microservice has its own
Dockerfile. - CI/CD set up using GitHub Actions to build and push Docker images.
docker build -t pratikbagm/userservice:latest .
docker build -t pratikbagm/loanservice:latest .Deployed on Minikube.
Commands:
kubectl apply -f k8s/userservice-deployment.yaml
kubectl apply -f k8s/loanservice-deployment.yaml
kubectl get pods
kubectl get services- Upon login, a JWT token is returned.
- Include this token in the
Authorizationheader for secured endpoints:
Authorization: Bearer <your-token>
Postman collection included in the /postman/ folder for quick testing of:
- Register/Login
- Loan creation & approval
- Investment endpoints
Access each microservice’s Swagger UI:
http://localhost:8081/swagger-ui.html— User Servicehttp://localhost:8082/swagger-ui.html— Loan Service