Template for NodeJS APIs with TypeScript, with configurations for linting and testing
This repository has been archived on 2026-03-21. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • TypeScript 92.2%
  • Dockerfile 7.8%
Find a file
Riccardo Senica 98f9d9f1ac
Potential fix for code scanning alert no. 6: Workflow does not contain permissions (#14)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-05-30 16:51:38 +02:00
.github Potential fix for code scanning alert no. 6: Workflow does not contain permissions (#14) 2025-05-30 16:51:38 +02:00
.husky build: bump express to 4.21.0 2024-09-12 12:41:55 +02:00
prisma fix: correction to Docker files 2023-08-30 20:53:42 +02:00
src chore: update express 2025-05-30 16:44:43 +02:00
.dockerignore fix: correction to Docker files 2023-08-30 20:53:42 +02:00
.env.example fix: transmit cookies securely 2024-07-20 18:21:17 +02:00
.eslintrc.json feat: basic code and configurations 2023-07-18 21:48:58 +02:00
.gitignore Prisma (#2) 2023-08-05 17:23:34 +02:00
.nvmrc chore: updated version of almost everything 2024-07-20 18:11:30 +02:00
.prettierrc feat: basic code and configurations 2023-07-18 21:48:58 +02:00
.yarnrc.yml refactor: removed unnecessary parser 2024-04-22 16:10:29 +02:00
commitlint.config.ts feat: basic code and configurations 2023-07-18 21:48:58 +02:00
docker-compose.yml chore: updated version of almost everything 2024-07-20 18:11:30 +02:00
Dockerfile chore: updated version of almost everything 2024-07-20 18:11:30 +02:00
jest.config.ts Prisma (#2) 2023-08-05 17:23:34 +02:00
LICENSE Initial commit 2023-07-18 21:38:48 +02:00
package.json chore: update express 2025-05-30 16:44:43 +02:00
README.md docs: updated readme 2023-12-08 21:17:26 +01:00
tsconfig.json feat: basic code and configurations 2023-07-18 21:48:58 +02:00
yarn.lock chore: update express 2025-05-30 16:44:43 +02:00

This is a template for a Node project with TypeScript

It contains basic configurations for the following:

  • TypeScript (typechecking and building)
  • Eslint (linting)
  • Prettier (formatting)
  • Jest/Supertest (testing)
  • Husky (pre-commit hooks to run linting, typechecking, and commit message format)
  • Winston (logging)
  • GitHub Actions (CI/CD)

To do

Add Swagger?

Environment Variables

Need to export the following environment variables:

  • PORT - The port to run the server on (defaults to 3000)
  • DATABASE_URL - The URL to the database, formatted as postgres://<username>:<password>@<host>:<port>/<database>

Commands

Install dependencies:

yarn

Generate Prisma client:

yarn db:generate

Run the migrations:

yarn db:migrate

Reset the database:

yarn db:reset

Audit:

yarn audit

Lint:

yarn lint

Typecheck:

yarn typecheck

Format:

yarn format

Husky hooks:

yarn prepare

Test:

yarn test

Run in development mode:

yarn dev

Build:

yarn build

Run:

node build/index.js

To commit a WIP skipping checks:

git commit -m "WIP: <message>" --no-verify

To run it using Docker, running the server on port 3000:

docker-compose up --build