Built for Market Analytics · Python · Flask · Alpha Vantage · SVG charts
Alpha Vantage Dashboard
A small Flask dashboard on the Alpha Vantage API. It shows which markets are open and the top gainers, losers and most actively traded US tickers, and charts a stock's daily prices as candlesticks, closing price, daily high and low, and a two-symbol comparison, all drawn as SVG by a short script of its own with no chart library. Visitors can register and sign in. Answers are cached to fit the free key's 25 requests a day, and when Alpha Vantage gives nothing the page says so instead of inventing numbers.
Alpha Vantage → TTL Cache → Flask Views → SVG Charts

Role
Python Developer
Duration
Since March 2024
Tech Stack
The Problem
A free Alpha Vantage key allows 25 requests a day, so a dashboard on it must cache, must stay useful when the allowance runs out, and must never show invented numbers as if they were real.
The starting point was a Flask prototype of a stock-trading simulator that ran in part: it started a debug server when imported, printed its API key on every request, crashed the home page with a 500 error exactly when the daily allowance ran out, and filled in made-up gainers and losers and market statuses and showed them as real.
My Approach
- Client. One module that asks Alpha Vantage for the market status, the top movers and a symbol's daily prices, with a timeout, a cache (market status 10 minutes, movers and daily prices 1 hour), a short memory for rate-limit notices, and error handling for the three ways Alpha Vantage reports a problem. The key is read from the environment and kept out of logs, errors, pages and the database.
- Pages. A home page of market status and top movers, a charts page with a symbol box, colour pickers and a two-symbol comparison, and a small JSON API. When Alpha Vantage gives nothing the page says so and shows no numbers.
- Charts. Four SVG charts drawn by a short script of the project's own: rising candles are hollow and falling ones filled so they differ by more than colour, every chart has a text description and a tooltip per day, and nothing is loaded from another site.
- Accounts. Sign-up, log-in and a profile, with hashed passwords, CSRF protection and log-out by POST.
- Safety. A strict Content-Security-Policy, HttpOnly and SameSite session cookies, and a server that never runs in debug mode.
- Delivery. A package with a command line (run and init-db), a Dockerfile, locked dependencies and tests.
- Review. The import-time debug server, the printed key, the unvalidated forms (validate was called without parentheses, so it was always true), a logout by GET, a page that did not exist, unpinned scripts from CDNs, and a database and session files committed to git were all fixed or removed.
Results & Impact
Re-run on 2026-11-14 in a scratch copy: ruff check passes, 139 tests pass (a 140th, which reads the .env.example file, was not part of that run because that file was not copied), and uv audit finds no known vulnerabilities in 27 packages.
The real app was also run that day against a local stand-in for Alpha Vantage that serves generated tickers and seeded random-walk prices, so nothing on screen is market data. The home page listed the movers, the charts page drew the four charts for a symbol, the comparison put two symbols on one scale, the candle colours changed, and a fictional user signed up, signed in and saw a profile.
Recorded in the repository's work-done.md (2026-11): 140 tests with warnings as errors and 98% line and branch coverage.
Not verified: any live Alpha Vantage call (the response key names come from the first version's code, and the exact shape of a rate-limit or error answer is not in the documentation that was read); what the demo key returns; and the 25-requests-a-day limit, which is Alpha Vantage's stated allowance and was not measured.