This modern template is a complete Node.js express.js API template with all the bells and whistles you need to get started with your next Node.js express.js API project fast.
npx create-modern-node-app my-app
or
pnpx create-modern-node-app my-app
This template includes the following features:
-
express.js - Fast, unopinionated, minimalist web framework for Node.js
-
mongoose.js - Elegant MongoDB object modeling for Node.js
-
Typescript - A strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.
-
pnpm - Fast, disk space efficient package manager.
-
Docker - A set of platform as a service products that use OS-level virtualization to deliver software in packages called containers.
-
ESLint - A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript.
-
Prettier - An opinionated code formatter that enforces a consistent code style across your entire codebase.
Once you have downloaded or cloned the template, you need to install the dependencies. To do so, run the following command:
cd my-app
pnpm install
Note: If you don't have pnpm installed, you can install it by running the following command:
npm install -g pnpm
Once the dependencies are installed, you can start the development server by running the following command:
pnpm dev
This template includes the following commands:
Runs the server in the development mode on http://localhost:5000 by default.
Builds the app for production to the dist
folder.
Runs the server in the production mode.
Runs ESLint on the src
folder.
Runs ESLint on the src
folder and fixes the errors.
Runs Prettier on the src
folder and fixes the errors.
Runs Prettier on the src
folder and checks for errors.
Builds the app for development using Docker.
Builds the app for production using Docker.
Runs the server in development mode using Docker on Windows on http://localhost:5000 by default.
Runs the server in development mode using Docker on Linux on http://localhost:5000 by default.
Runs the server in production mode using Docker on http://localhost:5000 by default.
You can customize these commands in the package.json
file. You can edit the environment variables in the .env
file and the Dockerfiles.
This project is licensed under the MIT License - see the LICENSE file for details.