This README file serves as a guide to understand, set up, and utilize the Course Backend App created using Node.js, Express.js, and MongoDB.
The Course Backend App is a RESTful API built using Node.js, Express.js, and MongoDB. It provides functionalities to manage courses, including creating, reading, updating, and deleting course data.
- CRUD Operations: Easily perform Create, Read, Update, and Delete operations on course data.
- Authentication and Authorization: Secure endpoints using authentication and authorization mechanisms.
- Validation: Validate user inputs to ensure data integrity and security.
- Error Handling: Handle errors gracefully with informative error messages.
- Scalability: Built with scalability in mind to accommodate growing user bases and data volumes.
-
Clone the repository:
git clone https://github.com/BelalAboseada/NodeJs-Courses-Project.git
-
Navigate to the project directory:
cd NodeJs-Courses-Project
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root directory and add the following environment variables:PORT=3001
MONGODB_URI=<your_mongodb_connection_string>
JWT_SECRET=<your_jwt_secret_key>
- Start the server:
npm start
- The server will start running at the specified port.
The Course Backend App exposes the following API endpoints:
POST /api/auth/register
: Register a new user.POST /api/auth/login
: Authenticate a user and generate a JWT token.GET /api/courses
: Get all courses.GET /api/courses/:id
: Get a course by ID.POST /api/courses
: Create a new course.PUT /api/courses/:id
: Update a course by ID.DELETE /api/courses/:id
: Delete a course by ID.
For detailed information about each endpoint and its usage, refer to the API documentation.
Contributions are welcome! Feel free to fork the repository and submit pull requests to contribute to the project. Please follow the contribution guidelines.
This project is licensed under the MIT License.