StockIt is a dynamic, AI-driven stock market dashboard that allows users to seamlessly analyze stock price history, compare multiple tickers, and fetch recent market news—all through a conversational AI interface.
Powered by FastAPI and Gemini 2.5 Flash, the application eliminates complex manual forms by understanding natural language user intents, extracting relevant financial data, and dynamically updating the UI with interactive charts and news feeds.
- AI-Powered Conversational Interface: Simply chat with the application (e.g., "Compare AAPL and MSFT over the last 6 months" or "What's the latest news on TSLA?"). The Gemini AI intelligently classifies your intent and extracts tickers and time ranges.
- Dynamic Dual-Mode Display: Automatically switches between interactive stock comparison charts and real-time news feeds based on your queries.
- Historical Price Charts: Compare the performance of up to two stocks at a time across various customizable timeframes (1 day, 1 month, Year-to-Date, Max, etc.).
- Real-Time News Integration: Fetch the latest news and developments for specific companies.
- Fast & Reactive Backend: Built with FastAPI for high-performance asynchronous data fetching.
The dynamic AI-driven conversational dashboard.
Interactive stock comparison charts.
- Backend: Python, FastAPI, HTTPX
- Frontend: Vanilla HTML/CSS/JavaScript
- AI/LLM: Google GenAI (
gemini-2.5-flash) for intent recognition - Data Provider: Massive API (Stock Prices & News)
- Python 3.9+
- Massive API Key for financial data
- Google Gemini API Key for the AI chat interface
git clone https://github.com/yourusername/StockIt.git
cd StockItpython -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`Install the required Python packages using the requirements.txt file.
pip install -r requirements.txtCreate a .env file in the root directory of the project and add your API keys:
GOOGLE_API_KEY="your_gemini_api_key_here"
MASSIVE_API_KEY="your_massive_api_key_here"Start the FastAPI application using Uvicorn:
uvicorn main:app --reloadThe application will start running at http://127.0.0.1:8000.
- Open your browser and navigate to
http://127.0.0.1:8000. - Use the chat input box at the bottom to interact with the dashboard.
- Try asking questions like:
- "Show me how NVDA is doing compared to AMD for the last 5 days."
- "What is the latest news for Apple?"
- "Compare MSFT and GOOG since 2020."
main.py: The core FastAPI application containing routes, API integrations, and the Gemini AI prompt logic.agent.py: Experimental agent configuration using Google ADK.static/: Contains the frontend assets (index.html,app.js,style.css).requirements.txt: Python package dependencies..env: Environment variables file (not tracked in Git).
This project is licensed under the MIT License. See the LICENSE file for details.