Skip to content
This repository has been archived by the owner on Aug 12, 2021. It is now read-only.

A modern backend boilerplate. It's the basis for my hobby projects. Bring your own frontend poison.

License

Notifications You must be signed in to change notification settings

sampsakuronen/sampsas-boilerplate

Repository files navigation

Sampsa's boilerplate

Test Code Style: Google

This is my boilerplate for a modern backend project. It's the basis for my hobby projects.

Pick your own frontend poison.

  • TypeScript
  • node, express (w/ bodyparser, helmet, compression)
  • Linting and formatting: gts
  • Runtime typechecks and endpoint validations: io-ts, typera
  • jest, supertest
  • postgres, postgres-migrations
  • Github Actions

Prerequisites

  • Install n for node version management (https://github.com/tj/n).
  • Configure your IDE to format on save.
  • Fill in .env based on .env_example
  • Install postgres and create a database with a name you defined in .env

Developing

n auto
npm run watch | npm start

Migrations

  1. Decide how you want to do sequential numbering: 1...x or using a timestamp
  2. Create a new .sql in migrations/sql
  3. npm run migrate (also runs as part of npm start)

Production

  • Migrations are run upon npm start. This is probably too opinionated for you.
  • Depending on your environment the development dependencies might not be installed and thus not available for npm run compile

Deploy

About

A modern backend boilerplate. It's the basis for my hobby projects. Bring your own frontend poison.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published