This is a news website built using the MERN stack (MongoDB, Express, React, Node.js). The website allows users to view news articles, search for articles by keyword, and create an account to save articles for later reading.
To install the project, follow these steps:
- Clone the repository:
git clone https://github.com/devanshkansagra/News-App.git
- Install the dependencies:
npm install
- Create a
config.env
file in the server directory with the following variables:ReplaceDATABASE=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<database>?retryWrites=true&w=majority PORT=5000 SECRETKEY=<secret-key>
<username>
,<password>
,<cluster>
,<database>
, and<secret-key>
with your own values. - Start the server:
nodemon app.js
- Start the client:
cd client && npm start
The server will start on port 5000, and the client will start on port 3000.
To use the website, follow these steps:
- Open the website in your browser:
http://localhost:3000
- Browse the news articles on the home page.
- Search for articles by keyword using the search bar.
- Create an account to save articles for later reading.
Contributions are welcome! To contribute to the project, follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b my-feature-branch
- Make your changes and commit them:
git commit -m "Add new feature"
- Push your changes to your fork:
git push origin my-feature-branch
- Create a pull request.