# 📰 Newsweb - A Dynamic News Aggregator App
NewsHub is a responsive web application that delivers real-time news updates from multiple categories using the [News API](https://newsapi.org/). Built with React and React Router, the app provides a smooth and dynamic user experience with features like pagination and category-based browsing.
## 🚀 Features
- 🗂️ Browse top headlines by categories (Science, Business, Health, Technology, etc.)
- 🔄 Pagination for navigating between pages
- 📱 Mobile-responsive UI
- ⏱️ Real-time data fetched from News API
- ✨ Smooth routing between categories using React Router
## 🔧 Tech Stack
- **React**
- **React Router**
- **JavaScript (ES6+)**
- **CSS (Responsive Design)**
- **News API**
- **Bootstrap (Optional styling)**
## 📁 Folder Structure
NewsHub/ ├── public/ ├── src/ │ ├── components/ │ │ ├── Navbar2.js │ │ ├── News.js │ │ ├── NewsItem.js │ │ └── Spinner.js │ ├── App.js │ └── App.css ├── package.json └── README.md
## 🛠️ Getting Started
### Prerequisites
- Node.js and npm installed
- A [NewsAPI.org](https://newsapi.org/) API key
### Installation
1. Clone the repository:
```bash
git clone git@github.com:Mueez-lab/newsweb-classbass.git
cd NewsHub
- Install dependencies:
npm install
- Add your News API key:
Edit the URL in
News.js
and replace the existing API key:
const url = `https://newsapi.org/v2/top-headlines?...&apiKey=YOUR_API_KEY`;
- Start the development server:
npm start
- The free News API has request limits, so use responsibly.
- You can customize the number of articles per page using the
pageSize
parameter in the API URL.
Pull requests are welcome! If you find a bug or have an idea for an improvement, feel free to open an issue.
This project is open-source and free to use under the MIT License.