A community-based finance platform that enables P2P lending within verified communities, built with the MERN stack (MongoDB, Express, React, Node.js).
- User Authentication: Secure registration and login with JWT, email, and phone (OTP) verification.
- Community Management: Create, join, and manage community-based lending groups.
- Loan System: Request, approve, fund, and track loans within communities.
- Financial Assistant: AI-powered chatbot to provide financial guidance and assistance.
- Real-time Communication: Community chat and notifications using Socket.io.
- User Verification: KYC verification system using Aadhar and PAN card.
- Dashboard & Analytics: Track loans, payments, and community metrics.
- Node.js & Express: Server framework
- MongoDB & Mongoose: Database and ODM
- Socket.io: Real-time communication
- JWT: Authentication and authorization
- bcryptjs: Password hashing
- React.js: UI framework
- Redux Toolkit: State management
- Material-UI: Component library
- React Router: Navigation
- Axios: API requests
- Socket.io-client: Real-time communication
- Node.js (v14 or later)
- MongoDB
- npm or yarn
-
Clone the repository
git clone https://github.com/yourusername/community-finance.git cd community-finance -
Install dependencies
cd backend npm install -
Create config file Create a
config.envfile in thebackend/configdirectory with the following variables:NODE_ENV=development PORT=5000 MONGO_URI=mongodb://localhost:27017/community_finance JWT_SECRET=your_jwt_secret_key_here JWT_EXPIRE=30d GEOCODER_PROVIDER=mapquest GEOCODER_API_KEY=your_mapquest_api_key_here FILE_UPLOAD_PATH=./public/uploads MAX_FILE_UPLOAD=1000000 -
Start the server
npm run dev
-
Install dependencies
cd frontend npm install -
Start the client
npm start
POST /api/auth/register- Register a new userPOST /api/auth/login- Login userPOST /api/auth/send-otp- Send OTP for phone verificationPOST /api/auth/verify-otp- Verify OTP and login/registerGET /api/auth/logout- Logout userGET /api/auth/me- Get current user profilePUT /api/auth/updatedetails- Update user detailsPUT /api/auth/updatepassword- Update passwordPOST /api/auth/forgotpassword- Send password reset emailPUT /api/auth/resetpassword/:resettoken- Reset password
GET /api/users- Get all users (admin only)GET /api/users/:id- Get single user (admin only)POST /api/users- Create user (admin only)PUT /api/users/:id- Update user (admin only)DELETE /api/users/:id- Delete user (admin only)GET /api/users/profile- Get current user profilePUT /api/users/profile- Update current user profilePOST /api/users/verify- Upload verification documentsPUT /api/users/:id/verify- Process user verification (admin only)
GET /api/communities- Get all communitiesGET /api/communities/nearby- Get nearby communitiesGET /api/communities/:id- Get single communityPOST /api/communities- Create new communityPUT /api/communities/:id- Update communityDELETE /api/communities/:id- Delete communityPOST /api/communities/:id/join- Request to join communityPUT /api/communities/:id/requests/:requestId- Process join requestDELETE /api/communities/:id/leave- Leave communityPUT /api/communities/:id/members/:userId- Update member roleDELETE /api/communities/:id/members/:userId- Remove memberPOST /api/communities/:id/announcements- Create announcementGET /api/communities/:communityId/members- Get community membersGET /api/communities/:communityId/loans- Get community loansPOST /api/communities/:communityId/loans- Create loan request
GET /api/loans- Get all loansGET /api/loans/:id- Get single loanPUT /api/loans/:id- Update loanPUT /api/loans/:id/process- Process loan (approve, reject, fund, etc.)POST /api/loans/:id/payments- Record loan paymentGET /api/users/:userId/loans- Get user's loans
POST /api/chatbot/message- Process chatbot messageGET /api/chatbot/suggestions- Get suggested questions
joinCommunity- Join a community chat roomleaveCommunity- Leave a community chat roomsendMessage- Send a chat messagemessage- Receive a chat message
chatbotMessage- Send a message to the chatbotchatbotResponse- Receive a response from the chatbot
MIT License