mirror of
https://github.com/shawnkim1997/All-in-one-Financial-Analysis.git
synced 2026-08-19 21:38:11 +00:00
Complete migration from Streamlit to Next.js 14 App Router + FastAPI backend. Frontend (Next.js 14): - 10 pages: Overview, Research, Valuation, Technical, Markets, Earnings, News, Portfolio, Filings, Settings - Terminal Noir dark theme with custom Tailwind config - TradingView Lightweight Charts for candlestick/volume - Valuation: DCF, Sensitivity Matrix, Monte Carlo, Tornado, Reverse DCF - Financial Statements table with YoY growth badges and margin rows - SEC EDGAR inline filing viewer with section tabs - News split-view with iframe article embedding - Technical Analysis with RSI, MACD, Bollinger, Fibonacci, Moving Averages - Earnings beat/miss visualization - AI Copilot chat panel with Gemini integration Backend (FastAPI): - 13 routers: market_data, financials, valuation, technical, earnings, insider, edgar, news, portfolio, analysis, chat, estimates, fx - Services: DCF engine, Monte Carlo simulation, sensitivity analysis, risk metrics, SEC parser, technical indicators - yfinance + yahooquery data sources with fallback pattern - SQLite caching layer Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
1.2 KiB
SQL
39 lines
1.2 KiB
SQL
-- Portfolio positions table
|
|
CREATE TABLE IF NOT EXISTS positions (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
user_id TEXT NOT NULL,
|
|
ticker TEXT NOT NULL,
|
|
company_name TEXT,
|
|
quantity DECIMAL(15,6) NOT NULL,
|
|
avg_price DECIMAL(15,4) NOT NULL,
|
|
currency TEXT DEFAULT 'USD',
|
|
source TEXT DEFAULT 'manual',
|
|
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
updated_at TIMESTAMPTZ DEFAULT NOW()
|
|
);
|
|
|
|
-- Watchlist table
|
|
CREATE TABLE IF NOT EXISTS watchlist (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
user_id TEXT NOT NULL,
|
|
ticker TEXT NOT NULL,
|
|
added_at TIMESTAMPTZ DEFAULT NOW()
|
|
);
|
|
|
|
-- Analysis cache table
|
|
CREATE TABLE IF NOT EXISTS analysis_cache (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
ticker TEXT NOT NULL,
|
|
analysis_type TEXT NOT NULL,
|
|
data JSONB NOT NULL,
|
|
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
expires_at TIMESTAMPTZ NOT NULL
|
|
);
|
|
|
|
-- Indexes
|
|
CREATE INDEX idx_positions_user ON positions(user_id);
|
|
CREATE INDEX idx_positions_ticker ON positions(ticker);
|
|
CREATE INDEX idx_watchlist_user ON watchlist(user_id);
|
|
CREATE INDEX idx_cache_ticker_type ON analysis_cache(ticker, analysis_type);
|
|
CREATE INDEX idx_cache_expires ON analysis_cache(expires_at);
|