Skip to content

WhiteDG/nextjs-hackernews

Repository files navigation

Next.js HackerNews

This is a HackerNews clone built with Next.js and shadcn/ui.

index

Live Demo

Features

  • Next.js App Router
  • React Server Components (RSCs) and Suspense
  • Server Actions for mutations
  • Beautifully designed components from shadcn/ui
  • Styling with Tailwind CSS
  • Browse stories: Top, Newest, Best, Show, Ask, Jobs.
  • Search for stories.
  • User authentication: Create an account or log in using your Hacker News account to access personalized features.
  • Mark stories as favorite.
  • Upvote stories or comments.
  • Add comments.
  • View user profile: About, Submitted, Comments, Favorites, Upvoted(private).
  • Responsive design: Friendly to both mobile and desktop.
  • Automatic light/dark mode based on system settings.

Screenshots

Desktop

index-desktop

story-desktop

about-desktop

upvoted-desktop

comments-desktop

login-desktop

Mobile

index-mobile story-mobile

about-mobile upvoted-mobile

comments-mobile login-mobile

Running Locally

Requires Node.js 18.17 or later.

  1. Clone the project.
git clone https://github.com/WhiteDG/nextjs-hackernews.git

cd nextjs-hackernews
  1. Install dependencies.
pnpm install
  1. Copy .env.example to .env.local and update the variables.
cp .env.example .env.local
  1. Run the development server with hot reload.
pnpm dev
  1. Open http://localhost:3000 with your browser to see the result.

  2. Build for production

pnpm run build
  1. Serve in production mode
pnpm start

APIs

This project leverages the power of various APIs to provide an enriched user experience:

License

Licensed under the MIT license.