Next AI News – A replica of Hacker News using Next JS and AI generated content

Share your love

Next AI News is a full-stack replica of Hacker News (HN) that incorporates Next.js and AI-generated content. The project follows various design principles and utilizes a range of technologies for its implementation.

I would recommend you don’t just copy and paste the code, just look at the code and type by understanding it.

Demo

Pages

Home page

Forum Page

Details

  1. Technology Stack:
    • Uses Next.js 14 with App Router and RSC on the Node.js runtime.
    • All pages are server-rendered and dynamic, with no data caching.
    • Mutations are performed via Server Actions.
    • Streaming is utilized to maximize speed and concurrency.
  2. Package Management:
    • Utilizes pnpm for package management.
  3. Data Layer:
    • Employs Drizzle ORM and Zod as the data layer.
  4. Authentication:
    • Uses Auth.js’s Next-Auth for password authentication.
  5. UI Generation and Styling:
    • Initial UIs are generated with Tailwind, Shadcn UI, and Radix UI.
  6. Rust Compiler:
    • Developed and tested with the new Next.js –turbo Rust compiler.
  7. Search Highlights:
    • Implements react-highlight-words for search highlights.
  8. PPR (Partial-Page Rendering):
    • Uses PPR (experimental) to precompute the shells of pages, serving them statically from the edge for faster TTFB and optimized CSS/fonts.
  9. Deployment:
    • Deployed serverlessly on Vercel’s Edge Network.
    • Utilizes Cron Jobs for AI generation.
    • Serverless Functions (Node.js) for SSR.
    • KV (Upstash) for rate-limiting.
    • Postgres (Neon) for core storage and search with pg_trgm.

This project showcases a comprehensive and modern tech stack, emphasizing serverless deployment and AI integration for content generation. It leverages various tools and optimizations for enhanced performance and user experience.

Steps to install

# Clone this repo
git clone https://github.com/rauchg/next-ai-news.git

# Navigate to directory and install packages
cd [folder]
npm install

# Start the App
npm start

Live Demo & GitHub

If you found any mistakes or have any doubts please feel free to Contact Us

Hope you find this post helpful💖

Share your love