Inspiration
As students who are passionate about financial literacy and interested in working in the fintech space, we knew we wanted to create an app to cut through the noise of financial social media and news. Instead of manually scrolling Reddit threads and Yahoo Finance articles to gauge market sentiment, we envisioned an automated tool that uses NLP to instantly analyze how people feel about any stock — saving users time and guesswork.
What it does
Stocker takes a stock ticker and scrapes real-time discussions from Reddit and Yahoo Finance. It runs the text through FinBERT, a financial NLP model, to classify sentiment as positive, negative, or neutral. It then feeds results to Google Gemini to generate an AI-powered investment recommendation, all displayed in a live dashboard.
How we built it
The backend uses Python/FastAPI with Docker Compose, running Reddit and Yahoo scrapers, FinBERT for sentiment analysis, and Gemini 2.0 Flash for AI advice. Taskiq with Redis handles async jobs, streaming live progress via Server-Sent Events. The frontend is React/TypeScript with Vite, Tailwind CSS, shadcn/ui, and Recharts for stock charts.
Challenges we ran into
Reddit's public endpoints throttle aggressively, requiring careful rate limiting. FinBERT's large model was slow to load, so we implemented lazy caching. Wiring real-time SSE streaming through Redis Pub/Sub across Docker containers was complex, and debugging inter-container networking and environment variable passing took significant troubleshooting effort.
The biggest technical hurdle was managing the massive memory footprint of the FinBERT model. We initially wanted to host everything on a cloud provider like Render, but hosting a heavy PyTorch transformer on free-tier web services consistently caused "Out of Memory" crashes.
We had to fundamentally rethink our architecture mid-hackathon. We pivoted to a strict "Producer-Consumer" model, physically splitting the codebase into a lightweight API container and a heavy Worker container. By keeping the heavy ML worker local via Docker, connected through a Redis broker, we successfully bypassed expensive cloud GPU costs while maintaining a cloud-ready microservices architecture. Additionally, dealing with asynchronous state, ensuring the frontend could gracefully stream real-time logs while the background worker was busy scraping dynamic content, required deep dives into Redis Pub/Sub and SSE protocols.
Accomplishments that we're proud of
We are incredibly proud of achieving a production-grade, distributed microservices workflow in a hackathon setting. Successfully decoupling the web scraper and ML model from the web server means our API never "hangs." We are also proud of our real-time streaming implementation—users don't just stare at a loading spinner; they receive live JSON-streamed updates ("Scraped 15 Reddit posts...", "Running FinBERT batch 3 of 5...") straight to the UI. And, we built a full end-to-end pipeline — from raw web scraping to actionable investment insight — in under a minute per query. The real-time streaming UI lets users watch analysis happen live. Using FinBERT gives domain-accurate financial sentiment, and layering Gemini on top bridges data and human-readable advice.
What we learned
This project was a deep dive into DevOps and System Design. We learned how to orchestrate a multi-container environment using Docker Compose, the nuances of asynchronous task management with Redis queues, how Pub/Sub powers real-time frontend streaming, and how to elegantly handle the limitations of free cloud tiers through modular architecture.
We gained hands-on experience with microservices architecture using Docker Compose, HuggingFace Transformers with PyTorch inference, and web scraping at scale with rate-limit handling. We also learned to implement real-time data streaming with SSE and Redis Pub/Sub, and how to integrate the Gemini API for generative AI capabilities.
What's next for Stocker
We plan to add more data sources like Twitter/X and SEC filings, implement historical sentiment tracking to correlate with price movements, and build portfolio mode for multi-ticker analysis. User accounts with watchlists, smarter Redis caching, and enriched Gemini prompts with earnings and sector data are also on the roadmap.
Built With
- beautiful-soup
- docker
- fastapi
- finbert
- gemini
- huggingface
- python
- react
- redis
- tailwindcss
- taskiq
- typescript
- vite
Log in or sign up for Devpost to join the conversation.