• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
paulkinlan

paulkinlan

postherous

https://posthero.us - an email powered blogging system
Public
Like
6
postherous
Home
Code
10
backend
3
frontend
1
shared
2
ACTIVITYPUB.md
README.md
SETUP.md
E
email.ts
H
test-activitypub-inbox.ts
H
test-activitypub.ts
H
test-publish.ts
Branches
1
Pull requests
Remixes
4
History
Environment variables
9
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
7/11/2025
Viewing readonly version of main branch: v116
View latest version
README.md

Email Blog Platform

A modern blog platform inspired by Posterous that allows publishing posts via email.

πŸš€ Status: READY TO USE

Your email blog platform is fully functional! Send an email to start publishing.

✨ Features

  • πŸ“§ Email-to-Publish: Send an email to publish posts instantly
  • πŸ”’ Email Security: Allowlist and verification system to prevent unauthorized posts
  • 🎨 Multi-format Support: HTML and plain text posts
  • πŸ“‘ RSS Feed: Full RSS 2.0 support for syndication
  • 🌐 WebSub: Real-time feed updates via WebSub protocol (configured)
  • 🐘 ActivityPub: Full federated social networking with followers, likes, and shares βœ…
  • πŸ¦‹ AT Protocol: Bluesky integration for cross-platform syndication (configured)
  • πŸ”— SEO Friendly: Clean URLs with slugified titles
  • πŸ“± Responsive Design: Mobile-first responsive interface with TailwindCSS
  • ⚑ Fast: Built on Val Town with SQLite storage and static HTML generation
  • πŸš€ No JavaScript: Pure HTML/CSS frontend for maximum performance

πŸ—οΈ Architecture

Backend (/backend/)

  • index.ts - Main Hono server with HTML generation and API routes βœ…
  • database/ - SQLite schema and query functions βœ…
  • services/ - External service integrations βœ…

Email Handler (/email.ts)

  • Email trigger handler with security verification βœ…
  • Allowlist checking and draft post creation βœ…
  • Automated verification email sending βœ…

Static HTML Generation

  • Server-side HTML rendering with TailwindCSS βœ…
  • No client-side JavaScript dependencies βœ…
  • Fast loading and SEO optimized βœ…

🎯 Quick Start

  1. Configure Security: Set ALLOWED_EMAIL_ADDRESSES environment variable (see Security section)
  2. Send Email: Send email from an allowed address to your Val Town email address
  3. Verify Email: Click the verification link sent to your email
  4. View Blog: Visit your backend HTTP val URL after verification
  5. RSS Feed: Access /rss for syndication
  6. Individual Posts: Visit /post/[slug]

πŸ”§ Configuration

See SETUP.md for detailed setup instructions and ACTIVITYPUB.md for ActivityPub federation details.

Environment Variables (Optional)

  • WEBSUB_HUB_URL - WebSub hub URL
  • ACTIVITYPUB_DOMAIN - Domain for ActivityPub federation
  • ATPROTO_HANDLE - AT Protocol handle
  • ATPROTO_PASSWORD - AT Protocol app password

πŸ“Š API Endpoints

  • GET / - Main blog interface
  • GET /post/:slug - Individual post page
  • GET /rss - RSS 2.0 feed
  • GET /api/posts - JSON API for posts
  • GET /api/posts/:slug - JSON API for single post
  • GET /websub - WebSub subscription endpoint
  • GET /.well-known/webfinger - WebFinger discovery for ActivityPub βœ…
  • GET /actor - ActivityPub actor document βœ…
  • GET /outbox - ActivityPub outbox (published activities) βœ…
  • GET /followers - ActivityPub followers collection βœ…
  • GET /following - ActivityPub following collection βœ…
  • POST /inbox - ActivityPub inbox (processes Follow, Like, Announce, Undo) βœ…
  • GET /api/posts/:slug/activities - Get activity counts (likes, shares, replies) βœ…
  • GET /health - Health check

πŸ§ͺ Testing

Use /test-publish.ts to create sample posts for testing.

πŸ“ Usage Example

Send an email like this:

To: your-email-val@val.town
Subject: My Amazing Blog Post
Body: <h2>Hello World!</h2><p>This post was published via email!</p>

The post will appear instantly on your blog with:

  • Title: "My Amazing Blog Post"
  • Slug: "my-amazing-blog-post"
  • Content: Rendered HTML
  • Author: Extracted from email address

🎨 Customization

  • Edit HTML generation functions in /backend/index.ts
  • Modify CSS styles in the getCustomCSS() function
  • Update branding in HTML templates
  • Configure federation services via environment variables

πŸ”„ Syndication

Posts are automatically syndicated to:

  • RSS feed (always enabled)
  • WebSub subscribers (if configured)
  • ActivityPub followers (with full interaction support) βœ…
  • AT Protocol/Bluesky (if configured)

ActivityPub Federation

Your blog is now fully federated with ActivityPub! Users can:

  • Follow your blog from Mastodon, Pleroma, and other ActivityPub platforms
  • Like your blog posts (shows ❀️ count on posts)
  • Share/Boost your posts (shows πŸ”„ count on posts)
  • Reply to your posts (shows πŸ’¬ count on posts)

Discovery formats:

  • WebFinger: @blog@your-domain.com
  • Direct actor URL: https://your-domain.com/actor

Real-time interaction tracking:

  • All likes, shares, and replies are stored and displayed on individual post pages
  • Follower count is maintained and accurate
  • Full ActivityPub inbox processing for Follow/Unfollow activities

Example: If your blog is at myblog.web.val.run, users can follow @blog@myblog.web.val.run from their Mastodon client and interact with your posts!


Ready to blog via email? Send your first post now! πŸ“§βœ¨

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.