Skip to content

Latest commit

 

History

History
110 lines (77 loc) · 2.79 KB

README.md

File metadata and controls

110 lines (77 loc) · 2.79 KB

SwiftPay

SwiftPay is a full-stack fintech wallet application for securely sending money between users. It provides account authentication, email OTP verification, bank linking, transaction PIN protection, transfer history, and recent payees.

Features

  • User sign-up and login with JWT-based authentication
  • Email OTP verification and transaction-PIN reset flow
  • Bank account linking and transaction PIN setup
  • Secure transfers to users by SwiftPay ID
  • Transaction history, recent payees, and balance dashboard
  • Protected client routes and protected API endpoints

Tech stack

  • Frontend: React, Vite, React Router, Axios, Tailwind CSS
  • Backend: Node.js, Express, MongoDB with Mongoose
  • Security & email: JWT, bcrypt, Nodemailer

Project structure

SwiftPay/
├── client/    # React single-page application
└── server/    # Express REST API and MongoDB models

Prerequisites

  • Node.js 18 or later
  • MongoDB connection string (local MongoDB or MongoDB Atlas)
  • A Gmail account with an app password for OTP emails

Installation

Clone the repository, then install dependencies for both applications:

git clone https://github.com/ankush-exe/SwiftPay.git
cd SwiftPay

cd server
npm install

cd ../client
npm install

Configuration

Create server/.env from server/.env.example and provide your values:

PORT=5001
CLIENT_URL=http://localhost:5173
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_long_random_jwt_secret
EMAIL_USER=your_gmail_address
EMAIL_PASS=your_gmail_app_password

Create client/.env from client/.env.example:

VITE_API_BASE_URL=http://localhost:5001/api

Do not commit either .env file or real credentials.

Run locally

Start the API in one terminal:

cd server
npm run dev

Start the frontend in another terminal:

cd client
npm run dev

Open the local URL shown by Vite (normally http://localhost:5173). The API runs on http://localhost:5001 by default.

Available scripts

Directory Command Purpose
client npm run dev Start the Vite development server
client npm run build Create a production frontend build
client npm run lint Lint the frontend source
server npm run dev Start the API with Nodemon
server npm start Start the API with Node.js

API overview

Area Base route Operations
Authentication /api/auth Sign up, log in, send and verify OTPs
Users /api/users Link bank, manage transaction PIN, look up SwiftPay IDs
Transactions /api/transactions Transfer money, retrieve/clear history, get recent payees

Most user and transaction endpoints require a valid JWT bearer token.

License

This project is licensed under the ISC License.