Skip to content

ruanmartinelli/server-starter-typescript

Repository files navigation

server-starter-typescript

Build Status codecov Jest GNU Make

Starter project for building a bare-bones TypeScript Node.js server.

Deploy

Deploy

Requirements

  • Node.js 10+

Dependencies

Main dependencies:

  • TypeScript
  • Fastify
  • Jest
  • npm
  • Prettier & ESLint

Get started

Steps to run the repository for the first time:

  1. Clone the repo:
git clone https://github.com/ruanmartinelli/server-starter-typescript.git <NEW_NAME>

cd <NEW_NAME>
  1. Check Node.js version:
node -v # Should be v10.0.0+

If you have nvm installed, you can run nvm use to switch to version 10.

  1. Run:
make bootstrap

Optional: change the name on the package.json file.

Folder structure

Some files were omitted for simplicity.

.
├── src
|  ├── app.ts       # Application entry file
|  ├── controller   # App controllers
|  ├── middleware   # Koa middlewares
|  └── util         # Misc utilities
└── test

Develop

  1. Make changes

Write controllers and routes, install dependencies, etc.

  1. Write tests

Remember to use <>.spec.ts for test files.

  1. Run tests
make test

Scripts

All useful scripts are present on the Makefile.

License

MIT © Ruan Martinelli