Files
newsletter-hackernews/README.md

1.6 KiB

📰 HackerNews Newsletter

A Next.js application that aggregates HackerNews stories and delivers them as personalized daily newsletters.

Features

  • 📧 Daily newsletter containing curated HackerNews stories
  • ☁️ Vercel hosting integration

🚀 Future improvements

  • Cron every 10 minutes and reduce time delta to 10 minutes: people are more likely to open the newsletter if delivered around the time when they subscribed (if cron becomes not enough, then the cost of sending all the emails might be a bigger issue)

🛠️ Tech Stack

  • Next.js
  • 🗄️ Prisma (Database ORM)
  • 🚀 Vercel (Hosting)
  • 📝 Custom email templates

🏁 Getting Started

📋 Prerequisites

  • 📦 Node.js
  • 🐳 Docker
  • 🔧 Vercel CLI
  • 🧶 Yarn package manager

💻 Installation

  1. Clone the repository:
git clone [repository-url]
cd hackernews-newsletter
  1. Install dependencies:
yarn install
  1. Set up Vercel:
# Install Vercel CLI
yarn add -g vercel@latest

# Link to your Vercel project
yarn vercel:link

# Pull environment variables
yarn vercel:env
  1. Set up the database:
# Push Prisma schema to database
yarn db:push

# Generate Prisma client
yarn prisma:generate

🔧 Development

Run locally with Docker:

docker-compose up --build

🗄️ Database Management

Reset database (⚠️ caution: this will delete all data):

yarn db:reset

🙏 Acknowledgments