This is the backend repository for the News Application built using the MERN stack (MongoDB, Express, React, and Node.js).
- Introduction
- Features
- Technologies
- Getting Started
- Installation
- Configuration
- Usage
- API Endpoints
- Contributing
- License
- Contact
The News Application is a web-based platform that allows users to read and browse the latest news articles across different categories. This repository contains the backend code responsible for handling user authentication, news data management, and serving API endpoints to the frontend application.
- User authentication (register, login, JWT-based authentication)
- CRUD operations for news articles
- Categorization of news articles
- Secure password storage using bcrypt
- API endpoints to interact with the frontend application
The backend is built using the following technologies:
- Node.js
- Express.js
- MongoDB (with Mongoose ODM)
- JWT for authentication
- bcrypt for password hashing
To run the backend server locally, follow the steps below:
- Clone the repository to your local machine:
git clone https://github.com/your-username/news-backend.git
cd news-backend
npm install
Before running the application, you need to configure the database connection. Create a .env file in the root directory and add the following environment variables:
dbUrl=??????
JWTSECRETKEY=???????
PORT=3000
Start the development server:
npm run dev
The backend server will be running at http://localhost:3000.
/api/users: User authentication and management endpoints. /api/news: Endpoints for managing news articles. /api/categories: Endpoints for managing news categories.
Contributions are welcome! If you find any issues or want to add new features, please open an issue or submit a pull request.
This project is licensed under the MIT License.
For any questions or inquiries, feel free to contact: Tony Kalalian - tkalalian@gmail.com