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.
- Framework: Next.js
- Language: JavaScript / React
- API Calls: REST via
fetch
- Styling: CSS Modules
- Auth Service: JWT login/register, middleware
- Payment Service: Razorpay integration for creating orders
- API Gateway: Reverse proxy routing via Gorilla Mux
-
JWT tokens stored in
localStorage
-
Token verification on each protected route
-
PostgreSQL (DB)
-
Docker & Docker Compose
-
Swagger Docs
-
.env based config
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)
git clone https://github.com/your-username/gopay-lite.git
cd gopay-lite
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
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
Register / Login with JWT Razorpay order creation Wallet & Transaction display Token-based API access Reverse proxy routing through API gateway
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



