No description
Find a file
2025-12-30 09:56:18 -05:00
.claude updated to have portfolio stuff along with skeleton for whatsapp-web.js 2025-12-28 15:18:10 -05:00
.devcontainer feat: basic dev container configuration 2025-08-27 11:09:26 -04:00
.github Create dependabot.yml 2025-08-27 10:53:29 -04:00
docs feat: implement Firebase authentication for service workers 2025-09-13 15:36:50 +00:00
scripts fix: add HTMX library to templates to resolve runtime errors 2025-09-15 00:26:27 +00:00
services/whatsapp updated to have portfolio stuff along with skeleton for whatsapp-web.js 2025-12-28 15:18:10 -05:00
src/stock_agent weird cache issue 2025-12-30 09:56:18 -05:00
.dockerignore Improve Docker deployment and Polygon API resilience 2025-12-28 16:59:36 -05:00
.env Improve Docker deployment and Polygon API resilience 2025-12-28 16:59:36 -05:00
.env.example feat: implement Firebase authentication for service workers 2025-09-13 15:36:50 +00:00
.gitignore updated to have portfolio stuff along with skeleton for whatsapp-web.js 2025-12-28 15:18:10 -05:00
.python-version Added a whole bunch of things, we can interact with the polygon flat s3 system 2025-08-20 23:23:10 -04:00
AGENTS.md docs: update AGENTS.md with Firebase service worker sessions architecture 2025-09-16 01:00:56 +00:00
CLAUDE.md refactored web_app 2025-12-30 09:49:48 -05:00
deploy-unraid.sh updated to have portfolio stuff along with skeleton for whatsapp-web.js 2025-12-28 15:18:10 -05:00
docker-compose.yml more deployment stuff, cleaned up API timeout stuff 2025-12-28 18:31:37 -05:00
docker-entrypoint.sh Improve Docker deployment and Polygon API resilience 2025-12-28 16:59:36 -05:00
Dockerfile Improve Docker deployment and Polygon API resilience 2025-12-28 16:59:36 -05:00
LICENSE Initial commit 2025-08-20 23:22:27 -04:00
pyproject.toml fix: correct service architecture in documentation 2025-08-24 12:28:53 +00:00
README.md updated to have portfolio stuff along with skeleton for whatsapp-web.js 2025-12-28 15:18:10 -05:00
uv.lock Merge pull request #1 from 5herlocked/dependabot/uv/bcrypt-5.0.0 2025-10-17 17:59:44 -04:00

Stock Agent: Real-Time Market Notifications

The Problem We Solve

Stock markets move fast, and information is currency. Traditional tracking tools are either overwhelming or insufficient. Stock Agent bridges this gap by delivering precise, timely notifications about market movements directly to your devices.

How We Built It

Our approach combines robust Python backend infrastructure with real-time messaging technology. By leveraging Robyn's lightweight web framework, Firebase Cloud Messaging, and a modular JavaScript frontend, we've created a notification system that's both powerful and elegant.

The core philosophy is simple: transform complex market data into actionable, immediate insights. No noise, just signal.

Technical Architecture

The system is built on a carefully chosen technology stack. Python handles backend logic and data processing, providing a stable and flexible foundation. Robyn serves as our web framework, ensuring low-latency communication. Firebase Cloud Messaging acts as our real-time notification conductor, pushing updates across devices with minimal overhead.

Our frontend uses vanilla JavaScript and HTMX, creating an interactive experience without unnecessary complexity. The entire system is managed through UV, ensuring clean and reproducible Python environments.

Monorepo Structure

This project follows a monorepo architecture with multiple services:

stock-agent/
├── src/                    # Python backend (Robyn API, Firebase auth, stock data)
├── services/
│   └── whatsapp/          # Node.js WhatsApp integration service
└── ...

WhatsApp Integration

The WhatsApp integration service monitors specific WhatsApp groups for stock ticker mentions. When configured senders discuss stocks, the system automatically extracts tickers, fetches real-time data from Polygon API, and displays them on the dashboard as "WhatsApp Stock Signals."

This creates a seamless bridge between informal stock discussions and structured market data tracking.

See services/whatsapp/README.md for detailed setup instructions.

Setup and Installation

Setting up Stock Agent is straightforward. Follow these steps precisely:

  1. Clone the repository
git clone [repository-url]
cd stock-agent
  1. Initialize Python environment
pip install uv
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
  1. Configure Firebase
  • Create a Firebase project
  • Generate service account credentials
  • Save credentials as firebase_creds.json
  1. Set environment variables in .env
FIREBASE_CREDS_PATH=./firebase-credentials.json
FIREBASE_API_KEY=[your-key]
FIREBASE_PROJECT_ID=[your-project]
  1. Launch the application
uv run python -m stock_agent.main
  1. (Optional) Set up WhatsApp Integration
cd services/whatsapp
npm install
cp .env.example .env
# Edit .env with your configuration
npm start

See the WhatsApp Integration README for detailed instructions.

Notification Strategy

We track two primary market dynamics: gainers and losers. When a stock crosses predefined thresholds, a notification is immediately dispatched. This approach cuts through market noise, delivering only what matters.

Security Considerations

Security isn't an afterthought—it's fundamental. We implement:

  • Dynamic configuration fetching
  • Server-side VAPID key management
  • Secure token registration protocols

Contributing

This is an open system. If you see potential improvements, challenge our implementation. Fork the repository, implement your vision, and submit a pull request.

Disclaimer

Stock markets involve inherent risks. Stock Agent provides information, not financial advice.

License

MIT License. See LICENSE for details.