A Next.js web application that displays the latest news from any category using the NewsAPI service. Default category is set to technology.
- Display latest news articles from configurable categories
- Responsive grid layout
- Article cards with images, titles, and descriptions
- "Read More" links to original articles
- Dynamic page title and heading based on selected category
- Clone the repository
- Install dependencies:
npm install- Create a
.env.localfile in the root directory with the following variables:
NEXT_PUBLIC_NEWS_API_KEY=your_api_key_here
NEXT_PUBLIC_NEWS_API_URL=https://newsapi.org/v2/top-headlines
NEXT_PUBLIC_NEWS_CATEGORY=technology # Change this to any category you want
- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
- Next.js
- React
- Tailwind CSS
- NewsAPI
MIT
