This is a Flask-based web application that allows users to search for stock information using the Tiingo API. It supports live data retrieval, search history tracking, and result caching for improved performance.
- Search by stock ticker symbol
- Company Outlook tab (name, exchange, start date, description)
- Stock Summary tab (prices, volume, changes with visual arrows)
- Search History tab (last 10 searches saved to SQLite)
- 15-minute result caching to reduce API calls
- Input validation and inline error messages
- Fully deployed on AWS EC2 (Ubuntu 22.04)
Make sure the EC2 instance is running and the app is live.
project/
├── app.py # Main Flask app
├── init_db.py # (Optional) One-time DB table creator
├── search_history.db # SQLite database (auto-created)
├── templates/
│ └── index.html # Main HTML page with JS and tabs
├── static/
│ └── images/
│ ├── GreenArrowUP.png
│ └── RedArrowDown.png
└── flask_stock_search.zip # Deployment bundle (optional)
- SSH into your EC2 instance
- Navigate to your project directory
- Activate the virtual environment
- Run the Flask app
cd ~/Stock_Search
source ~/venv/bin/activate
python3 app.py
Make sure the last line of your app.py is:
app.run(host="0.0.0.0", port=8000)
The Flask app will be available at:
http://:8000
Tiingo API: https://api.tiingo.com/
Ray Zhang
San José State University — CS174 Spring 2025
Deployed using Flask + EC2 + SQLite