docs / 08-decisions.md

Decisions

iTrades Architecture Decision Log

This file records significant architectural decisions and the reasoning behind them.

Minor implementation decisions do not need to be recorded.


ADR-001 — Next.js Full-Stack Architecture

Date: 2026-08-07

Status: Accepted

Decision

iTrades will use Next.js with TypeScript as the primary full-stack application framework.

Reason

Next.js integrates naturally with Vercel and allows the frontend and server-side application logic to remain within one project.

Alternatives Considered

Separate React frontend and Node.js API.

Python/Django backend.

Reason Alternatives Were Rejected

A separate frontend/backend architecture would increase infrastructure complexity without providing a meaningful Version 1 advantage.


ADR-002 — PostgreSQL Database

Date: 2026-08-07

Status: Accepted

Decision

iTrades will use PostgreSQL hosted through Supabase.

Reason

Trading data is highly relational and benefits from relational integrity, indexing, aggregation, and transactional operations.


ADR-003 — Trade and Execution Separation

Date: 2026-08-07

Status: Accepted

Decision

Trades and executions will be stored as separate entities.

Reason

A single trade may contain multiple entries and exits.

This architecture supports:

  • Scaling in
  • Scaling out
  • Partial exits
  • Accurate average entry
  • Accurate average exit
  • Accurate fees
  • Execution-level TradingView markers

Alternative

Store a single entry price and exit price on Trade.

Reason Rejected

This model cannot accurately represent many real-world trades.