A news aggregator project built with the MERN stack (MongoDB, Express, React, Node.js).
It fetches news articles from multiple sources using the NewsAPI.org API.
Users can explore the latest news updates from various categories and sources.
The project provides a simple and user-friendly interface for easy reading.
- Node.js and npm installed on your machine
- A NewsAPI.org API key
- Navigate to the server directory and create a new file named
.env
. - Add your NewsAPI.org API key to the
.env
file in the following format:API_KEY=your_news_api_key
. - Start the backend--
- cd server
- npm install # install dependencies for server
- node index.js # or: npm run dev (if package.json has a dev script)
- This should start your server
- Start the frontend--
- cd client
- npm install # install dependencies for client
- npm run dev # this starts Vite dev server (default: http://localhost:5173)
- Access the app
- The frontend will run on: http://localhost:5173
- The backend will run on: http://localhost:5000 (or whichever port is set in server/index.js).
Once the project is set up and running, you can view news articles from various sources on the client side.