This is a Node.js application that provides user management functionalities including CRUD operations (Create, Read, Update, Delete), and email sending capabilities for welcome messages and password reset.
- User Management: Create, read, update, and delete user accounts.
- Email Sending: Send welcome emails upon user registration and password reset emails.
Before getting started, ensure you have the following installed:
- Node.js and Yarn
- MongoDB
-
Clone the repository:
git clone https://github.com/your-username/your-repo.git cd your-repo
-
Install dependencies:
yarn install
-
Create a
.env
file in the root directory and define the following environment variables:PORT=7777 MONGODB_URL=your-mongodb-url SENDGRID_API_KEY=your-sendgrid-api-key JWT_SECRET= SECRET
Start the server:
yarn start
The server will be accessible at http://localhost:7777
.
- POST /api/users: Create a new user. Requires a JSON body with user data.
- GET /api/users/:id: Get details of a specific user by ID.
- PUT /api/users/:id: Update details of an existing user. Requires a JSON body with updated user data.
- DELETE /api/users/:id: Delete an existing user by ID.
- POST /api/reset-password: Request password reset for a user. Requires a JSON body with the user's email.
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.