Skip to content

ClaudeMaxUser/PaySplit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

UPI QR Split App

This repository contains a simple web app to generate UPI QR codes and manage split payments (frontend + backend).

Quick summary:

  • Frontend: React + Vite (TypeScript)
  • Backend: Express.js + MongoDB

Prerequisites:

  • Node.js (>=18) and npm
  • MongoDB instance (local or cloud)

Quick start (development)

  1. Start the server
cd server
npm install
npm run dev
  1. Start the client
cd client
npm install
npm run dev

Open the app in your browser at the Vite dev URL (usually http://localhost:5173). The frontend expects the API at http://localhost:4000/api by default.

Environment variables (server) Create a .env file in the server folder with the following values:

PORT=4000
MONGO_URI=mongodb://localhost:27017/upi-qr-split
JWT_SECRET=your_jwt_secret_here
BASE_URL=http://localhost:5173

PORT defaults to 4000 if not set. BASE_URL is used for some generated links and defaults to http://localhost:3000 in code.

Available scripts

  • Server (in /server):
    • npm run dev — start server with nodemon (development)
    • npm run start — run production server (NODE_ENV=production)
  • Client (in /client):
    • npm run dev — start Vite dev server
    • npm run build — build the app (runs tsc -b then vite build)
    • npm run preview — preview the production build

**API overview (base: /api)

  • POST /api/auth/register — register a user (email, password, name)
  • POST /api/auth/login — login (returns JWT)
  • POST /api/qr — generate UPI QR code (body: { upiId, name, amount, note })
  • GET/POST/PUT/DELETE /api/templates — CRUD for payment templates
  • GET/POST/PUT/DELETE /api/splits — manage split groups and participants

For implementation details see the route files in server/src/routes.

Project structure (top-level)

  • client/ — frontend (Vite + React + TypeScript)
  • server/ — backend (Express)
  • server/src — server source
  • routes/ — API route handlers
  • models/ — Mongoose models
  • helper/ and utils/ — helpers and JWT utility
  • puppeteerPdf.js — helper script for PDF generation using Puppeteer

Notes & tips

  • Frontend's API base URL is in client/src/api/apiClient.ts (defaults to http://localhost:4000/api). Update it or use environment-based configuration for deployments.
  • Ensure MONGO_URI is reachable before starting the server. The server will exit with code 1 on connection failure.
  • Puppeteer is used in the project for PDF generation — installing and running may require additional system dependencies in some Linux environments.

License MIT

About

A full-stack web app for splitting bills and generating UPI QR codes for easy payment collection. Built with React, Node.js, Express, and MongoDB.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors