---
# System prepended metadata

title: Building a User CRUD Server

---

**Task Description: Building a User CRUD Server**

**Objective:**
Create a Node.js server using Express, Sequelize, ESLint, ES6 syntax, and other specified technologies to provide User CRUD functionality. This server should include JWT-based authorization, Swagger documentation, Dockerization, and environment-specific configurations for dev, staging, and production.

**Requirements:**

1. **Express Server Setup:**
   - Create a Node.js server using Express.
   - Use Sequelize for database operations.
   - Implement ESLint for code quality.

2. **User CRUD Operations:**
   - Implement Create, Read, Update, and Delete (CRUD) operations for User entities.

3. **Swagger Documentation:**
   - Generate Swagger documentation for the API endpoints.
   - Ensure that the Swagger documentation is accessible and functional.

4. **Dockerization:**
   - Dockerize the application.
   - Create a Docker Compose file for launching the project in a development environment.

5. **Environment Configuration:**
   - Configure the server to run in dev, staging, or production modes.
   - Use a config library to manage environment-specific configurations.

6. **Authorization with JWT:**
   - Implement JWT-based authentication for API endpoints.
   - Include both access and refresh tokens.
   - Set the access token to expire after 15 minutes and the refresh token after 15 days.

7. **Testing:**
   - Create unit tests and integration tests for the CRUD operations.
   - Ensure comprehensive test coverage.

8. **Bitbucket Pipeline:**
   - Set up a Bitbucket pipeline configuration.
   - Configure the pipeline to run the unit and integration tests.

**Deliverables:**
1. A fully functional Node.js server with User CRUD operations.
2. Swagger documentation accessible at a designated endpoint.
3. Dockerized application with a Docker Compose file for development.
4. Environment-specific configuration for dev, staging, and production.
5. JWT-based authentication with token expiration.
6. Comprehensive unit and integration tests.
7. Bitbucket pipeline configuration for automated testing.

**Note:** Please adhere to the SOLID principles and best practices while implementing the server and its components. Ensure that the Swagger documentation works seamlessly with the hosted server.

**NOTE** Do whatever you can do, and assume whatever you think it is missed.