A premium, full-stack, real-time portfolio management and financial auditing application tailored for tracking stock portfolios, analyzing trade performances, and monitoring personal cashflows.
- Advanced Security & Authentication: Secure login and registration system utilizing JWT verification and Argon2id password hashing, enhanced with automated skeleton suspense loaders for a seamless user experience.
- IDX Composite Terminal: A high-performance trading terminal rendering real-time stock details, fundamental metrics, and interactive charts powered by TradingView's
lightweight-charts. - Automated Market Feeds: Integration of background daemons and modules to fetch live tick prices and historical candlestick data directly from Yahoo Finance.
- Multi-Account Financial Tracker: Manage multiple distinct broker portfolios and bank accounts under a single unified dashboard. Includes dynamic budget tracking, consolidated balance sheets, and mobile-responsive chronological cashflow views.
- Trade Management & Audits: Record buy/sell actions with custom execution fee inputs. Track current holdings and live performance with detailed, paginated transaction histories equipped with server-side filtering and search.
- Interactive Analytics Dashboard: A visual overview of account balances and portfolio allocations with interactive data visualization powered by Recharts.
- Shareable Trade Cards: Instant generation of clean, professional PnL and ROI performance report cards, perfect for sharing trading results.
- Comprehensive Trading Journals: Document trading plans and personal notes with rich-text support, cloud-backed image attachments, and responsive card-based layouts for both desktop and mobile.
- Profile Configuration: Manage user settings and adjust balance sheet structures dynamically to fit evolving financial needs.
- AI Portfolio Auditor (Coming Soon): A built-in intelligent agent designed to analyze trading habits, detect performance anomalies, and offer custom advisory insights..
- Language & Runtime: Go 1.25+
- Core HTTP Engine: Fiber v3 (High-performance, low-overhead routing)
- Database Engine: PostgreSQL with connection pooling
- ORM Persistence Layer: GORM (Auto-migrations and relational bindings)
- Data Validation & Security: Argon2id crypt hashes, struct validations
- Architecture: Domain-Driven Design (DDD) & Clean Architecture
- Core Platform: Next.js 16 (App Router, Server Components by default)
- View Layer: React 19
- State Management: Zustand
- Data Validation: Zod (Type-safe schemas)
- Styling & UI: Vanilla CSS and Tailwind CSS v4
- Components System: shadcn/ui (Radix UI), Lucide Icons
- Data Fetching: Axios
- Interactive Visualizers: Recharts & TradingView Lightweight Charts
- Package Manager: pnpm
Trade-Performance-Tracker/
βββ backend/ # Go API Engine
β βββ cmd/ # Application Entrypoints
β β βββ api/ # Fiber API runtime
β β βββ main.go # Bootstraps configuration, DB, handlers, and routers
β βββ core/ # Domain-Driven Design Core
β β βββ config/ # DB connectivity, pooling & environment configs
β β βββ delivery/ # Request controllers & endpoint routing
β β β βββ handlers/ # Endpoint handlers (user, positions, notes, assets, etc.)
β β β βββ http/ # Fiber router configuration (routers.go)
β β βββ domain/ # Core business models, GORM structures & contracts
β β βββ integrations/ # Live market data scrapers & scanner feeds
β β β βββ providers/ # TV Scanner (TradingView) & Yahoo Finance adapters
β β βββ repositories/ # Database access layers & persistence queries
β β βββ script/ # Executable utilities (auto-migrate.go script)
β β βββ services/ # Enterprise logic, use cases & calculations
β β βββ worker/ # Background daemons (update_stock.go price synchronizer)
β βββ pkg/ # Reusable framework utilities
β β βββ middleware/ # Security & JWT router guards
β β βββ utils/ # Crypt encoders, number formatters, error wrappers
β βββ .dockerignore # Excluded files for containerization
β βββ .env.example # Backend environment blueprint
β βββ .gitignore # Git patterns to ignore in backend
β βββ Dockerfile # Go lightweight production container
β βββ go.mod # Go engine dependencies
β βββ go.sum # Dependecies checksum verification
β βββ README.md # Backend technical guide
β
βββ frontend/ # Next.js Application
β βββ app/ # Next.js App Router (Strictly route pages and layouts)
β β βββ (account)/ # Auth routes (login, register) with Server/Client splits
β β β βββ loading.tsx # Animated auth page skeleton loader
β β β βββ login/ # LoginPage Server parent + LoginClient interactive form
β β β βββ register/ # RegisterPage Server parent + RegisterClient interactive form
β β βββ admin/ # Secured administrative dashboard views
β β β βββ assistant/ # AI Copilot layout and conversational workspace
β β β βββ calculator/ # Position sizing & risk-reward ratio calculator
β β β βββ composite/ # IDX Composite Terminal details & lightweight-charts UI
β β β βββ dashboard/ # Unified balance summaries & key statistics
β β β βββ journals/ # Notebook space & formatted journal cards
β β β βββ profile/ # Accounts management, asset splits & passwords
β β β βββ stocks/ # Holdings trackers with dynamic metadata routing
β β β βββ transactions/ # Filterable logs, trade audits & fee records
β β βββ favicon.ico # App Favicon
β β βββ globals.css # Typography, tailwind layers & scroll themes
β β βββ layout.tsx # Root HTML frame & fonts binding
β β βββ page.tsx # Main landing page route entrypoint
β βββ components/ # Reusable UI components
β β βββ calculator/ # Custom numeric pads and input screens
β β βββ dashboard/ # Account balance widgets & charts cards
β β βββ journal/ # Note editors & popup sheet displays
β β βββ profile/ # Allocation charts & manage-balance side sheets
β β βββ shared/ # Common Dialog wrappers, image boxes & modals
β β βββ stock/ # Position selectors & custom charts
β β βββ terminal/ # TradingView lightweight chart visualizers
β β βββ tracker/ # Budgeting columns & mobile-friendly lists
β β βββ trades/ # Performance modal wrappers & ROI sheets
β β βββ transaction/ # Responsive table structures & data columns
β β βββ ui/ # Shadcn/ui core primitive components
β β βββ user/ # Authentication controls & reusable input forms
β β βββ AdminSidebar.tsx # Main navigation bar layout
β β βββ ThemeProvider.tsx # System theme contexts switcher
β βββ hooks/ # Custom React hooks (domain-specific & viewport helpers)
β β βββ asset/ # IDX composite details and candle chart queries
β β βββ calculator/ # Formulas and evaluations helpers
β β βββ note/ # Journal fetchers, adders, modifiers, and deleters
β β βββ position/ # Holdings mutations and live-prices socket listeners
β β βββ table/ # Sorting and paginating helpers
β β βββ transaction/ # Historical lists queries and migrations handlers
β β βββ use-mobile.ts # Global viewport width detector helper
β β βββ user/ # Auth session actions, registration flows, and profiles
β βββ lib/ # Standard utilities, formatting, and axios configurations
β β βββ axios.ts # Preconfigured axios instance routing to backend endpoints
β β βββ formatter.ts # Currency conversion, dates, and number formatters
β β βββ utils.ts # Class merging utility (cn) helper
β βββ schemas/ # Safe runtime validators enforced via Zod
β β βββ asset.schema.ts # IDX asset data formats validation
β β βββ auth.schema.ts # Authentication models validation
β β βββ balance.schema.ts # Capital and balance transaction data validator
β β βββ journal.schema.ts # Journal logs and attachments validator
β β βββ transaction.schema.ts # Orders and trade executions validator
β βββ stores/ # Global stores managed via Zustand
β β βββ useTransactionStore.ts # Synced cache for user order histories
β β βββ useUserStore.ts # Active profile context and authentication session store
β βββ app.config.ts # App constant configuration options
β βββ public/ # Static graphical assets & icons
β βββ tsconfig.json # Compiler rules for TypeScript
β βββ next.config.ts # Core Next.js configuration rules
β βββ package.json # Node modules dependencies and task runners
β βββ pnpm-lock.yaml # Pnpm lockfile for deterministic installs
β βββ pnpm-workspace.yaml # Monorepo workspaces definition
β βββ eslint.config.mjs # Code style enforcement rules
β βββ postcss.config.mjs # CSS compile specifications
β βββ proxy.ts # Dev server connection proxies
β βββ README.md # Frontend user guide
β
βββ .gitignore # Global project files to ignore
βββ backup-trade-tracker.sql # Relational database seed snapshot
βββ CHANGELOG.md # Historic record of releases & milestones
βββ DEPLOYMENT.md # Production cloud deployment guide
βββ docker-compose.yml # Container orchestration blueprints
βββ vercel.json # Monorepo vercel routing config
βββ README.md # Main workspace manual
- Go (1.25 or higher)
- Node.js (20 or higher)
- pnpm (Preferred package manager)
- PostgreSQL (Main database)
- Cloudinary (Media management for image uploads and CDN.)
- Vercel (Managed PostgreSQL & Connection Pooling.)
- Supabase (Managed PostgreSQL & Connection Pooling, use this if you're going to online)
- Navigate to the backend directory:
cd backend - Setup environment variables:
Edit
cp .env.example .env
.envto configure your PostgreSQL credentials. - Download dependencies:
go mod tidy
- Perform auto-migration:
go run core/script/auto-migrate.go
- Boot the server engine:
The server starts on the configured port (default
go run cmd/api/main.go
:8080).
- Open a new terminal session and navigate to the frontend directory:
cd frontend - Install clean dependencies:
pnpm install
- Boot the Next.js development server:
Access the client directly at http://localhost:3000.
pnpm run dev
Copy the .env.example file to .env in both /frontend and /backend directories, then fill in the following variables:
| Variable | Description | Source |
|---|---|---|
NEXT_PUBLIC_API_URL |
Go Backend Engine URL | Default: http://localhost:8080/api |
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME |
Cloudinary Account Name | Cloudinary Console Dashboard |
| Variable | Description | Source |
|---|---|---|
DB_CONNECTION |
PostgreSQL Connection String | See Database Setup Guide |
PORT |
Server Port | Default: 8080. |
JWT_SECRET |
Secret key for JWT signing | Create a random secure string (e.g., using openssl rand -base64 32). |
PRODUCTION_MODE |
App environment state | Set to false for local dev, true for production/Vercel. |
PRODUCTION_ENVIRONMENT |
App environment name | Example: Vercel, localhost, etc. |
API_GROUP_NAME |
Fiber route prefix | Default: /api. |
ALLOW_ORIGINS |
Allowed CORS Origins (splitted with comma) | Example: http://localhost:3000, https://tpt-v3.vercel.app. |
- Cloud (Recommended): Go to Supabase > Connect > Transaction Pooler. Use Port
6543. - Local Dev: Use your local PostgreSQL connection string (e.g.,
postgres://user:pass@localhost:5432/db).
For comprehensive production deployment instructions on Vercel, including our seamless "Zero-Config" True Monorepo setup, please refer to the Deployment Guide.
This project is licensed under the MIT License.