/News-app-react

This repository contains a React-based news application that fetches and displays the latest news articles using the News API. The app features a clean, responsive design and allows users to explore news across various categories.

Primary LanguageJavaScript

News App - React

Welcome to the News App! This application allows you to stay updated with the latest news articles across various categories. The app is built with React and fetches news data using the News API.

Table of Contents

Features

  • Browse news articles from various categories.
  • Real-time data fetching from the News API.
  • Responsive design for a seamless experience on mobile and desktop devices.
  • Easy to navigate and user-friendly interface.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Node.js (version 14.x or later)
  • npm (Node Package Manager) or yarn

Installation

1. Clone the Repository

Clone the repository to your local machine using the following command:

git clone https://github.com/thegeek36/News-app-react.git

Navigate to the project directory:

cd News-app-react

2. Install Dependencies

Install the necessary dependencies using npm or yarn:

npm install

or

yarn install

Usage

To start the application, run the following command:

npm start

or

yarn start

This will start the development server, and you can view the application in your browser at http://localhost:3000.

Configuration

The app uses the News API to fetch news articles. To ensure the app works properly, you need to provide your own API key. Follow these steps to update the API key:

  1. Open the Stories.js file located in the src directory of the project.

  2. Find the variable where the API key is stored. It should look something like this:

    const API_KEY = 'your_api_key_here';
  3. Replace the placeholder with your actual API key from News API:

    const API_KEY = 'your_actual_api_key';
  4. Save the file after making the change.

    Note: If the application is running, you need to restart it for the changes to take effect.

Contributing

Contributions are always welcome! Here’s how you can help:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add new feature').
  5. Push to the branch (git push origin feature/YourFeature).
  6. Open a Pull Request.

Please make sure your code adheres to the project's coding guidelines.

Thank you for using the News App! If you have any questions or feedback, feel free to reach out. Enjoy exploring the latest news!