Skip to content

yashjcodes/PayNest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

🪺 PayNest — Full-Stack Payment Web Application

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


🚀 Tech Stack

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

📁 Project Structure

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

⚙️ Setup & Run

1. Prerequisites

  • Node.js 18+
  • MongoDB running locally OR a MongoDB Atlas URI

2. Backend Setup

cd backend
npm install
# Edit .env if needed (MONGO_URI, JWT_SECRET)
npm run dev       # nodemon for dev
# OR
npm start         # production

3. Frontend Setup

cd frontend
npm install
npm start         # Runs on http://localhost:3000

Backend runs on port 5000, Frontend on port 3000. The frontend proxies /apihttp://localhost:5000 via package.json.


🔐 Features

Authentication

  • JWT-based login/register
  • Passwords hashed with bcryptjs (10 rounds)
  • 7-day token expiry
  • Protected routes on frontend and backend

Dashboard

  • Live balance display
  • Stats: total sent, total received, transaction count
  • Recent activity feed

Send Money

  • Real-time user search by email
  • Amount validation against balance
  • Confirm modal before transfer
  • Atomic MongoDB transactions (sender debit + receiver credit)
  • Success/failure feedback

Transaction History

  • Paginated (10 per page)
  • Filter by All / Sent / Received
  • Full counterpart info + timestamps + notes

Profile

  • Account ID, email, join date
  • Balance snapshot
  • Security info (JWT, session status)

🗃️ API Endpoints

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

🌱 Demo

  • New users start with ₹1,000.00 demo balance
  • All transfers are atomic (MongoDB sessions)
  • Try registering 2 accounts and sending between them!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors