Skip to content

barath20/StockIt

Repository files navigation

StockIt

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.

Features

  • 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.

Screenshots

Home Screen The dynamic AI-driven conversational dashboard.

Compare Stocks Interactive stock comparison charts.

Tech Stack

  • 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)

Setup & Installation

Prerequisites

1. Clone the Repository

git clone https://github.com/yourusername/StockIt.git
cd StockIt

2. Create a Virtual Environment (Recommended)

python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`

3. Install Dependencies

Install the required Python packages using the requirements.txt file.

pip install -r requirements.txt

4. Configure Environment Variables

Create 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"

5. Run the Application

Start the FastAPI application using Uvicorn:

uvicorn main:app --reload

The application will start running at http://127.0.0.1:8000.

Usage

  1. Open your browser and navigate to http://127.0.0.1:8000.
  2. Use the chat input box at the bottom to interact with the dashboard.
  3. 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."

Project Structure

  • 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).

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

StockIt is a dynamic, AI-driven stock market dashboard

Topics

Resources

Stars

Watchers

Forks

Contributors