Sandbox app to play with Nest framework
api — API service with Nest.js and TypeORM.
web — Angular Universal app which connects to the API.
https://nestier.sib.li/api/doc/
-
Install Google Cloud SDK
-
Init profile:
gcloud init
-
Or check and set Project ID for existing profile:
gcloud config get-value project gcloud config set project YOUR-PROJECT-ID
-
-
Create
api/app.env.yaml
files based onapi/app.env.example.yaml
and set DB settings.-
For example, if you are using Google Cloud SQL, obtain connection name for the Cloud SQL instance and set
POSTGRES_HOST: '/cloudsql/INSTANCE_CONNECTION_NAME'
andPOSTGRES_USER
,POSTGRES_PASSWORD
,POSTGRES_DB
accordingly. -
For Heroku, acquire database credentials in Service Settings dashboard or via Heroku CLI:
heroku pg:credentials:url -a HEROKU_APP_NAME
-
-
Deploy (version will be set to
prod-1
)gcloud app deploy dispatch.yaml web/app.yaml api/app.yaml --quiet --promote -v prod-1
-
Install Docker with docker-compose
-
Run:
docker-compose up -d --force-recreate --build
To stop containers, run:
docker-compose down
-
Run API (
cd api
):-
With Webpack Hot Module Reloading:
yarn start:hmr
Webpack watcher will partially recompile only changed sources when some code got changed.
After first build it will launch compiled
dist/main.js
(which will be reloaded automatically on subsequent builds). -
OR with ts-node-dev (will recompile all sources when some code got changed):
yarn start:dev
-
-
Run Web (
cd web
):yarn start:dev