A boilerplate for projects using Node.js, Express and TypeScript.
- Express, for serving API data and client files
- Google TypeScript Style, for consistent, readable code
- Husky, for pre-commit linting and build checks
- Issue Templates, to get you up and running in Open Source quickly
- Nodemon, for reloading the server upon any code change during development
- TypeScript, for type-safe server files
Run any of the following scripts using yarn
:
yarn <script>
Script | Description |
---|---|
build | Build the application, ready to be ran with start |
build:clean | Remove previous build files |
build:compile | Compile all TypeScript files to JavaScript |
dev | Enter "watch" mode, reloading the application if changes are made to the code |
lint | Check all files, reporting them to the console |
lint:clean | Remove linter output files |
lint:fix | Automatically fix all linting issues in files |
start | Start the application in production mode, requires build |
watch:js | Watch the build files, reloading if there are any changes |
watch:tsc | Watch the TypeScript code, recompiling if there are any changes |
Install it using npm.
npm install --global yarn
Do not push sensitive keys to GitHub. You should follow Next.js' Guide for environment variables.
This includes:
- .env.local: Use a
.env.local
file for any sensitive keys. These should not be pushed to GitHub. - .env: Use a
.env
file for any application configuration that can be safely committed to GitHub, such as aPORT
value.
Use this table to store and describe the environment variables used in your application so that others can maintain your application.
Key | Description | Required |
---|---|---|
PORT | The port that the application runs on. | No |