Basic web-api template. If you need to add, for example, sockets, convention is to add source/sockets.ts along with source/sockets/. Follow existing api-logic.
- Unix-like OS (Ubuntu works properly; MacOS not tested)
- Node Version Manager
- Docker
- Update Node.js version
- put the required node version into
.nvmrcfile nvm use
- put the required node version into
- Initiate .env file
cp .env.example .env- put proper values (
PROJECT_NAMEis the only value to update at the moment)
- Update packages versions
make update-npm-packagesnpm installIf something goes wrong, read the log & manually rollback the package(s) version. Sometimes it happens for reasons beyond me (
npm-check-updatespackage just updates thepackage.json)
- Update Docker-images versions
docker-compose.dev.yml:- services/image: image
- Run docker-compose
make compose-up-downfor removing containers with their volumes;-stop&-startfor pausing & starting the containers, respectively
- Update config values
config/default.ts
- Run the API in dev-mode
npm run api:dev
-
npm run migrate:makefor creating new migration-file -
npm run migratefor migrating existing files -
make psqlfor direct PG access inside of container