The app supports authentication, balance tracking, and sending money between users.
This repository contains a Paysa wallet application split into two folders:
backend/- Node.js + TypeScript API using Express and Prisma (PostgreSQL)frontend/- React + TypeScript + Vite single-page app
The README below explains how to run the app locally, how to configure environment variables.
-
backend/- Express API, Prisma client generated tobackend/src/generated/prisma.src/- TypeScript source filesprisma/- Prisma schema and migrations.env- runtime environment variables (seebackend/.env.example)
-
frontend/- Vite + React appsrc/- React components and pagespublic/orfrontend/assets/- place static assets or screenshots here
Below is a screenshot of the Dashboard page showing wallet balance and users list.
Use the backend/.env.example as a template and create a backend/.env locally.
Prerequisites: Node >= 18, npm, and a PostgreSQL-compatible database (Neon, Postgres, etc.).
- Install dependencies
cd backend
npm install- Create
.env(copy.env.exampleand fill values):
cp .env.example .env
# edit .env and set DATABASE_URL and SECRET_KEY- Generate Prisma client and apply migrations (development):
npx prisma migrate dev
npx prisma generate- Build and run the backend
npx tsc
npm run devThe API will listen on port 3000 by default.
Prerequisites: Node >= 18, npm
- Install dependencies
cd frontend
npm install- Run dev server
npm run devOpen the app in your browser (Vite will print the local URL, usually http://localhost:5173).
- The backend issues a JWT on sign-in/sign-up.
- The frontend stores the token in
localStorageand sends it in thetokenheader for protected API calls. - Protected routes in the frontend redirect unauthenticated or expired sessions to
/signin.
Readme generated with the help of copilot
