Basic web-app template. By default it's assumed, that it would be a web-app with at least HTTP API.
if other service is needed (sockets, for example), the conceived way is to add source/service.ts
and source/service/
; then, add the corresponding npm script to package.json
and there you go
- Unix-like OS (Linux tested 100%; MacOS isn't tested at all)
- Node Version Manager
- Docker
- Rename the folder (otherwise, docker-compose network name would be confusing)
- Update Node.js version
- put the required node version into
.nvmrc
file nvm use
- put the required node version into
- Update packages versions
npm run update-packages
npm install
If something goes wrong, read the log & manually rollback the package(s) version. Sometimes it happens for reasons beyond me (
npm-check-updates
package just updates thepackage.json
)
- Update Docker-images versions & names
docker-compose.dev.yml
:- services/service-name: image, container_name, volumes
- volumes/volume-name: name
- services/postgres/environment: POSTGRES_DB
- Run docker-compose
npm run compose:up
:down
for removing containers with their volumes;:stop
&:start
for pausing & starting the containers, respectively
- Update config values
config/default.ts
- Run the API in dev-mode
npm run api:dev
-
npm run migrate:new
for creating new migration-file -
npm run migrate
for migrating existing files -
npm run psql
for direct aceess (updatepackage.json
script first:template-postgres
is yourcontainer_name
, andtemplate
is yourPOSTGRES_DB
)