NewsViews is a React application designed to provide users with the latest news headlines. The app utilizes the NewsAPI to fetch top headlines based on the selected country and category. It also supports searching for news articles based on a user-entered query. The application includes features such as infinite scrolling for seamless news browsing, progress tracking, and a clean, responsive design.
- React
- NewsAPI
- Infinite Scroll
- Bootstrap (for styling)
- Vite
- Top Headlines: Fetches top headlines based on the selected country and category.
- Search Functionality: Allows users to search for news articles based on a query.
- Dynamic Loading: Utilizes infinite scrolling for a seamless browsing experience.
- Loading Indicator: Displays a loading spinner while fetching news data.
- Progress Bar: Tracks and displays the progress of fetching news data.
- Grid Layout: Presents news articles in a responsive grid layout for various screen sizes.
Follow these instructions to set up the project on your local machine.
Make sure you have Node.js and npm installed on your machine.
-
Clone the repository:
git clone https://github.com/ianirudhkhabya/newsviews-react.git
-
Navigate to the project directory:
cd newsviews-react
-
Install dependencies:
npm install
-
Get your API key from NewsAPI.
-
Create a
.env.local
file in the project root. -
Add the following line to the
.env.local
file, replacingyour-api-key
with your actual API key:VITE_NEWSAPI=your-api-key
Run the application locally:
npm run dev
The application will be accessible at http://localhost:5173.
- Browse top headlines based on the selected country and category.
- Use the search bar to find news articles based on a specific query.
- Experience infinite scrolling for continuous news exploration.
- Track the progress of news fetching through the progress bar.
Contributions are welcome! Feel free to open issues or submit pull requests to enhance the application. Your feedback and contributions are highly appreciated.