This is a RESTful API for managing users, built with Node.js, Express.js, and MongoDB. It provides endpoints to create, read, update, and delete users with proper authentication and error handling. The API is documented using Swagger for easy access and testing.
- Features
- Tech Stack
- Installation
- Environment Variables
- Running the API
- API Endpoints
- API Documentation
- Create, Read, Update, Delete (CRUD) users.
- Authentication using JWT tokens.
- API documentation with Swagger.
- Error handling and validation.
- Organized code structure with MVC pattern.
- Backend: Node.js, Express.js
- Database: MongoDB, Mongoose
- Documentation: Swagger
- Authentication: JWT (JSON Web Tokens)
-
Clone the repository:
git clone https://github.com/safeer239/user-reg-system.git
-
Navigate to project directory:
cd user-reg-system -
Install dependencies:
npm install
PORT , MONGO_URI, JWT_SECRET
npm start
Create user - POST /api/auth/createUser
View user - GET /api/auth/getUser
update user - PUT /api/auth/updateUser
delete user - DELETE /api/auth/deleteUser
Access Swagger API docs at: http://localhost:8080/api-docs