Skip to content

alessandrofoglia07/create-modern-node-app

Repository files navigation


Modern Node.js express.js API template

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.


Table of contents


Installation

npx create-modern-node-app my-app

or

pnpx create-modern-node-app my-app

Features

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.



Next steps

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

Commands

This template includes the following commands:

Default commands

pnpm dev

Runs the server in the development mode on http://localhost:5000 by default.

pnpm build

Builds the app for production to the dist folder.

pnpm start

Runs the server in the production mode.

pnpm lint

Runs ESLint on the src folder.

pnpm lint:fix

Runs ESLint on the src folder and fixes the errors.

pnpm format

Runs Prettier on the src folder and fixes the errors.

pnpm format:check

Runs Prettier on the src folder and checks for errors.

Docker commands

pnpm docker-build:dev

Builds the app for development using Docker.

pnpm docker-build:prod

Builds the app for production using Docker.

pnpm docker-run:dev-win

Runs the server in development mode using Docker on Windows on http://localhost:5000 by default.

pnpm docker-run:dev-linux

Runs the server in development mode using Docker on Linux on http://localhost:5000 by default.

pnpm docker-run:prod

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.


License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with 💜 by Alexxino

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published