mirror of
https://github.com/kennethreitz/coinbin.org.git
synced 2026-07-22 05:09:31 +00:00
678722d4d4
Brings the long-dead service back to a bootable state. Addresses the modernization epic (#30) and its work items: - #31 scraper: replace the removed CoinMarketCap `views/all` HTML scrape with a JSON price API (CoinGecko by default, no key required). Keeps the get_coins() return shape and MWT cache; handles non-unique symbols by keeping the highest-market-cap entry. - #32 runtime: drop the removed `gaiohttp` gunicorn worker / `aiohttp<2.0`; Procfile now uses `gthread`. - #33 deps/runtime: migrate off unmaintained libs — flask-cache -> flask-caching, drop flask-common, graphene 1/2 -> graphene 3, raven -> sentry-sdk, Python 3.6 -> 3.11+. Replace flask-graphql (incompatible with graphene 3) with a direct schema.execute() view. Add a JSON provider so Flask 3 can serialize Decimal. Make DB/forecast imports lazy so the app boots without them; only force HTTPS outside DEBUG. - #34 ingestion: add ingest.py worker and committed schema.sql for the api_coin price-history table. - #35 forecasting: migrate fbprophet -> prophet behind a FORECASTS_ENABLED flag with lazy, optional imports. Dependency management moved to uv: pyproject.toml + uv.lock, replacing the 2017-era Pipfile/Pipfile.lock. README and app.json updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UMDxE5JVcuzpKyiHercWaa
16 lines
577 B
SQL
16 lines
577 B
SQL
-- Price-history table read by /history (server.py) and /forecast
|
|
-- (predictions.py), and written by the ingestion worker (ingest.py).
|
|
--
|
|
-- Historically this table was created out-of-band by a separate Heroku
|
|
-- process that is not in this repo; it is committed here so the schema is
|
|
-- explicit and reproducible.
|
|
|
|
CREATE TABLE IF NOT EXISTS api_coin (
|
|
id SERIAL PRIMARY KEY,
|
|
name TEXT NOT NULL,
|
|
value DOUBLE PRECISION NOT NULL,
|
|
date TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS api_coin_name_date_idx ON api_coin (name, date DESC);
|