guide config - wwwsolutions/nestjs-starter-kit GitHub Wiki
This is a configuration library powered by @nestjs/config and Joi. It loads environment variables from .env.*
files and uses validation.schema for validation which is also used to set default values. Finally, it exposes ApiConfigAppModule
and different configurations which can be consumed in different ways by the application.
This library is required and encapsulates configurations for core application functionality.
-
libs/api/config/app
-
environment variables:
- add/edit environment variables in
.env.*
files.
- add/edit environment variables in
-
validation and defaults:
- add/edit validation rules for environment variables in
validation.schema.ts
file.
- add/edit validation rules for environment variables in
-
application configuration registration:
- add/edit application configuration set in
app-configs.registration.ts
file.
- add/edit application configuration set in
This is a configuration library powered by @nestjs/config and Joi. It loads environment variables from .env.*
files and uses validation.schema for validation which is also used to set default values. Finally, it exposes ApiConfigFeaturesModule
and different configurations which can be consumed in different ways by the application.
Configurations in this library are optional.
-
libs/api/config/features
-
environment variables:
- add/edit environment variables in
.env.*
files.
- add/edit environment variables in
-
validation and defaults:
- add/edit validation rules for environment variables in
validation.schema.ts
file.
- add/edit validation rules for environment variables in
-
API integration configuration registration:
- add/change API integration configuration set in
api-integration-configs.registration.ts
file.
- add/change API integration configuration set in
-
business logic (features) configuration registration:
- add feature configuration in
business-logic-configs.registration.ts
file.
- add feature configuration in
STATUS: unfinished
This is a custom virtualization library powered by Nx commands and docker-compose. The purpose of the library is to serve as a container for docker-compose config fragments which can be combined and executed to build a final docker-compose files in different contexts. It exposes no modules and no configurations.
-
libs/api/config/docker
-
src
ci
-
development
production
staging
test
- project.json
-
It generates
.docker/generated/docker-compose-stack.development.yaml
file and execute it by building images and starting containers in detached mode for corresponding context.
-
run command sequence:
- nx run api-config-docker:compose --mode=development
- nx run api-config-docker:up --mode=development
It stops containers and removes volumes and then cleans up by removing
.docker/generated/docker-compose-stack.development.yaml
file for corresponding context.
-
run command sequence:
- nx run api-config-docker:down --mode=development
- nx run api-config-docker:clean --mode=development
Why did I organized it in this manner?
- modularization - to isolate all virtualization script in one place.
- practicality - good riddance to npm script clutter
- flexibility - comes with utilization of Nx commands