Skip to content

RaginiSharma01/GoPay-Lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GoPay Lite

GoPay Lite is a full-stack payment application built using Golang microservices, Next.js frontend, JWT authentication, and Razorpay for payment processing. It demonstrates a clean microservices architecture with Dockerized deployment.

Tech Stack used:

FrontEnd

  • Framework: Next.js
  • Language: JavaScript / React
  • API Calls: REST via fetch
  • Styling: CSS Modules

Backend Microservices (Golang)

  • Auth Service: JWT login/register, middleware
  • Payment Service: Razorpay integration for creating orders
  • API Gateway: Reverse proxy routing via Gorilla Mux

Authentication

  • JWT tokens stored in localStorage

  • Token verification on each protected route

    Tools & Infra

  • PostgreSQL (DB)

  • Docker & Docker Compose

  • Swagger Docs

  • .env based config

Folder Structure

gopay-lite/ ├── client/ │ └── gopay-lite-frontend/ # Next.js frontend app ├── server/ │ ├── api-gateway/ # API Gateway in Go │ ├── auth-service/ # Auth microservice │ └── payment-service/ # Payment microservice (Razorpay)


Setup & Run (Local Dev)

1. Clone Repo

git clone https://github.com/your-username/gopay-lite.git
cd gopay-lite

Docker Build & Run

Ensure Docker Desktop is installed and running

# Auth service
cd server/auth-service
docker build -t auth-service .
docker run --rm -p 8083:8083 \
  -e DB_HOST=host.docker.internal \
  -e DB_USER=postgres \
  -e DB_PASSWORD=1234 \
  -e DB_NAME=gopaydb \
  -e JWT_SECRET=your-secret-key \
  auth-service

# Payment service
cd ../payment-service
docker build -t payment-service .
docker run --rm -p 8084:8084 \
  -e DATABASE_URL="postgres://postgres:[email protected]:5432/gopaydb?sslmode=disable" \
  -e JWT_SECRET=your-secret-key \
  -e RAZORPAY_KEY=your-razorpay-key \
  -e RAZORPAY_SECRET=your-razorpay-secret \
  payment-service

# API Gateway
cd ../api-gateway
go run main.go

Frontend Setup

cd client/gopay-lite-frontend
npm install
# Set environment
cp .env.local.example .env.local
# Edit .env.local to point to API Gateway
npm run dev

Frontend runs at: http://localhost:3000 API Gateway runs at: http://localhost:8080

Features

Register / Login with JWT Razorpay order creation Wallet & Transaction display Token-based API access Reverse proxy routing through API gateway

API Endpoints

Method Endpoint Description POST /api/v1/auth/register Register a user POST /api/v1/auth/login Login a user GET /api/v1/auth/me Get user info (protected) POST /api/v1/pay Create Razorpay order

UI

ui3 ui2 ui ui5