Skip to content

VYDev37/Trade-Performance-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Trade Performance Tracker

A comprehensive full-stack application for tracking and analyzing trade performance, managing stock portfolios, and monitoring transaction histories.

🌟 Features

  • User Authentication: Secure Login and Registration system using JWT.
  • Interactive Dashboard: Overview of account balance and portfolio allocation with visual charts (Recharts).
  • Transaction Management: Record buy/sell actions with detailed, paginated history (including fee by percentage input).
  • Stock Positions: Track current holdings and live performance with auto-updating market prices.
  • Trade Results: Generate and share comprehensive trade result (PnL & ROI) report cards.
  • Journals & Notes: Personal note page with image and long-text support.
  • Financial Tracker: Manage and track personal financial activities through a dedicated dashboard with mobile-responsive consolidated views.
  • Profile Management: Manage user settings and adjust balance sheets dynamically.
  • AI Assistant: Built-in assistant to help analyze trading patterns and offer insights. (Coming soon)

πŸ›  Tech Stack

Backend

  • Language: Go 1.25+
  • Framework: Fiber v3
  • Database ORM: GORM
  • Database: PostgreSQL
  • Security: Argon2id for password hashing, Validator for struct validation
  • Architecture: Domain-Driven Design / Clean Architecture (delivery, domain, repository, services)

Frontend

  • Framework: Next.js 16 (App Router)
  • Library: React 19
  • Styling: Tailwind CSS v4
  • UI Components: shadcn/ui (Radix UI), Lucide Icons
  • Data Fetching: Axios
  • Charts: Recharts
  • Package Manager: pnpm

πŸ“‚ Project Structure

Trade-Performance-Tracker/
β”œβ”€β”€ backend/                  # Go API Server
β”‚   β”œβ”€β”€ cmd/                  # Entry point for the application (main.go)
β”‚   β”‚   β”œβ”€β”€ api/              # Where main.go located
β”‚   β”œβ”€β”€ internal/             # Application code (Clean Architecture)
β”‚   β”‚   β”œβ”€β”€ config/           # Configuration loaders
β”‚   β”‚   β”œβ”€β”€ delivery/         # HTTP handlers and routing
β”‚   β”‚   β”œβ”€β”€ domain/           # Core interfaces and entities
β”‚   β”‚   β”œβ”€β”€ repository/       # Database interactions
β”‚   β”‚   └── services/         # Business logic
β”‚   β”œβ”€β”€ pkg/                  # Shared utilities and helpers
β”‚   β”œβ”€β”€ .dockerignore         # Ignored files (Docker)
β”‚   β”œβ”€β”€ .env.example          # Example environment variables
β”‚   β”œβ”€β”€ .gitignore            # Ignored files (Git)
β”‚   β”œβ”€β”€ go.mod                # Go module dependencies
β”‚   β”œβ”€β”€ go.sum                # Another Go file
β”‚   └── README.md             # README
└── frontend/                 # Next.js Application
β”‚   β”œβ”€β”€ app/                  # App Router pages and layouts
β”‚   β”‚   β”œβ”€β”€ (account)/        # Auth pages (login, register)
β”‚   β”‚   β”œβ”€β”€ admin/            # Dashboard, Profile, Stocks, Transactions, Assistant, Tracker, Calculator, Journals
β”‚   β”‚   └── components/       # Shared & Local Page UI Components (for pages, etc.)
β”‚   β”œβ”€β”€ components/           # Reusable UI components (shadcn, charts, etc.)
β”‚   β”œβ”€β”€ hooks/                # Custom React hooks for API and state management
β”‚   β”œβ”€β”€ lib/                  # Utility functions
β”‚   β”œβ”€β”€ types/                # TypeScript interface definitions
β”‚   β”œβ”€β”€ .env.example          # Example environment variables for frontend
β”‚   β”œβ”€β”€ Dockerfile            # Docker instructions for frontend deployment
β”‚   β”œβ”€β”€ eslint.config.mjs     # Linting rules and code style configuration
β”‚   β”œβ”€β”€ next.env-d.ts         # TypeScript definitions for Next.js
β”‚   β”œβ”€β”€ next.config.ts        # Next.js specific configuration
β”‚   β”œβ”€β”€ package.json          # Node dependencies
β”‚   β”œβ”€β”€ pnpm-lock.yaml        # pnpm lockfile
β”‚   β”œβ”€β”€ pnpm-workspace.yaml   # Monorepo workspace configuration for pnpm
β”‚   β”œβ”€β”€ postcss.config.mjs    # Tailwind CSS and PostCSS configuration
β”‚   β”œβ”€β”€ proxy.ts              # Local development proxy settings
β”‚   β”œβ”€β”€ README.md             # README
β”‚   └── tsconfig.json         # TypeScript compiler configuration
β”œβ”€β”€ .gitignore                # Ignored files for the entire workspace (Git)
β”œβ”€β”€ backup-trade-tracker.sql  # Database snapshot or backup file
β”œβ”€β”€ CHANGELOG.md              # Record of all notable changes to the project
β”œβ”€β”€ docker-compose.yml        # Docker orchestration for local development
β”œβ”€β”€ README.md                 # Main project documentation
└── vercel.json               # Vercel config file

πŸš€ Installation & Setup

Prerequisites

  • 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)

1. Backend Setup

  1. Navigate to the backend directory:
    cd backend
  2. Set up environment variables:
    cp .env.example .env
    Edit .env to match your PostgreSQL database credentials.
  3. Install dependencies:
    go mod tidy
  4. Run migrations:
    go run core/script/auto-migrate.go
  5. Run the Go server:
    go run cmd/api/main.go
    The API will start on the configured port (default is usually :3000 or :8080).

2. Frontend Setup

  1. Open a new terminal and navigate to the frontend directory:
    cd frontend
  2. Install dependencies via pnpm:
    pnpm install
  3. Set up environment variables (if required for API endpoint URLs):
    # Create a .env.local if you need to override the default API URL (Schemas can be obtained from .env.example)
  4. Start the Next.js development server:
    pnpm run dev
    The frontend will be available at http://localhost:3000.

πŸ› οΈ Environment Variables Setup

Copy the .env.example file to .env in both /frontend and /backend directories, then fill in the following variables:

🌐 Frontend (/frontend)

Variable Description How to Obtain
NEXT_PUBLIC_API_URL Your Go Backend URL Usually http://localhost:8080 for local or your Vercel deployment URL. Default: {url}/api
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME Cloudinary Cloud Name Get it from Cloudinary Dashboard after sign up.

βš™οΈ Backend (/backend)

Variable Description How to Obtain
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.
API_GROUP_NAME Fiber route prefix Default: /api.

πŸ”§ Database Setup Guide

  • Cloud: Go to Supabase > Connect > Transaction Pooler. Use Port 6543. For more information, see images below.

  • Local: Use your local PostgreSQL URI (e.g., postgres://user:pass@localhost:5432/db)

Image 1

Image 2

Image 3

Image 4


🌍 Deployment

For comprehensive production deployment instructions on Vercel, including our seamless "Zero-Config" True Monorepo setup, please refer to the Deployment Guide.


πŸ“ License

This project is licensed under the MIT License.

About

Trade Performance Tracker built with Next.js + TypeScript + Go (Currently only support IDX stocks for inventory items)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors