@fabernovel/pes-nx-plugin-nest v1.0.0-alpha.41
@fabernovel/pes-nx-plugin-nest
Fabernovel's plugin for api applications
Table of contents
Usage
Requirements
Inside your project's workspace, add this plugin as a dependency:
pnpm add -D -w @fabernovel/pes-nx-plugin-nest
If you do not have a workspace, refer to @fabernovel/pes-nx-plugin-workspace
's README and create one.
Available generators
1. Application
In order to create an API Application, run the following command:
pnpm exec nx g @fabernovel/pes-nx-plugin-nest:application <name> [options]
Arguments | Description |
---|---|
<name> | Application name (will be requested by the cli if not provided) |
Options | Default | Description | Required |
---|---|---|---|
--tags | Tags (string separated by commas). For example: --tags="auth, user" |
Note: It's important to note that the Nest application requires a database to function properly. Without a database, the application will crash when served. After generating the Nest application, you have three options for providing a database:
- Generate a docker-compose file that includes a Postgres database using the nx-plugin-docker tool. Docker documentation
- Use your own local database.
- Use a remote database.
Whichever option you choose, you'll need to specify the database identifiers in the .env.local file.
2. Library
In order to create an api
library, run the following command:
pnpm exec nx g @fabernovel/pes-nx-plugin-nest:library <name> [options]
Arguments | Description |
---|---|
<name> | Library name (will be requested by the cli if not provided) |
Options | Default | Description | Required |
---|---|---|---|
--appName | Application name (will be requested by the cli if not provided) | :eight_spoked_asterisk: | |
--shared | false | Add the library to libs//shared folder and tag it as shared | |
--directory | :warn: Use at your own discretion. Path of the library (string) after /libs . This is an opt out of our architecture. | ||
--service | true | Include a service with the library | |
--controller | true | Include a controller with the library. | |
--module | true | Include a module with the library. | |
--tags | Tags (string separated by commas). For example: --tags="auth,user" |
3. Logging
winston
is used to configure the custom logger for nest apps.
The configutation file for the logger in located in src/app/logging/
.
See Nestjs custom logger documentation See winston documentation
Installed
When you'll generate the Nest application, the following technologies will be included:
- Swagger, to document your code. Learn more here
- Helmet, to secure the app by setting some http headers. Learn more here
- TypeORM, is the layer that helps interact with the database(s). Learn more here
Contributing
See the Contributing file.
10 months ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago