AI-assisted daily stock-newsletter service that personalizes coverage for each subscriber. The repository hosts two deployable apps:
app/— Python pipeline that fetches news, summarizes it with Google Gemini, assembles HTML newsletters, and sends them via Brevo.homepage/— Next.js marketing site where users subscribe, manage preferences, and browse recent summaries.
- Personalized briefings: Summaries focus on the tickers each subscriber selected in Baserow or on the site.
- Daily automation: Scheduled run pulls fresh news, generates AI summaries, refines copy, and emails subscribers by 8:00 AM local time.
- Beginner-friendly tone: Prompting keeps outputs concise, emoji-enhanced, and free from trading advice.
- Self-serve marketing site: Prospects can subscribe, explore recent newsletters, and unsubscribe without operator involvement.
- Subscriptions
- Users submit email + watchlist through the Next.js site (
/api/subscribe). - Records are stored in a Baserow table (
table 564618), with status tracking for opt-ins/outs.
- Users submit email + watchlist through the Next.js site (
- Daily pipeline (
app/)run_newsletter_pipeline.pyorchestrates news ingestion, summarization, refinement, newsletter generation, and email delivery.- Intermediate artifacts live both in MongoDB (
stockbrew_stuffdatabase) and underapp/data/for inspection.
- Delivery
- Newsletters render via Jinja templates, then send through Brevo (Sendinblue) transactional email API.
- Marketing site (
homepage/)- Presents the value proposition and features (animated hero, subscription form, OCR-assisted portfolio import, explore timeline, unsubscribe flow).
- Pulls published summaries from MongoDB to showcase real examples (
/api/summaries).
Subscriber ➜ Next.js API ➜ Baserow ➜ Python pipeline
▲ │ │
│ ▼ ▼
Explore UI MongoDB ↔ Gemini ↔ NewsAPI
│ │
└──────────── Brevo (Email) ◀─┘
| Path | Purpose |
|---|---|
app/ |
Python scripts, data caches, templates, and output newsletters |
homepage/ |
Next.js (App Router) marketing site with subscription and explore views |
Each sub-project has its own README with setup, configuration, and runtime instructions.
- Clone & install prerequisites
- Python 3.11+ with
pipfor the pipeline. - Node.js 18+ and npm for the Next.js frontend.
- Python 3.11+ with
- Configure secrets
- Copy
app/.env.example(create one) andhomepage/.env.local(create) with the environment variables listed in the sub-project READMEs.
- Copy
- Run components
- Follow
app/README.mdto execute the daily pipeline or individual scripts. - Follow
homepage/README.mdto launch the marketing site locally (npm run dev).
- Follow
- NewsAPI + Google News scraping for article discovery.
- Google Gemini (
gemini-2.5-flash-preview-05-20) for summarization and refinement. - MongoDB Atlas (
stockbrew_stuffdatabase) for storing news, summaries, and refined outputs. - Baserow for subscriber management.
- Brevo (Sendinblue) for transactional email delivery.
- The orchestration script
app/scripts/run_newsletter_pipeline.pyperforms idempotent checks: it only fetches/generates data missing for the current date. - Schedule the pipeline via cron, APScheduler, or a task runner to hit the desired daily send time.
- Outputs per subscriber appear in
app/output/for auditing.
- Read the sub-project READMEs.
- Create topic branches per change.
- Run linting/tests when available (
homepage:npm run lint). - Submit pull requests with clear descriptions; ensure secrets are never committed.
- Extend hot-stocks flow (collections exist in MongoDB but are not fully wired).
- Harden OCR-powered symbol extraction (currently mocked in
ImageUpload). - Add automated tests and CI for both pipeline and frontend.
- Document monitoring/alerting around pipeline runs.
Add your preferred open-source license here before publishing publicly.