Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

LINK OF THE SITE=https://payment-app-frontend-kappa.vercel.app/

Payment App

A secure and scalable full-stack payment application that allows users to:

  • Create an account
  • Log in securely
  • View wallet balance
  • Search other users
  • Transfer money
  • View transaction history

Built with React, Node.js, Express, MongoDB, JWT, and MongoDB Transactions.

Tech Stack

Frontend

  • React + Vite
  • Axios (API client)
  • Tailwind / Custom Styling
  • JWT-based auth (via Axios interceptor)

Backend

  • Node.js + Express
  • MongoDB + Mongoose
  • JWT Authentication
  • Bcrypt Password Hashing
  • Zod Input Validation
  • Helmet + CORS + Rate Limiting
  • MongoDB Transactions for funds transfer

Key Features

1. Secure Authentication

  • Signup & Signin with password hashing
  • JWT-based login
  • Middleware to protect private endpoints

2. Wallet System

  • Every user has an account with a starting balance
  • View real-time balance
  • Protected balance endpoint

3. Money Transfer (Atomic & Safe)

  • MongoDB transactions ensure no partial updates
  • Deducts from sender & adds to receiver atomically
  • Prevents inconsistent balances

4. Transaction History

  • Paginated transaction list
  • Includes sender/receiver names
  • Sorted by timestamp

5. User Search

  • Search users by name or email
  • Regex search with proper escaping
  • Excludes current user

6. Production-grade Backend Setup

  • Helmet security headers
  • CORS with restricted origin
  • Morgan request logging
  • Graceful server shutdown
  • Centralized error handling

Folder Structure backend/
├─ ─ controllers/ # Business logic (auth, account, users)
├─ ─ models/ # Mongoose schemas
├─ ─ routes/ # Route definitions
├─ ─ middlewares/ # JWT auth middleware
├─ ─ db.js # MongoDB connection
├─ ─ config.js # Environment variables
└─ ─ server.js # Express app entry

frontend/
├── src/
│ ├─ ─ components/ # UI components
│ ├─ ─ pages/ # Screens
│ ├─ ─ api.js # Axios client with token interceptor
│ ├─ ─ App.jsx
│ └─ ─ main.jsx

API Endpoints

Auth Method   Endpoint   Description

POST   /user/signup   Create account
POST   /user/signin   Login & get JWT

Account
Method   Endpoint   Description

GET   /account/balance   Get wallet balance
POST   /account/transfer   Send money
GET   /account/transactions View   transaction history

Users
Method   Endpoint   Description

GET   /user/bulk   Search users

Screenshots 1 2 3 4

Security Considerations

  • Bcrypt hashing for passwords
  • JWT authentication for protected actions
  • Rate limiter to prevent brute-force attacks
  • Helmet for OWASP-standard security headers
  • Zod for strict validation
  • Regex escaping to prevent injection

Future Improvements

  • Access + Refresh token system
  • Push notifications for transactions
  • Real-time balance updates (WebSockets)
  • Transaction categories & notes
  • Email/phone OTP login

Releases

Packages

Contributors

Languages