Skip to content

vishwanath090/payment-wallet-chat-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WalletPay — Digital Wallet System with Realtime Messaging

WalletPay is a full-stack digital wallet and realtime communication platform built with FastAPI, PostgreSQL, React, and WebSockets.
The application delivers secure user authentication, wallet transactions, and realtime messaging with reliable delivery and presence tracking.
It is fully deployed on Vercel, Render, and Neon, showcasing practical experience in designing, building, and deploying a modern production-ready system.


Deployment Architecture Images

Frontend Deployment (Vercel)

Frontend Deployment

Backend Deployment (Render)

Backend Deployment

Database Deployment (NeonDB)

NeonDB Deployment

Production Deployments

Component URL
Frontend Application https://payment-wallet-chat-frontend.vercel.app
Backend REST API https://payment-wallet-chat-backend.onrender.com
API Documentation (Swagger UI) https://payment-wallet-chat-backend.onrender.com/docs

APPLICATION SCREENSHOTS

🔧 Backend Screenshots

🎨 Frontend Screenshots

Core Features

Authentication & Security

  • Email-based registration and login
  • Secure JWT access and refresh tokens
  • PIN-based protected actions
  • Password and PIN verification endpoints
  • Fully protected routes via dependency injection

Wallet Operations

  • Add funds to wallet
  • Transfer money between users
  • Paginated transaction history
  • Status and transaction-type tracking with Graphical analysis
  • Strict server-side validation

Realtime Messaging

  • Authenticated WebSocket channel
  • Two-way messaging between users
  • Presence tracking (online/offline)
  • Delivery and read receipts
  • Pending message delivery after reconnection
  • Chat history retrieval

Reliability & Stability

  • Automatic WebSocket reconnection
  • Optimistic UI updates
  • Server-validated persistence
  • Asynchronous database operations

Technology Stack

Frontend

  • React (Vite)
  • React Query
  • Zustand
  • Axios
  • Native WebSockets

Backend

  • FastAPI
  • SQLAlchemy (Async ORM)
  • Pydantic schemas
  • JWT authentication
  • WebSocket router

Infrastructure

  • Vercel (Frontend hosting)
  • Render (Backend hosting)
  • Neon (Managed PostgreSQL)

API Documentation Summary

Authentication Endpoints

Method Endpoint Description
POST /auth/signup Register a new user
POST /auth/login Authenticate and obtain tokens
POST /auth/refresh Refresh the access token

Wallet Endpoints

Method Endpoint Description
GET /wallet/me Retrieve wallet details
POST /wallet/add-money Add funds
POST /wallet/transfer Transfer money to another user
GET /wallet/history Paginated transaction history

Profile Endpoints

Method Endpoint Description
GET /profile/ Retrieve profile
PUT /profile/ Update profile
POST /profile/verify-pin Verify transaction PIN
POST /profile/verify-password Verify password

Messaging Endpoints (HTTP)

Method Endpoint Description
GET /chat/users List all users available for chat
GET /chat/history/{identifier} Retrieve two-way chat history
GET /chat/all-messages Fetch all messages
PUT /chat/messages/{id}/read Mark message as read

WebSocket Messaging

WebSocket URL Format

wss://payment-wallet-chat-backend.onrender.com/api/v1/chat/ws/{user_email}?token=&user_id=

Capabilities

  • Realtime message send/receive
  • Delivery confirmations
  • Read receipts
  • Presence tracking
  • Automatic delivery of pending messages

Local Development Setup

Frontend Setup

cd frontend npm install npm run dev

Backend Setup

cd backend pip install -r requirements.txt uvicorn app.main:app --reload


Deployment Guide

Frontend Deployment (Vercel)

  1. Import the GitHub repository
  2. Configure environment variables
  3. Build command: npm run build
  4. Output directory: dist

Backend Deployment (Render)

  1. Deploy as a Web Service

  2. Add environment variables

  3. Start command: gunicorn app.main:app -k uvicorn.workers.UvicornWorker -w 4

  4. Connect Neon PostgreSQL database


Project Structure (Main Subfolders)

Backend

  • backend/
    • app/
      • api/ — Route handlers (auth, wallet, chat, profile)
      • core/ — Settings, security, config, dependencies
      • crud/ — Database access layer (CRUD operations)
      • db/ — Database session, initialization, migrations
      • models/ — SQLAlchemy ORM models
      • schemas/ — Pydantic request/response schemas
      • services/ — Business logic (wallet, messaging, auth)
    • Dockerfile — Backend container configuration

Frontend

  • frontend/
    • src/
      • api/ — Axios clients, API layer
      • components/ — Reusable UI components
      • pages/ — Route-level pages (Login, Wallet, Chat)
      • context/ — Global state (auth, user, theme)
    • vite.config.js — Frontend build configuration

License

This project is licensed under the MIT License.

About

Production-ready full-stack digital wallet with secure payments, JWT authentication, real-time chat, FastAPI, React, PostgreSQL, and WebSockets.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors