A backend template built with Express and Node.js to accelerate the development process.
- Node.js (>= 22.x)
- npm (>= 10.x)
- Clone the repository:
git clone <repository-url>
- Navigate to the project directory:
cd nodejs-backend-template - Install the dependencies:
npm install
To start the development server:
npm run start:devTo build the project:
npm run buildTo start the production server:
npm startTo run tests:
npm teststart:dev: Starts the development server with hot-reloading.build: Compiles TypeScript to JavaScript and replaces paths.start: Starts the production server.lint: Lints the code using ESLint.lint:fix: Fixes linting issues using ESLint.test: Runs tests using Jest.test:watch: Runs tests in watch mode.format: Formats the code using Prettier.check-format: Checks if the code is formatted using Prettier.clean: Removes the build directory.purge: Removes the node_modules directory and clears the npm cache.prepare: Installs Husky hooks.
# Build the Docker image
docker build -t nodejs-backend-template .
# Run the Docker image
docker run -d --name nodejs-backend-template-container -p 8080:8080 nodejs-backend-template
# Check the logs
docker logs nodejs-backend-template-container
# Stop and remove the container
docker stop nodejs-backend-template-container
docker rm nodejs-backend-template-containerThis project is licensed under the MIT License.