Starter project for building a bare-bones TypeScript Node.js server.
- Node.js 10+
Main dependencies:
- TypeScript
- Fastify
- Jest
- npm
- Prettier & ESLint
Steps to run the repository for the first time:
- Clone the repo:
git clone https://github.com/ruanmartinelli/server-starter-typescript.git <NEW_NAME>
cd <NEW_NAME>
- 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.
- Run:
make bootstrap
Optional: change the name on the package.json
file.
Some files were omitted for simplicity.
.
├── src
| ├── app.ts # Application entry file
| ├── controller # App controllers
| ├── middleware # Koa middlewares
| └── util # Misc utilities
└── test
- Make changes
Write controllers and routes, install dependencies, etc.
- Write tests
Remember to use <>.spec.ts
for test files.
- Run tests
make test
All useful scripts are present on the Makefile.
MIT © Ruan Martinelli