Skip to content

deveshanim3/dailyMail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“° React News App

A fully functional news application built with React and React Router, powered by the NewsAPI. Users can view the latest news, filter by category, and search for specific topics.

πŸš€ Features

  • πŸ” Search for news using keywords
  • πŸ—ƒοΈ Browse news by category (e.g., technology, sports, etc.)
  • 🏠 Navigate between pages like Home, About, and News Feed
  • 🧭 Persistent Navbar for navigation
  • 🧾 Modular structure with reusable components (e.g., Card, Navbar)

πŸ“ Project Structure

.
β”œβ”€β”€ components
β”‚   β”œβ”€β”€ About.jsx
β”‚   β”œβ”€β”€ Card.jsx
β”‚   β”œβ”€β”€ Home.jsx
β”‚   └── Navbar.jsx
β”œβ”€β”€ App.jsx
β”œβ”€β”€ index.css
β”œβ”€β”€ index.js
└── README.md

🧩 Tech Stack

  • React (with Hooks)
  • React Router DOM
  • Fetch API
  • NewsAPI.org

πŸ”‘ API Key

This project uses NewsAPI.org to fetch news. You must include your API key in the fetch URLs.

In the code:

const response = await fetch(
  `https://newsapi.org/v2/everything?q=keyword&apiKey=YOUR_API_KEY`
);

Replace YOUR_API_KEY with your actual API key.

Note: You can get a free API key by signing up at https://newsapi.org

🧠 How Routing Works

React Router is used to navigate between the following pages:

  • / β†’ Displays fetched news using the Card component
  • /home β†’ Shows the Home page
  • /about β†’ Shows the About page

The Navbar component stays visible across all routes for seamless navigation.

πŸ› οΈ Running the App

1. Clone the repository

git clone https://github.com/your-username/react-news-app.git
cd react-news-app

2. Install dependencies

npm install

3. Start the development server

npm run dev

The app will be available at http://localhost:5173/ (or another port if you're using Vite).

πŸ™Œ Acknowledgements

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published