Skip to content

Commit

Permalink
Merge branch 'main' into docs/deploy-page
Browse files Browse the repository at this point in the history
  • Loading branch information
dericksozo authored Aug 25, 2024
2 parents a3aa26e + 5583494 commit c4148a9
Show file tree
Hide file tree
Showing 60 changed files with 4,519 additions and 70 deletions.
6 changes: 5 additions & 1 deletion docs/dictionary/en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,8 @@ Zustand
Supertokens
Bitwarden
Jovu
Jovu's
Jovu's
Appsettings
appsettings
Codespaces
Keycloak
44 changes: 30 additions & 14 deletions docs/getting-started/community-plugins.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: Community Plugins
sidebar_label: Plugins List
title: Node.js Plugins
sidebar_label: Node.js Plugins
slug: /plugins-list
pagination_next: plugins/overview
pagination_prev: getting-started/plugins
---

# Amplication Community Plugins
# Amplication Node.js Plugins

The following plugins are currently available.
The following plugins are currently available for Node.js services generated by Amplication.
Additional plugins will be added in future releases of Amplication.

:::note
For the most updated list of plugins, it's recommended to check the _All Plugins_ page on your Amplication dashboard.
For the most updated list of Node.js plugins, please check the _Plugins_ tab on your Amplication dashboard.
:::

### Mongo DB
Expand Down Expand Up @@ -85,21 +85,15 @@ Integrate Auth0's robust authentication solutions into your service with the [Au
[ESLint](https://github.com/amplication/plugins/tree/master/plugins/linter-eslint) is a library that helps find issues and enforce code style in your JavaScript code.
ESLint has a wide array of rules that can be configured to enforce code quality and consistency.

### Redis
### Redis Caching

[Redis](https://github.com/amplication/plugins/tree/master/plugins/cache-redis) is an open-source, in-memory data store that can be used as a database, cache, streaming engine, and message broker.
Redis provides high availability via replication and high performance via caching.
It is commonly used to quickly access frequently used application data.
Enhance your application's performance with the [Redis Caching](https://github.com/amplication/plugins/tree/master/plugins/cache-redis) plugin. Redis is known for its fast data retrieval capabilities, making it an excellent choice for implementing caching strategies.

### Redis Message Broker

[Redis Message Broker](https://github.com/amplication/plugins/tree/master/plugins/broker-redis) is an extension of the traditional Redis in-memory data store, allowing it to function as a message broker.
Install this plugin to leverage Redis's in-memory capabilities and enables asynchronous message communication between different parts of an application or between different applications.

### Redis Caching

Enhance your application's performance with the [Redis Caching](https://github.com/amplication/plugins/tree/master/plugins/cache-redis) plugin. Redis is known for its fast data retrieval capabilities, making it an excellent choice for implementing caching strategies.

### OpenAI

The [OpenAI](https://github.com/amplication/plugins/tree/master/plugins/integration-openai) plugin allows you to integrate OpenAI's various AI models into your Amplication app.
Expand Down Expand Up @@ -195,8 +189,30 @@ Incorporate Hashicorp Vault's powerful secrets management capabilities with the

### JSON Logger

The JSON Logger Plugin is designed for logging in JSON format. It offers configurable log levels, including 'fatal', 'error', 'warn', 'info', 'debug', 'trace', and 'silent'. Users can also add custom properties to log messages.
The [JSON Logger Plugin](https://github.com/amplication/plugins/tree/master/plugins/logger-json) is designed for logging in JSON format. It offers configurable log levels, including 'fatal', 'error', 'warn', 'info', 'debug', 'trace', and 'silent'. Users can also add custom properties to log messages.

### MQTT

MQTT (Message Queuing Telemetry Transport) is an ISO standard publish-subscribe-based messaging protocol. It is designed for connections with remote locations where a "small code footprint" is required or the network bandwidth is limited. MQTT is highly scalable and is ideal for IoT devices, mobile applications, and messaging applications that require minimal data packets for communication.

### RabbitMQ Message Broker

Use RabbitMQ as a message broker to facilitate communication between your services.

[RabbitMQ](https://github.com/amplication/plugins/tree/master/plugins/broker-rabbitmq) is a robust, open-source message-queuing software that implements the Advanced Message Queuing Protocol (AMQP). It's known for its reliability, scalability, and support for multiple messaging protocols, making it an excellent choice for building distributed systems and microservices architectures.

### GitHub Codespaces Dev Container

Streamline your development environment setup with the [GitHub Codespaces Dev Container](https://github.com/amplication/plugins/tree/master/plugins/devcontainer-github-codespaces) plugin. This plugin configures a consistent, reproducible development environment using GitHub Codespaces, ensuring that all team members work with the same tools and dependencies.

### Keycloak Authentication Provider

Enhance your service's security with the [Keycloak Authentication Provider](https://github.com/amplication/plugins/tree/master/plugins/auth-keycloak) plugin. Keycloak is an open-source identity and access management solution that provides single sign-on, identity federation, and user management capabilities, allowing you to easily implement robust authentication and authorization in your applications.

### SAML Authentication Provider

Implement SAML (Security Assertion Markup Language) authentication in your service with the [SAML Authentication Provider](https://github.com/amplication/plugins/tree/master/plugins/auth-saml) plugin. SAML is an XML-based open standard for exchanging authentication and authorization data between parties, particularly between an identity provider and a service provider.

### HTTPS Transport

Secure your API communications with the [HTTPS Transport](https://github.com/amplication/plugins/tree/master/plugins/transport-https) plugin. This plugin enables HTTPS (Hypertext Transfer Protocol Secure) for your service, ensuring that all data transmitted between the client and server is encrypted and secure.
10 changes: 7 additions & 3 deletions docs/getting-started/smart-git-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ For example, let's say you've just added a new _Task_ entity to your project. On

This method ensures that every single change you make in your Amplication project is automatically tracked and committed to the `amplication` branch in your Git repository. You can then easily review and merge these changes through pull requests.

:::info
After the Amplication build completes, review the PR, resolve any conflicts, and merge it. **Keep the `amplication` branch and avoid deleting it**.
:::note
After the Amplication build completes, review the PR, resolve any conflicts, and merge it.

**Keep the `amplication` branch and avoid deleting it**. In case of conflicts, handle them on the `amplication` branch and perform commits there. Regular development work should not be done on this branch.
:::

## The `amplication` branch
Expand All @@ -61,7 +63,9 @@ For example, Amplication will base the `amplication` branch from `main` if your
You can merge Amplication-made changes by merging pull requests created by Amplication from the `amplication` branch to your repository's default branch.

:::note
Refrain from modifying the `amplication` branch directly. Creating new commits or merging changes from other branches can introduce bugs and inconsistencies. In case of conflict, delete the `amplication` branch and resolve the merge conflict in the next PR.
**Do not delete the `amplication` branch**.

Do not modify the `amplication` branch, except to resolve conflicts. Handle conflicts directly on the `amplication` branch. Avoid creating new commits or merging changes from other branches to prevent bugs and inconsistencies.
:::

![](./assets/sync-with-git-provider/github-pull-request.png)
Expand Down
12 changes: 11 additions & 1 deletion docs/getting-started/sync-with-bitbucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,14 @@ And there you have it – a new pull request ready for review.

![bitbucket-pull-request](./assets/sync-with-git-provider/bitbucket-pull-request.png)

Amplication creates pull requests from the `amplication` branch into your repository's default base branch. Pro and Enterprise users can [change the base branch for these pull requests](/how-to/change-base-branch-for-pull-requests)
## Merging Amplication's Pull Request into your branch

Amplication creates pull requests from the `amplication` branch into your repository's default base branch.
Amplication triggers the creation of a commit on the changed files whenever a new build is performed on a project.
The changed files are all the files that were added, removed, or changed from the last build.

:::note
**Do not delete the `amplication` branch**.

Do not modify the `amplication` branch, except to resolve conflicts. Handle conflicts directly on the `amplication` branch. Avoid creating new commits or merging changes from other branches to prevent bugs and inconsistencies.
:::
8 changes: 7 additions & 1 deletion docs/getting-started/sync-with-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ Now let's review what happens from GitHub's side when Amplication generates a ne
Amplication triggers the creation of a commit on the changed files whenever a new build is performed on a project.
The changed files are all the files that were added, removed, or changed from the last build.

:::note
**Do not delete the `amplication` branch**.

Do not modify the `amplication` branch, except to resolve conflicts. Handle conflicts directly on the `amplication` branch. Avoid creating new commits or merging changes from other branches to prevent bugs and inconsistencies.
:::

![A pull request generated by Amplication on GitHub](./assets/sync-with-git-provider/github-pull-request-amplication-branch.png)

Amplication reduces the chances of user changes being overridden by interacting with the user’s repository through an `amplication` branch. This branch is created in your selected repository by Amplication's GitHub App.
Expand Down Expand Up @@ -172,7 +178,7 @@ It will take you to the specific build log for this commit on Amplication.

## Merging your pull request

After clicking on `Merge`, you can safely delete this branch. You can then navigate back to your main branch where you will find your Amplication code.
After clicking on `Merge`, do not delete the `amplication` branch. You can then navigate back to your main branch where you will find your Amplication code.

![](./assets/sync-with-git-provider/4d38da6f-9b1c-4844-91ec-ec9b101c4503.png)

Expand Down
30 changes: 27 additions & 3 deletions docs/plugins/before-after.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ slug: /plugins/plugin-events/plugin-events-before-after

# Before and After Lifecycle Functions

All events expose an identical interface with two functions that can be handled by the plugin and responsible for a different step in the lifecycle of the event. One for “before” the event is emitted and another for “after” the event is emitted.
All events expose an identical interface with two functions that can be handled by the plugin and responsible for a different step in the lifecycle of the event. One for "before" the event is emitted and another for "after" the event is emitted.

## Event Structure and Parameters

```tsx
export interface PluginEventType<T extends EventParams> {
Expand All @@ -20,26 +22,48 @@ For each event, the type of `EventParams` is different, providing access to rele

```tsx
export interface EventParams {}
```

## Before and After Function Signatures

```tsx
export type PluginBeforeEvent<T extends EventParams> = (
dsgContext: DsgContext,
eventParams: T
) => Promisable<T>;

// Node.js [version](https://github.com/amplication/amplication/blob/master/libs/util/code-gen-types/src/plugins.types.ts#L21)
export type PluginAfterEvent<T extends EventParams> = (
dsgContext: DsgContext,
eventParams: T,
modules: ModuleMap
) => Promisable<ModuleMap>;

// .NET [version](https://github.com/amplication/amplication/blob/master/libs/util/code-gen-types/src/dotnet-plugins.types.ts#L22)
export type PluginAfterEvent<T extends EventParams, F> = (
dsgContext: DsgContext,
eventParams: T,
files: FileMap<F>
) => Promisable<FileMap<F>>;
```

In the `before` and `after` functions, we have an access to the context and the event params.
The [context](docs\plugins\context.md) is used to gather common parts between events.
The event params manipulate the default behavior by passing different values.

In the `after` function, we also have access to the generated modules. An example of using this parameter is when you want to restructure the generated modules in a different folder structure.
## Accessing and Modifying Generated Files

In the `after` function, we also have access to the generated files. An example of using this parameter is when you want to restructure the generated files in a different folder structure.

:::info
In the `after` function for .NET plugins, we use a [`FileMap`](https://github.com/amplication/amplication/blob/master/libs/util/code-gen-types/src/files/file-map.ts). For Node.js plugins' `after` function we use a [`ModuleMap`](https://github.com/amplication/amplication/blob/master/libs/util/code-gen-types/src/code-gen-types.ts#L149).
:::

## Function Examples

Most of the functions include examples. But, if you're looking for more comprehensive and real-world examples, you can explore the [code of the Amplication plugins](https://github.com/amplication/plugins/tree/master/plugins) directly. These plugins showcase various implementations and use cases for the before and after lifecycle functions.

## Cautionary Guidelines
## Best Practices and Cautions

1. In the `after` function, avoid unintentionally overriding the entire generated file. Opt for smaller changes instead.
2. In the `before` function, take care when modifying templates to not unintentionally affect code generation.
Expand Down
Loading

0 comments on commit c4148a9

Please sign in to comment.