<<<<<<< HEAD
A full-stack payment system built with React frontend and Node.js backend, featuring user authentication, transaction management, and QR code generation.
- User Authentication: Secure login/register with JWT
- Transaction Management: Send and receive payments
- QR Code Generation: Generate QR codes for payments
- Real-time Balance: Track account balance
- Responsive Design: Works on desktop and mobile
- Secure API: Protected routes with middleware
- React 18
- Redux Toolkit
- Ant Design
- React Router
- Axios
- Node.js
- Express.js
- MongoDB
- JWT Authentication
- bcryptjs
- Node.js (>= 16.0.0)
- npm (>= 8.0.0)
- MongoDB (local or Atlas)
git clone <repository-url>
cd PAYMENT-SYSTEMnpm run install-allCreate backend/.env file:
MONGODB_URI=mongodb://localhost:27017/payment-system
JWT_SECRET=your_jwt_secret_key_here
PORT=5000
FRONTEND_URL=http://localhost:3000Create frontend/.env file:
REACT_APP_API_URL=http://localhost:5000npm run devThis will start both frontend (port 3000) and backend (port 5000) servers.
PAYMENT-SYSTEM/
βββ backend/
β βββ models/ # MongoDB schemas
β βββ routes/ # API routes
β βββ middleware/ # Custom middleware
β βββ server.js # Main server file
β βββ package.json
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ redux/ # Redux store & actions
β β βββ App.js # Main app component
β βββ package.json
βββ render.yaml # Render deployment config
βββ package.json # Root package.json
- Push your code to GitHub
- Set up MongoDB Atlas (recommended for production)
- Generate a strong JWT secret
-
Go to Render Dashboard
-
Click "New +" β "Web Service"
-
Connect your GitHub repository
-
Configure the service:
- Name:
payment-system-backend - Environment:
Node - Build Command:
cd backend && npm install - Start Command:
cd backend && npm start - Plan: Free
- Name:
-
Add Environment Variables:
NODE_ENV:productionMONGODB_URI: Your MongoDB Atlas connection stringJWT_SECRET: Your JWT secret keyFRONTEND_URL: Your frontend URL (will be set after frontend deployment)
-
Go to Render Dashboard
-
Click "New +" β "Static Site"
-
Connect your GitHub repository
-
Configure the service:
- Name:
payment-system-frontend - Build Command:
cd frontend && npm install && npm run build - Publish Directory:
frontend/build - Plan: Free
- Name:
-
Add Environment Variables:
REACT_APP_API_URL: Your backend URL (e.g.,https://payment-system-backend.onrender.com)
After both services are deployed:
- Update backend's
FRONTEND_URLto your frontend URL - Update frontend's
REACT_APP_API_URLto your backend URL
npm run dev- Start both frontend and backend in developmentnpm run install-all- Install dependencies for all packagesnpm run build- Build frontend for production
npm run dev- Start backend with nodemonnpm start- Start backend in production
npm start- Start frontend development servernpm run build- Build for production
- JWT-based authentication
- Password hashing with bcrypt
- Protected API routes
- CORS configuration
- Input validation
POST /api/register- Register new userPOST /api/login- User login
GET /api/users/profile- Get user profilePUT /api/users/profile- Update user profile
GET /api/transactions- Get user transactionsPOST /api/transactions- Create new transaction
POST /api/qrcode/generate- Generate QR codeGET /api/qrcode/:id- Get QR code details
-
MongoDB Connection Error
- Check your MongoDB URI
- Ensure MongoDB is running (if local)
- Verify network access (if Atlas)
-
CORS Errors
- Check
FRONTEND_URLenvironment variable - Ensure frontend URL is correct
- Check
-
Build Failures
- Check Node.js version (>= 16.0.0)
- Clear node_modules and reinstall
- Check for missing dependencies
- Use
npm run devfor development - Check console logs for errors
- Use browser dev tools for frontend debugging
- Monitor network requests in browser
This project is licensed under the MIT License.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
9fd6edf92f963a83f8fd3b31c8456146c2e26378