Minimalist boilerplate for ExpressJS with TypeScript.
- ExpressJS: Backend framework. Based on NodeJS.
- TypeScript: Programing language for static typing.
- TSX: It is modern esbuild based transpiler for TypeScript files.
- ES-Module: ESM module system to able to import and export files.
- Clone this repository.
git clone https://github.com/6gDav/ExpressTS_Boilerplate.git- Don't forget to rename
package.jsonfile if you renamed the whole file.
- Use this command to run the server in development mode:
npm run dev- Use this command to build the server:
npm run build- Use this command to run the server in production mode:
npm run start- Use this command to stop the server:
npm run stop- Use this command to restart the server:
npm run restart- Use this command to run TSX server and watch the changes:
npx tsx watch src/server.ts- Use this command to install the dependencies based on the
package.jsonfile:
npm install- Use this command to undate teh dependencies:
npm update-- cors: It is a middleware that allows you to enable Cross-Origin Resource Sharing (CORS) in your Express application.
npm install corsnpm install -D @types/cors-- dotenv: It is a zero-dependency module that loads environment variables from a .env file into process.env.
npm install dotenv-- morgan: It is a middleware that logs HTTP requests to the console.
npm install morgannpm install -D @types/morgan-- helmet: It is a middleware that secures your app by setting various HTTP headers.
npm install helmet-- zod: It is a runtime type checking library for TypeScript.
npm install zod-- http-errors: It is a module that provides a set of HTTP error classes.
npm install http-errorsnpm install -D @types/http-errors-- axios: Promise based HTTP client for the browser and node.js
npm install axios-- jsonwebtoken: An implementation of JSON Web Tokens. This was developed against draft-ietf-oauth-json-web-token-08. It makes use of node-jws
npm install jsonwebtokennpm install -D @types/jsonwebtoken-- argon2: It's possible to hash using either Argon2i, Argon2d or Argon2id (default), and verify if a password matches a hash.
npm install argon2