Skip to content

Latest commit

 

History

History
53 lines (43 loc) · 3.4 KB

README.md

File metadata and controls

53 lines (43 loc) · 3.4 KB

TypeScript | Node.js | Express.js API Bootstrap (template)

This repository is intended to serve as a starting point if you want to bootstrap a quick API project in TypeScript.

⚠️ It is meant for simple use cases where you don't need the extra complexity, just a barebones, simple Node.js API. This has its shortcomings:

  • No proper DI framework/container/tool
  • No Clean Architecture structuring (I strongly suggest a DDD approach)
    • Coupling of infrastructure and application layers unless you separate them yourself

If these issues don't matter for your intended use, or you know how to fix them, this will be a fast way to have an API running. If you're looking for a more scalable strategy, check my TS DDD template or if you're looking for a simple, plain Node.js app look at my TypeScript Node.js Template

Features

Local dev

Action Command Description
Install dependencies pnpm i Installs the necessary dependencies
Compile pnpm build Transpiles TS into JS
Run pnpm start Runs the compiled JS
Dev pnpm dev Runs the TypeScript code and watches for changes
Debug pnpm dev:debug Same as Dev but also attaches the debugger

Testing

Node Test Runner

Action Command Description
Test pnpm test Runs all the tests
Test pnpm test:debug Runs all the tests with the debugger attached

Formatting

Action Command Description
Lint pnpm lint Runs the linter and points out mistakes
Format pnpm format Ensures code follows style guides