An open API service indexing awesome lists of open source software.

https://github.com/fathimasithara01/tradeverse

A production-ready multi-role copy trading platform built with Golang, Clean Architecture, Domain-Driven Design, and PostgreSQL — including Admin, Trader, and Customer modules with automated trade execution, RBAC, subscriptions, wallets, and scalable domain separation.
https://github.com/fathimasithara01/tradeverse

automation backend clean-architecture copy-trading crone-job ddd go golang postgres rbac saas seeder

Last synced: 5 months ago
JSON representation

A production-ready multi-role copy trading platform built with Golang, Clean Architecture, Domain-Driven Design, and PostgreSQL — including Admin, Trader, and Customer modules with automated trade execution, RBAC, subscriptions, wallets, and scalable domain separation.

Awesome Lists containing this project

README

          

A production-ready multi-role fintech platform with real-time trading,
wallet ledgering, subscription automation, and admin controls — built using
Golang, PostgreSQL, Clean Architecture, and Cron Workers.

# Tradeverse – Multi-Role Trading Automation Platform

[![Go Version](https://img.shields.io/badge/Go-1.21+-00ADD8?logo=go)]()
[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-15+-336791?logo=postgresql)]()
[![License](https://img.shields.io/badge/License-MIT-green.svg)]()
[![Build Status](https://img.shields.io/badge/Status-Production--Ready-success)]()
[![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-blue.svg)]()

A production-grade **trading, wallet, and subscription automation system** built using
**Golang, PostgreSQL, Clean Architecture, Cron Jobs, RBAC, and Real-Time Market APIs.**

Tradeverse is designed as a **multi-role fintech platform** supporting:

* **Admin**
* **Trader**
* **Customer**

It follows strict engineering standards similar to real-world fintech systems.

---

## Overview

Tradeverse includes:

* Real-time market price fetching (OHLC / snapshot)
* Automated subscription lifecycle (expiry, disable, notify)
* Wallet system with strict ledger consistency
* Trader signal publishing + analytics
* Dynamic admin-driven pricing
* JWT + RBAC (Admin / Trader / Customer)
* Cron-based background workers
* Full Admin UI

This project demonstrates **scalable backend architecture**, **clean code**, and **production-level fintech engineering**.

---

## Features

### Cron Jobs (Schedulers)

* Real-time market data fetcher
* Configurable intervals
* Retry + rate limiting
* Normalized OHLC storage

### Subscription Automation

* Auto-expiry
* Auto-disable access
* Notification triggers
* Batch-optimized

### Admin UI

* User CRUD
* Commission & pricing configuration
* API key / cron intervals
* Dashboard + charts

### Dynamic Pricing

* Commission % control
* DB-driven pricing
* Trader-specific plans

### Signal Cards

* Entry, SL, targets
* Live price
* Color-coded cards
* Trader info

### RBAC (Role Based Access Control)

* Admin / Trader / Customer
* JWT with role + plan + expiry
* Backend + UI-controlled access

### User Management

* CRUD
* Role assignment
* Block/Unblock
* Subscription status

### Dashboard Insights

* Revenue analytics
* Live prices
* Active subscriptions
* Trader/customer statistics

---

## Role Breakdown

### Customer

* Signup / Login
* Browse traders
* Subscribe / Unsubscribe
* Wallet deposit/withdraw/history
* KYC uploads
* View subscribed signals

### Trader

* Create/publish signals
* Live trade updates
* Subscription plans
* Subscriber analytics
* Profile management

### Admin

* Manage users & traders
* Pricing & commission rules
* System settings
* Dashboard analytics
* Audit logs

---

## Architecture Overview

### Clean Architecture Layers

* **Handlers** — routing, request parsing
* **Services** — business logic
* **Repositories** — DB + external APIs
* **Domain Models** — entities

### Project Structure

```
tradeverse/
├── cmd/
│ ├── admin/
│ ├── trader/
│ └── customer/
├── config/
├── internal/
│ ├── admin/
│ ├── trader/
│ └── customer/
├── migrations/
├── pkg/
│ ├── auth/
│ ├── models/
│ ├── payment_gateway.go
│ ├── seeder/
│ └── utils/
├── static/
├── templates/
└── README.md
```

### Request Flow

```
Client → Router → Handler → Service → Repository → PostgreSQL
```

---

## Core Modules

### Authentication

* JWT-based
* RBAC middleware
* Claims contain role + subscription

### Wallet System

* Deposit / Withdraw
* Transaction ledger
* Race-condition safe
* Accurate balance tracking

### Trader Module

* Signal CRUD
* Live trade publishing
* Subscription plans
* Subscriber analytics

### Customer Module

* Explore traders
* Subscribe/unsubscribe
* View signals
* Wallet + KYC

### Admin Module

* User & trader management
* Plans & commissions
* System configuration
* Analytics dashboard

---

## API Endpoints (High-Level)

### Trader

```
/login
/createSignal
/getAllSignals
/updateSignal
/CreateTraderSubscriptionPlan
/ListSubscribers
/PublishLiveTrade
/GetBalance
/Deposit
/Withdraw
```

### Customer

```
/signup
/login
/ListTraders
/GetTraderDetails
/SubscribeToTrader
/GetSignalsFromSubscribedTraders
/kycDocument
/GetWalletSummary
```

### Admin

```
/ListAdminSubscriptionPlans
/SubscribeToAdminPlan
/CancelAdminSubscription
```

# Postman Collection (API Testing)

TradeVerse includes a complete Postman setup for testing all Admin, Trader, and Customer API workflows.

---

## Included Files

| File | Purpose |
|------|---------|
| `/postman/TradeVerse_API_Collection.json` | Full API collection with all endpoints |
| `/postman/TradeVerse_Environment.json` | Pre-configured environment variables |

---

## How to Import

1. Open **Postman**
2. Click **Import**
3. Select both:
- `TradeVerse_API_Collection.json`
- `TradeVerse_Environment.json`
4. Set active environment: **TradeVerse Local**

---

## Required Environment Variables (Manual Setup)

BASE_URL = http://localhost:8080
ADMIN_TOKEN =
TRADER_TOKEN =
CUSTOMER_TOKEN =

---

## What You Can Test
* Authentication (Admin/Trader/Customer)

* Wallet operations (deposit/withdraw/ledger)

* Trader signals

* Live trade updates

* Subscriptions

* KYC uploads

* Market data (OHLC + live)

* Cron simulation

* Dashboard analytics

---

## Why Important?
* Recruiters test your backend instantly

* Shows professional API documentation

* Proves production-readiness

---

## 🛠 Tech Stack

* **Golang (Gin Framework)**
* **PostgreSQL**
* **GORM ORM**
* **Cron Jobs**
* **Server-rendered Admin UI**
* **JWT Authentication**
* **Clean Architecture + DDD**
* **Docker Ready**

---

## Internals Summary

* Market Fetcher — cron-based OHLC + price
* Subscription Watcher — auto-expiry
* RBAC Engine — role logic
* Admin Configuration
* Signal Cards with real-time data
* Dashboard analytics

---

## Running the Project

### Start Admin

```sh
go run cmd/admin/main.go
```

### Start Trader

```sh
go run cmd/trader/main.go
```

### Start Customer

```sh
go run cmd/customer/main.go
```

### Run Migrations

```sh
go run internal/migrations/main.go
```

### Seed Data

```sh
go run pkg/seeder/main.go
```

---

## Run Locally

```bash
git clone https://github.com/fathimasithara01/tradeverse
cd tradeverse
cp .env.example .env
go mod tidy
go run cmd/server/main.go

## Security

* JWT expiry + rotation
* Secrets via Vault / AWS SM
* SQL injection protection
* HTTPS + Nginx
* CORS restrictions
* Rate limiting

---

## Deployment

* Docker / Docker Compose
* Kubernetes-ready
* Worker containers
* Prometheus metrics
* Redis caching & pub/sub
* Cloud PostgreSQL

---

## Why This Project is Valuable for Recruiters
- Shows backend ownership end-to-end
- Demonstrates realistic fintech domain knowledge
- Highlights distributed cron workers & automation
- Proves understanding of architecture & scalability
- Perfect fit for Backend (Golang) / Fintech / SaaS roles

## Why This Project Stands Out

* Rare multi-role fintech system
* Realistic wallet + subscription engine
* Clean Architecture + DDD
* Horizontally scalable
* Production-like engineering

---

## System Diagram

```
+-----------------------+
| Client (UI) |
+-----------+-----------+
|
v
+--------+--------+
| API Layer |
| (Gin Handlers) |
+--------+--------+
|
v
+--------+--------+
| Services |
| (Business Logic) |
+--------+--------+
|
v
+--------+--------+
| Repositories |
| (DB Layer) |
+--------+--------+
|
v
+-------------------+
| PostgreSQL DB |
+-------------------+
```

---

## Author

**Fathima Sithara**
Backend Developer — Golang • Microservices • Fintech
Email: fathimasithara011@gmail.com
GitHub: github.com/fathimasithara01

---