# supanan2548/atc-screener architecture

> Architecture diagram of the GitHub repository supanan2548/atc-screener, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/supanan2548/atc-screener
- Repository: https://github.com/supanan2548/atc-screener

## Overview

Binance Altcoin Screener is a browser-based market-analysis dashboard. After Supabase login, the user enters a workflow that loads cached market data, computes activity scores, and presents a filterable screener with live quotes; selecting an asset opens candles, indicators, and summary signals. Separate branches provide futures metrics and a risk calculator, plus starred watchlists and scheduled multi-timeframe scans. The README documents additional interface and indicator capabilities not fully represented in the sampled excerpts; those are mapped to their existing frontend paths without implying unverified internal calls.

Main entry points: [`frontend/js/chart.js`](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/chart.js) (Charts and detail), [`api/binance.js`](https://github.com/supanan2548/atc-screener/blob/main/api/binance.js) (Binance futures proxy), [`frontend/js/main.js`](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/main.js) (App startup), [`api/scan.js`](https://github.com/supanan2548/atc-screener/blob/main/api/scan.js) (Scheduled scanner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Interface"]
  node_auth["Login and session<br/>[auth.js]"]
  node_app["App startup<br/>[main.js]"]
end

subgraph group_market["Market Data"]
  node_live["Live market feed<br/>[live.js]"]
  node_futquotes["Futures quotes<br/>[futquotes.js]"]
  node_futmap["Contract mapping<br/>[futmap.js]"]
  node_cgclient["CoinGecko client<br/>[coingecko.js]"]
end

subgraph group_analysis["Analysis"]
  node_screener["Screener and scoring<br/>[screener.js]"]
  node_watchlist["Starred assets<br/>[watchlist.js]"]
  node_scanui["Scan results UI<br/>[scan.js]"]
  node_signals["Summary signals<br/>[signals.js]"]
  node_chart["Charts and detail<br/>[chart.js]"]
  node_indicators["Indicator calculations<br/>[indicators.js]"]
  node_futures["Futures and risk<br/>[futures.js]"]
end

subgraph group_backend["Backend and State"]
  node_api_cg["Markets API<br/>[coingecko.js]"]
  node_sync["Market sync<br/>[sync-markets.js]"]
  node_scanner["Scheduled scanner<br/>[scan.js]"]
  node_binance_proxy["Binance futures proxy<br/>[binance.js]"]
  node_binance_lib["Spot board access<br/>[binance.js]"]
  node_server_indicators["Scan indicators<br/>[indicators.js]"]
  node_supa["PostgREST access<br/>[supa.js]"]
  node_markets_db[("Markets table")]
  node_scan_db[("Scan results table")]
  node_profiles_db[("Profiles and watchlist")]
end

node_user(("Dashboard user"))
node_binance(("Binance APIs"))
node_coingecko(("CoinGecko API"))
node_supabase_auth(("Supabase Auth"))
node_cron(("Supabase pg_cron"))
node_bybit(("Bybit liquidation feed"))

node_user -->|"signs in"| node_auth
node_auth -->|"authenticates"| node_supabase_auth
node_auth -->|"starts app"| node_app
node_app -->|"loads markets"| node_screener
node_app -->|"connects feed"| node_live
node_app -->|"starts quotes"| node_futquotes
node_app -->|"starts scan UI"| node_scanui
node_screener -->|"requests markets"| node_cgclient
node_cgclient -->|"fetches"| node_api_cg
node_api_cg -->|"reads markets"| node_supa
node_supa -->|"queries"| node_markets_db
node_sync -->|"gets spot board"| node_binance_lib
node_binance_lib -->|"fetches spot data"| node_binance
node_sync -->|"fetches metadata"| node_coingecko
node_sync -->|"upserts and prunes"| node_supa
node_supa -->|"writes"| node_markets_db
node_cron -->|"schedules sync"| node_sync
node_cron -->|"schedules scans"| node_scanner
node_scanner -->|"gets spot board"| node_binance_lib
node_scanner -->|"fetches candles"| node_binance
node_scanner -->|"computes metrics"| node_server_indicators
node_scanner -->|"writes results"| node_scan_db
node_user -->|"opens asset"| node_chart
node_chart -->|"requests candles"| node_binance_proxy
node_binance_proxy -->|"proxies requests"| node_binance
node_chart -.->|"loads fallback OHLC"| node_cgclient
node_chart -->|"computes chart indicators"| node_indicators
node_chart -->|"renders summary"| node_signals
node_chart -->|"looks up contract"| node_futmap
node_futures -->|"requests futures data"| node_binance_proxy
node_binance_proxy -->|"proxies futures data"| node_binance
node_futures -->|"subscribes liquidations"| node_bybit
node_futquotes -->|"fetches quotes"| node_binance_proxy
node_futmap -->|"fetches contracts"| node_binance_proxy
node_scanui -->|"reads scan results"| node_scan_db
node_user -->|"stars assets"| node_watchlist
node_watchlist -->|"reads and writes"| node_profiles_db
node_auth -->|"loads watchlist"| node_profiles_db

click node_auth "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/auth.js"
click node_app "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/main.js"
click node_screener "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/screener.js"
click node_watchlist "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/watchlist.js"
click node_scanui "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/scan.js"
click node_signals "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/signals.js"
click node_chart "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/chart.js"
click node_indicators "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/indicators.js"
click node_futures "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/futures.js"
click node_live "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/live.js"
click node_futquotes "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/futquotes.js"
click node_futmap "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/futmap.js"
click node_cgclient "https://github.com/supanan2548/atc-screener/blob/main/frontend/js/coingecko.js"
click node_api_cg "https://github.com/supanan2548/atc-screener/blob/main/api/coingecko.js"
click node_sync "https://github.com/supanan2548/atc-screener/blob/main/api/sync-markets.js"
click node_scanner "https://github.com/supanan2548/atc-screener/blob/main/api/scan.js"
click node_binance_proxy "https://github.com/supanan2548/atc-screener/blob/main/api/binance.js"
click node_binance_lib "https://github.com/supanan2548/atc-screener/blob/main/api/_lib/binance.js"
click node_server_indicators "https://github.com/supanan2548/atc-screener/blob/main/api/_lib/indicators.js"
click node_supa "https://github.com/supanan2548/atc-screener/blob/main/api/_lib/supa.js"
click node_markets_db "https://github.com/supanan2548/atc-screener/blob/main/supabase/migrations/20260925000000_markets_cache.sql"
click node_scan_db "https://github.com/supanan2548/atc-screener/blob/main/supabase/migrations/20260923000000_scan_results.sql"
click node_profiles_db "https://github.com/supanan2548/atc-screener/blob/main/supabase/migrations/20260922000000_profiles_watchlist.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_auth,node_app,node_user toneBlue
class node_live,node_futquotes,node_futmap,node_cgclient toneAmber
class node_screener,node_watchlist,node_scanui,node_signals,node_chart,node_indicators,node_futures,node_binance,node_coingecko toneMint
class node_api_cg,node_sync,node_scanner,node_binance_proxy,node_binance_lib,node_server_indicators,node_supa,node_markets_db,node_scan_db,node_profiles_db toneRose
class node_supabase_auth,node_cron,node_bybit toneIndigo
```

## Components

### Access and Interface

- [Login and session](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/auth.js): `frontend/js/auth.js`
- [App startup](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/main.js): `frontend/js/main.js`

### Market Data

- [Live market feed](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/live.js): `frontend/js/live.js`
- [Futures quotes](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/futquotes.js): `frontend/js/futquotes.js`
- [Contract mapping](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/futmap.js): `frontend/js/futmap.js`
- [CoinGecko client](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/coingecko.js): `frontend/js/coingecko.js`

### Analysis

- [Screener and scoring](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/screener.js): `frontend/js/screener.js`
- [Starred assets](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/watchlist.js): `frontend/js/watchlist.js`
- [Scan results UI](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/scan.js): `frontend/js/scan.js`
- [Summary signals](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/signals.js): `frontend/js/signals.js`
- [Charts and detail](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/chart.js): `frontend/js/chart.js`
- [Indicator calculations](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/indicators.js): `frontend/js/indicators.js`
- [Futures and risk](https://github.com/supanan2548/atc-screener/blob/main/frontend/js/futures.js): `frontend/js/futures.js`

### Backend and State

- [Markets API](https://github.com/supanan2548/atc-screener/blob/main/api/coingecko.js): `api/coingecko.js`
- [Market sync](https://github.com/supanan2548/atc-screener/blob/main/api/sync-markets.js): `api/sync-markets.js`
- [Scheduled scanner](https://github.com/supanan2548/atc-screener/blob/main/api/scan.js): `api/scan.js`
- [Binance futures proxy](https://github.com/supanan2548/atc-screener/blob/main/api/binance.js): `api/binance.js`
- [Spot board access](https://github.com/supanan2548/atc-screener/blob/main/api/_lib/binance.js): `api/_lib/binance.js`
- [Scan indicators](https://github.com/supanan2548/atc-screener/blob/main/api/_lib/indicators.js): `api/_lib/indicators.js`
- [PostgREST access](https://github.com/supanan2548/atc-screener/blob/main/api/_lib/supa.js): `api/_lib/supa.js`
- [Markets table](https://github.com/supanan2548/atc-screener/blob/main/supabase/migrations/20260925000000_markets_cache.sql): `supabase/migrations/20260925000000_markets_cache.sql`
- [Scan results table](https://github.com/supanan2548/atc-screener/blob/main/supabase/migrations/20260923000000_scan_results.sql): `supabase/migrations/20260923000000_scan_results.sql`
- [Profiles and watchlist](https://github.com/supanan2548/atc-screener/blob/main/supabase/migrations/20260922000000_profiles_watchlist.sql): `supabase/migrations/20260922000000_profiles_watchlist.sql`

### Other components

- **Dashboard user**
- **Binance APIs**
- **CoinGecko API**
- **Supabase Auth**
- **Supabase pg_cron**
- **Bybit liquidation feed**

## Connections

- Dashboard user → Login and session: signs in
- Login and session → Supabase Auth: authenticates
- Login and session → App startup: starts app
- App startup → Screener and scoring: loads markets
- App startup → Live market feed: connects feed
- App startup → Futures quotes: starts quotes
- App startup → Scan results UI: starts scan UI
- Screener and scoring → CoinGecko client: requests markets
- CoinGecko client → Markets API: fetches
- Markets API → PostgREST access: reads markets
- PostgREST access → Markets table: queries
- Market sync → Spot board access: gets spot board
- Spot board access → Binance APIs: fetches spot data
- Market sync → CoinGecko API: fetches metadata
- Market sync → PostgREST access: upserts and prunes
- PostgREST access → Markets table: writes
- Supabase pg_cron → Market sync: schedules sync
- Supabase pg_cron → Scheduled scanner: schedules scans
- Scheduled scanner → Spot board access: gets spot board
- Scheduled scanner → Binance APIs: fetches candles
- Scheduled scanner → Scan indicators: computes metrics
- Scheduled scanner → Scan results table: writes results
- Dashboard user → Charts and detail: opens asset
- Charts and detail → Binance futures proxy: requests candles
- Binance futures proxy → Binance APIs: proxies requests
- Charts and detail → CoinGecko client: loads fallback OHLC
- Charts and detail → Indicator calculations: computes chart indicators
- Charts and detail → Summary signals: renders summary
- Charts and detail → Contract mapping: looks up contract
- Futures and risk → Binance futures proxy: requests futures data
- Binance futures proxy → Binance APIs: proxies futures data
- Futures and risk → Bybit liquidation feed: subscribes liquidations
- Futures quotes → Binance futures proxy: fetches quotes
- Contract mapping → Binance futures proxy: fetches contracts
- Scan results UI → Scan results table: reads scan results
- Dashboard user → Starred assets: stars assets
- Starred assets → Profiles and watchlist: reads and writes
- Login and session → Profiles and watchlist: loads watchlist
