HackerNews 2.0 is a modern, responsive web application that provides an improved interface for browsing Hacker News stories. The app allows users to explore top, new, and best stories, view detailed comments, and check user profiles with a sleek dark/light mode switch.
- 🔥 View Top, New, and Best Hacker News stories.
- 💬 Expand story comments with nested replies.
- 👤 View user profiles and their submissions.
- 🌗 Dark/Light mode toggle.
- 🔄 Refresh stories with ease.
- 📱 Fully responsive design.
Follow these steps to set up the project locally:
# Clone the repository
git clone https://github.com/thecodealchemy/HackerNews2.0.git
# Navigate to the project directory
cd HackerNews2.0
# Install dependencies
npm install
# Start the development server
npm run dev
The app should now be running at http://localhost:5173
(default Vite dev server).
- React – Frontend framework.
- TypeScript – Strongly typed JavaScript.
- TailwindCSS – Utility-first styling.
- Firebase Hacker News API – Data source.
- Vite – Build tool for fast development.
HackerNews2.0/
├── public/ # Static assets
├── src/
│ ├── components/ # UI components
│ ├── pages/ # Page components
│ ├── hooks/ # Custom hooks
│ ├── styles/ # Tailwind styles
│ ├── types/ # TypeScript types
│ ├── utils/ # Helper functions
│ ├── App.tsx # Main app component
│ ├── main.tsx # React entry point
│ └── index.css # Global styles
├── .gitignore
├── package.json
├── README.md
└── vite.config.ts
- Select Story Type: Choose between top, new, and best stories from the navigation.
- View Comments: Click on a story to see its comments.
- Check User Profiles: Click on a username to view their details.
- Dark Mode Toggle: Use the header button to switch between dark/light mode.
This project uses the Hacker News API:
- Fetch stories:
https://hacker-news.firebaseio.com/v0/{storyType}stories.json
- Fetch individual story:
https://hacker-news.firebaseio.com/v0/item/{id}.json
- Fetch user data:
https://hacker-news.firebaseio.com/v0/user/{username}.json
Contributions are welcome! Feel free to open issues and submit pull requests.
- Fork the repository.
- Create a new branch (
feature/awesome-feature
). - Commit your changes.
- Push to your fork and submit a PR.
This project is licensed under the MIT License.
For any inquiries or suggestions, reach out at thecodealchemy.