An open API service indexing awesome lists of open source software.

https://github.com/raphaelchpprt/signal-newsletter


https://github.com/raphaelchpprt/signal-newsletter

Last synced: 5 days ago
JSON representation

Awesome Lists containing this project

README

          

# signal-newsletter

> Automated personal tech digest — generated by Claude Sonnet with live web search, delivered every Friday morning via Resend.

Built on GitHub Actions + Anthropic API + Resend. Zero infrastructure, ~$0.50–1.00 per run.

---

## How it works

Every Friday at 07:00 CET, a GitHub Actions workflow:

1. Calls Claude Sonnet with the `web_search` tool to research the past 7 days
2. Generates a structured JSON newsletter with 5 curated items
3. Verifies image URLs via HEAD requests before rendering
4. Builds a dark-mode HTML email with per-category accent colors
5. Ships it via Resend
6. Commits `history.json` to the repo — used next week to avoid repeating topics

On the **first Friday of each month**, a monthly digest is also generated — Claude synthesizes the last 4 editions into 3 macro trends, no web search, pure analysis.

If anything fails, an alert email is sent immediately with a direct link to the failed run.

---

## 5 items per edition

| # | Theme | Scope |
|---|---|---|
| 1 | **Front-end** | JS/TS, React, UI libs (shadcn, radix...), Remix, Next, tooling |
| 2 | **IA pour devs** | Models, Claude Code, Cursor, Copilot, AI workflows |
| 3 | **Web perf & archi** | Performance, runtimes, architecture patterns, deployment |
| 4 | **Éthique & géopolitique tech** | AI regulation, digital sovereignty, CSRD/ESG, greentech |
| 5 | **Opinion/Vision** | Opinionated articles challenging tech/UX/UI consensus — builds critical tech vision |

Each item includes: summary with intentional bold + highlight markup, verified source links with dates, a "Signal" takeaway block, and a deep-link to Claude pre-loaded with context.

---

## Stack

| Layer | Choice |
|---|---|
| Runtime | Node.js 20 (ESM) |
| LLM | `claude-sonnet-4-6` via `@anthropic-ai/sdk` |
| Web search | Anthropic `web_search_20250305` tool |
| Email | Resend API |
| Scheduler | GitHub Actions cron |
| History | `history.json` committed to repo (last 4 editions) |

---

## Scripts

| File | Role |
|---|---|
| `src/generate.js` | Weekly newsletter — Claude + web search → HTML email |
| `src/digest.js` | Monthly digest — synthesizes history into 3 trends |
| `src/alert.js` | Failure alert — sends email with link to failed run |

---

## Setup

### 1. Clone and push

```bash
git clone && cd signal-newsletter
gh repo create signal-newsletter --private --push --source=.
```

### 2. Set repository secrets

`Settings → Secrets and variables → Actions → New repository secret`

| Secret | Value |
|---|---|
| `ANTHROPIC_API_KEY` | API key from [console.anthropic.com](https://console.anthropic.com/settings/keys) |
| `RESEND_API_KEY` | API key from [resend.com](https://resend.com) |
| `RECIPIENT_EMAIL` | Your email address |

### 3. Verify your domain on Resend

Add the DNS records Resend provides to your domain registrar, then wait for verification (~5–30 min).

### 4. Trigger manually to verify

```bash
gh workflow run newsletter.yml --repo /signal-newsletter
gh run list --repo /signal-newsletter
```

Check your inbox. Done.

---

## Local development

```bash
npm install

# Generate preview.html with mock data (zero API cost)
node src/generate.js --dry-run && open preview.html

# Send preview.html via Resend (zero API cost, tests email delivery)
RESEND_API_KEY=re_... RECIPIENT_EMAIL=you@example.com node src/generate.js --send-preview

# Full run
ANTHROPIC_API_KEY=sk-... RESEND_API_KEY=re_... RECIPIENT_EMAIL=you@example.com node src/generate.js
```

---

## Customization

All personalization lives in `SYSTEM_PROMPT` inside `src/generate.js`:

- **Profile** — edit the dev context at the top
- **Themes** — the 5-item structure is explicit and ordered
- **Sources** — curated allowlist of trusted domains, no AI-generated content
- **Markup rules** — strict bold/highlight constraints keep formatting intentional

The `history.json` file is auto-managed. Don't edit it manually.

---

## Cost

~$0.50–1.00 per weekly edition with `claude-sonnet-4-6` + web search.
Resend free tier covers 3,000 emails/month.