Skip to content

6gDav/ExpressTS_Boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExpressTS Boilerplate

Minimalist boilerplate for ExpressJS with TypeScript.

🚀 What inside?

  • 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.

🛠️ How to use?

📦 Installation

  • Clone this repository.
git clone https://github.com/6gDav/ExpressTS_Boilerplate.git
  • Don't forget to rename package.json file if you renamed the whole file.

📈 Development

  • 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.json file:
npm install
  • Use this command to undate teh dependencies:
npm update

Basic packeges to download:

-- cors: It is a middleware that allows you to enable Cross-Origin Resource Sharing (CORS) in your Express application.

npm install cors
npm 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 morgan
npm 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-errors
npm 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 jsonwebtoken
npm 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

About

Minimalist boilerplate for ExpressJS with TypeScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors