๐๏ธ Universal Global Equity Research Platform, Decoupled SPA Dashboard Viewer & Password-Protected Admin Panel
Overview ยท Interface Showcase ยท Features ยท Quick Start ยท Docker Deployment ยท Developer Docs ยท Changelog
stock-analyzer-app is a universal, decoupled stock research and equity analysis platform designed for global stock exchanges (US, BฤฐST, European, Asian, and international markets). It automatically sources multi-year financial statements, computes quantitative models (DuPont 5-Step, Piotroski F-Score, Altman Z-Score, Beneish M-Score, WACC, and 2D DCF Sensitivity), generates AI qualitative commentaries via OpenAI-compatible LLM provider APIs, and compiles responsive interactive HTML dashboards and printable PDF reports.
The app features a Password-Protected Admin Control Panel for managing watchlists, editing environment parameters in the browser, monitoring live log streams, and triggering single-stock or batch report executions.
graph TD
User["๐ค User / Web Browser"] -->|HTTP / SPA Dashboards| WebServer["๐ 3_web_server (FastAPI / Uvicorn)"]
Cron["โฑ๏ธ 2_cron_scheduler (APScheduler)"] -->|Periodic Reprocessing| CoreBuilder["โ๏ธ 1_core_builder (Data Engine)"]
WebServer -->|On-Demand Trigger| CoreBuilder
subgraph Data Processing Pipeline
CoreBuilder -->|Fetch Statements| YFinance["๐ Yahoo Finance API"]
CoreBuilder -->|Quant Models| Metrics["๐งฎ DuPont / DCF / Piotroski / Altman / Beneish"]
CoreBuilder -->|Prompt Engineering| LLM["๐ค OpenAI-Compatible LLM API"]
CoreBuilder -->|HTML Compiler| Reports["๐ Storage / Reports (HTML & Printable)"]
end
WebServer -->|CRUD & Indexes| DB[("๐๏ธ SQLite Database (storage/app.db)")]
Reports -->|Serve Static HTML| User
erDiagram
WATCHLIST {
int id PK
string ticker UK
string company_name
int is_active
timestamp created_at
}
REPORTS_INDEX {
int id PK
string ticker UK
string report_date UK
string file_path
real stock_price
int piotroski_score
real altman_z
real beneish_m
real wacc_pct
real dcf_fair_value
real graham_number
real lynch_fair_value
string status
text error_message
timestamp created_at
}
CRON_CONFIG {
int id PK
int ticker_delay_seconds
timestamp updated_at
}
| ๐ Watchlist Management & Reprocessing | โ๏ธ In-Browser Environment Settings Editor |
|---|---|
![]() |
![]() |
| Watchlist CRUD & On-Demand Reprocessing | Live LLM Parameters & System Log Controls |
- ๐ Institutional Quantitative Models:
- DuPont 5-Step ROE Decomposition (Tax Burden, Interest Burden, EBIT Margin, Asset Turnover, Financial Leverage).
- Piotroski F-Score (0โ9) balance sheet strength audit.
- Altman Z-Score insolvency and bankruptcy risk scoring.
- Beneish M-Score forensic accounting & earnings manipulation detection.
- WACC & 2D DCF Sensitivity Matrix (5x5 Terminal Growth vs. Discount Rate).
- ๐ Full Multi-Lingual Engine (i18n):
- 100% independent language report compilation (
EN/TR) with unified JSON catalogs (1_core_builder/locales/). - Complete Web UI internationalization (
3_web_server/locales/).
- 100% independent language report compilation (
- ๐ค AI Commentary Engine:
- 18-point qualitative financial analysis using OpenAI-compatible LLM APIs (
/v1/chat/completions). - Robust SSE stream parser with fallback to rich quantitative commentary if LLM is unreachable or times out.
- 18-point qualitative financial analysis using OpenAI-compatible LLM APIs (
- ๐จ Dual Dashboard Formats:
- Interactive SPA HTML Dashboard with glassmorphism design, dark/light theme toggle, and Chart.js visualizations.
- Single-Page Printable PDF Report optimized for print and instant export.
- ๐ Password-Protected Admin Control Panel:
- Web UI secured via
.envADMIN_PASSWORD. - Watchlist CRUD management (Add, edit, delete, activate/deactivate tickers).
- In-Browser Environment Settings Editor for Admin Password, LLM Provider Base URL, API Key, Model Name, Output Language, LLM Timeout, and Cron Delay Seconds.
- Reprocessing controls for single stock (
โก Analyze) or batch execution (๐ Run All).
- Web UI secured via
- ๐ System File Logging & Controls:
- Fixed 15-line console log window with custom vertical scrollbar.
- Separate log tabs for
cron.log,analysis.log, andLive Execution. ๐๏ธ Clear Logsbutton for instant log truncation on disk and in UI.
- ๐ณ Docker Ready:
- 100% self-contained containerized codebase with Docker Compose orchestration.
graph TD
Client["Browser / Client Dashboard :6031"] -->|FastAPI REST APIs & SPA| A["3_web_server/main.py"]
A -->|Read/Write Watchlist & Index| B[("storage/app.db SQLite")]
C["2_cron_scheduler/scheduler.py Daily 18:30 TSI"] -->|Automated Trigger| D["1_core_builder/generate_report.py"]
A -->|On-Demand Reprocess API| D
D --> E["1_core_builder/fetch_yfinance.py Sourcing & Quant Engine"]
D --> F["OpenAI-Compatible LLM API / Quantitative Fallback"]
D --> G["1_core_builder/html_compiler.py"]
G --> H["storage/reports/TICKER/YYYYMMDD.html"]
G --> I["storage/reports/TICKER/YYYYMMDD_printable.html"]
erDiagram
WATCHLIST ||--o{ REPORTS_INDEX : "generates multi-year reports"
WATCHLIST {
string ticker PK "Stock symbol e.g. THYAO.IS, AAPL"
string company_name "Company display name"
string market "Exchange code e.g. BIST, NASDAQ"
integer is_active "1 = Active cron target, 0 = Disabled"
datetime created_at "Timestamp of creation"
datetime updated_at "Timestamp of last modification"
}
REPORTS_INDEX {
integer id PK "Auto-incrementing primary key"
string ticker FK "Foreign key to Watchlist ticker"
string report_date "Report date code YYYYMMDD"
string html_path "Relative path to interactive HTML dashboard"
string printable_path "Relative path to printable PDF/HTML report"
string lang "Language code EN or TR"
datetime generated_at "Generation timestamp"
}
STORAGE_FS ||--o{ HTML_REPORTS : "stores compiled reports"
STORAGE_FS ||--o{ APP_LOGS : "stores system event streams"
STORAGE_FS {
string path PK "storage/ directory root"
}
HTML_REPORTS {
string file_path PK "storage/reports/{TICKER}/{YYYYMMDD}.html"
}
APP_LOGS {
string log_path PK "storage/logs/cron.log and analysis.log"
}
stock-analyzer-app/
โโโ logo.svg # Vector brand header logo
โโโ .env.example # Environment configuration template
โโโ VERSION # Central application version file
โโโ Dockerfile # Container definition (Python 3.13-slim)
โโโ docker-compose.yml # Orchestration for Web Server and Cron Scheduler
โโโ startdev.sh # 1-Command local development boot script (proxy)
โโโ startprd.sh # 1-Command Docker production boot script (proxy)
โโโ scripts/ # Boot scripts and rollback infrastructure
โ โโโ startdev.sh # Development server runner
โ โโโ startprd.sh # Production container runner
โ โโโ __bkp/rollback.sh # Auto-generated 1-command rollback mechanism
โโโ 1_core_builder/ # Standalone CLI Report Builder
โ โโโ generate_report.py # Pipeline orchestrator
โ โโโ fetch_yfinance.py # yfinance data sourcing & quantitative models
โ โโโ llm_commentary.py # LLM qualitative commentary engine
โ โโโ html_compiler.py # HTML dashboard & printable PDF generator
โ โโโ locales/ # Core report builder translation catalogs (EN/TR)
โโโ 2_cron_scheduler/ # Background Cron Scheduler Worker
โ โโโ scheduler.py # APScheduler worker running daily at 18:30 TSI
โ โโโ watchlist.json # Watchlist JSON synced with SQLite DB
โโโ 3_web_server/ # FastAPI Web Application & Admin Panel
โ โโโ main.py # REST APIs, Admin Modal, Settings Editor & Log Viewers
โ โโโ locales/ # Web UI translation catalogs (EN/TR)
โโโ documentation/ # Modular Developer Documentation & Guides
โ โโโ README.md # Documentation index & architecture
โ โโโ adding_new_language.md
โ โโโ adding_new_financial_metric.md
โ โโโ adding_new_report_tab.md
โ โโโ api_and_web_server.md
โโโ storage/ # Application persistent data
โโโ app.db # SQLite database (watchlist & reports_index)
โโโ reports/ # Generated HTML reports per ticker directory
โโโ logs/ # Application log files (cron.log & analysis.log)
./startdev.shBoots the FastAPI web application with live reload at http://localhost:6031.
# Clone the repository
git clone https://github.com/dturkuler/stock-analyzer-app.git
cd stock-analyzer-app
# Create environment file from template
cp .env.example .env
# Run local dev script
./startdev.shpython -m uvicorn 3_web_server.main:app --host 0.0.0.0 --port 6031Open http://localhost:6031 in your browser. Click ๐ Admin Panel and log in with your .env password.
python 1_core_builder/generate_report.py THYAO.IS --lang TRpython 2_cron_scheduler/scheduler.pyFor detailed production deployment instructions on a new VPS (including volume persistence and Cloudflare Tunnel setup), see the VPS Production Deployment Guide.
# Build and start Web Server & Scheduler containers
docker compose up -d --build# Check container status
docker compose ps
# View Web Server logs
docker logs -f stock_web
# View Cron Scheduler logs
docker logs -f stock_schedulerFor complete extension guides and system maintenance docs, visit the documentation/ directory:
- ๐ Adding a New Language (i18n): How to add new translation catalogs (e.g. German, French, Spanish).
- ๐งฎ Adding a New Financial Metric: How to compute custom quantitative formulas and display them in reports.
- ๐ Adding a New Report Tab/Module: Step-by-step guide for creating new report modules.
- ๐ Web Server & API Architecture: REST API endpoints, SQLite database schema, and security details.
The application manages settings via the .env file or the In-Browser Admin Panel Editor:
| Variable | Default | Description |
|---|---|---|
ADMIN_PASSWORD |
change_this_to_your_secure_password |
Password for Admin Control Panel access |
ALLOWED_ORIGINS |
http://localhost:6031 |
Allowed CORS origins (comma-separated domain list) |
LLM_BASE_URL |
https://api.your-llm-provider.com/v1 |
Base URL for OpenAI-compatible LLM provider |
LLM_API_KEY |
your_api_key_here |
API Key for LLM provider service |
LLM_MODEL |
your_llm_model_name |
Target LLM model name |
OUTPUT_LANGUAGE |
TR |
Default report output language (TR or EN) |
LLM_TIMEOUT |
120 |
Request timeout in seconds for LLM commentary calls |
CRON_DELAY_SECONDS |
15 |
Waiting delay in seconds between sequential stock analyses in daily cron job |
This project is licensed under the MIT License - see the LICENSE file for details.

