This project displays the top 10 Hacker News stories, sorted by score in ascending order. It's built using Next.js 14 with TypeScript.
First, clone the repository and install the dependencies:
git clone https://github.com/yourusername/hacker-news-stories.git
cd hacker-news-stories
npm install
Then, run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
- Fetches and displays top 10 Hacker News stories
- Sorts stories by score in ascending order
- Responsive design
- Uses SASS for styling
- Implements accessibility considerations
- Optimized for SEO
- Includes loading experience
- Next.js 14
- TypeScript
- SASS
- date-fns for date formatting
All code in src/app/page.tsx
, src/app/page.module.scss
, and src/styles/globals.scss
is original. The project structure and configuration files were generated using create-next-app
.
To run the tests:
npm test
This project aims to achieve good web performance metrics. To check the performance, you can use tools like Lighthouse in Chrome DevTools.
The project follows WCAG 2.1 guidelines for accessibility. Key considerations include:
- Semantic HTML structure
- Proper use of ARIA attributes where necessary
- Keyboard navigation support
- Color contrast ratios
SEO optimizations include:
- Use of metadata in
layout.tsx
- Semantic HTML structure
- Responsive design for mobile-friendliness
This project is open source and available under the MIT License.