A secure, scalable payment web application built with React.js, Node.js, Express.js, and MongoDB.

| Layer | Tech |
|---|---|
| Frontend | React.js, React Router v6, Axios, Lucide |
| Styling | Custom CSS (PayPal-inspired design system) |
| Backend | Node.js, Express.js |
| Database | MongoDB + Mongoose |
| Auth | JWT (jsonwebtoken) + bcryptjs |
paynest/
├── backend/
│ ├── models/
│ │ ├── User.js # User schema (balance, accountId, bcrypt)
│ │ └── Transaction.js # Transaction schema (send/receive)
│ ├── routes/
│ │ ├── auth.js # POST /register, POST /login
│ │ ├── user.js # GET /me, GET /search
│ │ └── transaction.js # POST /send, GET /history, GET /stats
│ ├── middleware/
│ │ └── auth.js # JWT verification middleware
│ ├── server.js
│ ├── .env
│ └── package.json
└── frontend/
├── src/
│ ├── context/
│ │ └── AuthContext.js # Global auth state + API calls
│ ├── pages/
│ │ ├── Login.js # Login page
│ │ ├── Register.js # Register page
│ │ ├── Dashboard.js # Balance, stats, recent activity
│ │ ├── Send.js # Send money with user search + confirm modal
│ │ ├── History.js # Paginated transaction history with filters
│ │ └── Profile.js # User profile and security info
│ ├── components/
│ │ └── Layout.js # Sidebar + navigation
│ ├── App.js # Routes (public + private)
│ ├── index.css # Complete design system
│ └── index.js
└── package.json
- Node.js 18+
- MongoDB running locally OR a MongoDB Atlas URI
cd backend
npm install
# Edit .env if needed (MONGO_URI, JWT_SECRET)
npm run dev # nodemon for dev
# OR
npm start # productioncd frontend
npm install
npm start # Runs on http://localhost:3000Backend runs on port 5000, Frontend on port 3000. The frontend proxies
/api→http://localhost:5000viapackage.json.
- JWT-based login/register
- Passwords hashed with bcryptjs (10 rounds)
- 7-day token expiry
- Protected routes on frontend and backend
- Live balance display
- Stats: total sent, total received, transaction count
- Recent activity feed
- Real-time user search by email
- Amount validation against balance
- Confirm modal before transfer
- Atomic MongoDB transactions (sender debit + receiver credit)
- Success/failure feedback
- Paginated (10 per page)
- Filter by All / Sent / Received
- Full counterpart info + timestamps + notes
- Account ID, email, join date
- Balance snapshot
- Security info (JWT, session status)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/auth/register | ❌ | Register new user |
| POST | /api/auth/login | ❌ | Login, get JWT |
| GET | /api/user/me | ✅ | Get profile |
| GET | /api/user/search?q=email | ✅ | Search users |
| POST | /api/transaction/send | ✅ | Send money |
| GET | /api/transaction/history | ✅ | Paginated history |
| GET | /api/transaction/stats | ✅ | Sent/received totals |
- New users start with ₹1,000.00 demo balance
- All transfers are atomic (MongoDB sessions)
- Try registering 2 accounts and sending between them!