This project was created using themetalfleece/nodejs-typescript-template
- Edit
package.jsonto set the project name, version, description, and author. - Edit the
LICENSEfile to use your name in the Copyright section. - Edit the
.prettierrc.jsonfile with your preferred values. - Remove the
.github/workflows/upgrade-dependencies.ymlfiles, since it contains the workflow to upgrade all dependencies on a daily basis. - Delete this section from the
README.mdfile. - In case you don't use
npmas the package manager, updateDockerfileand.github/ci.ymlto use the commands of your package manager. - Start coding by editing the
src/app.tsfile!
- Install nvm (Node Version Manager) if you haven't already.
- Clone this repository, and using a terminal navigate to its directory.
- Install and use the Node.js version specified in
.nvmrc:nvm install nvm use
- Install dependencies using your preferred package manager:
- Install node.js.
- Clone this repository, and using a terminal navigate to its directory.
- Install dependencies:
- Using pnpm:
corepack enable pnpmandpnpm i - Using yarn:
corepack enable yarnandyarn - Using npm:
npm i
- Using pnpm:
- Copy the contents of the
.env.examplefile to a.envnext to it, and edit it with your values. - Build the files:
- Using pnpm:
pnpm build - Using yarn:
yarn build - Using npm:
npm run build
- Using pnpm:
- Start the application:
- Using pnpm:
pnpm start - Using yarn:
yarn start - Using npm:
npm start
- Using pnpm:
- You can run in development mode (combines build and start, with auto-reload):
- Using pnpm:
pnpm dev - Using yarn:
yarn dev - Using npm:
npm run dev
-
Build:
docker build -t my-app .Replacing
my-appwith the image name. -
Run
docker run -d -p 3000:3000 my-appReplacing
my-appwith the image name, and3000:3000with thehost:containerports to publish.
- Installing the Eslint (
dbaeumer.vscode-eslint) and Prettier - Code formatter (esbenp.prettier-vscode) extensions is recommended.
- Lint the code:
- Using pnpm:
pnpm lint - Using yarn:
yarn lint - Using npm:
npm run lint - Format the code:
- Using pnpm:
pnpm format - Using yarn:
yarn format - Using npm:
npm run format
Check the placeholder test examples to get started :
/src/app.tsthat provide a functionsum/test/app.spec.tswho test thesumfunction
This files are just an example, feel free to remove it
- Execute all tests:
- Using pnpm:
pnpm test - Using yarn:
yarn test - Using npm:
npm test - Run tests in watch mode:
- Using pnpm:
pnpm test:watch - Using yarn:
yarn test:watch - Using npm:
npm run test:watch - Generate test coverage report:
- Using pnpm:
pnpm test:coverage - Using yarn:
yarn test:coverage - Using npm:
npm run test:coverage