NewsPlayz is a React + Vite news aggregator built as a project for CodeWithMSami.
It displays top headlines from NewsAPI with category navigation, infinite scrolling, and a top loading progress bar.
- React 19 + Vite
- Bootstrap 5 UI
- React Router v7 routing
- Infinite scroll news feed
- Top loading bar indicator
- NewsAPI integration via
.env
- Install dependencies:
npm install
- Create a
.envfile in the project root. - Add your NewsAPI key:
VITE_NEWS_API_KEY=your_api_key_here
- Start the development server:
npm run dev
- Open
http://localhost:5173 - Use the navigation links to switch between categories
- Scroll down to load more articles automatically
npm run buildnpm run preview- Make sure the API key is prefixed with
VITE_because Vite exposes environment variables throughimport.meta.env. - If the key is missing, the app displays a message prompting for the key.
This repository is maintained as a CodeWithMSami project and demonstrates a small news app built with modern React tooling.