Skip to content

Commit

Permalink
Merge branch 'main' into docs/plugins-page-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dericksozo authored Nov 4, 2023
2 parents 0bf6796 + 1bc20f9 commit 82824be
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 37 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
https://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

Expand Down Expand Up @@ -192,7 +192,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion docs/custom-code/add-custom-dto.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A DTO (Data Access Object) is an object that defines how the data will be sent o
DTOs can be defined by TypeScript interfaces or by classes. It is preferable to use classes, as TypeScript interfaces are removed during the transpilation, and can't be referred to at runtime. However, classes are part of the JavaScript ES6 standard and are therefore preserved as real entities in the compiled JavaScript.

## The Problem
The DTOs in Amplication are generated based on the relations between the entities,Prisma schema, and types.
The DTOs in Amplication are generated based on the relations between the entities, Prisma schema, and types.
In addition to the default DTOs generated by Amplication, you may need to create a new custom DTO or extend an existing one.

For example, let's say you have an application with a Customer entity, and you want to filter all the customers by the property _customerType_.
Expand Down
4 changes: 2 additions & 2 deletions docs/custom-code/amplicationignore.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ The file works similarly to `.gitignore`, using the [glob](<https://en.wikipedia

```bash
# .amplicationignore
folder_or_file. <-- Ignore ignore a specific file or folder
folder/file <-- Ignore a specific file in a
folder_or_file. <-- Ignore a specific file or folder
folder/file <-- Ignore a specific file in a folder
folder/**/file.json <-- Ignore all file.json occurrences in subfolders of "folder"
```

Expand Down
5 changes: 3 additions & 2 deletions docs/dictionary/en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,13 @@ upvote
webp
Wontfix
microservices
dto
amplicationignore
dbsettings
drawio
heirarchy
autoplay
youtube
amplicationrc
OpenTelemetry
RDBMS
NATS
datasource
Expand All @@ -92,3 +91,5 @@ Baselining
configmap
kubeconfig
DALLE
frontends
Zustand
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,30 @@ For example, here's how two models could see transformations:
}
```

#### Model IDs
#### Model IDs

This phase converts `@@id` attributes in your models to `@@unique` attributes.
In the next phase, Amplication will convert the `@@id` attribute with one argument when you are using it as the primary key of the model. For example, `@@id([field])`.

It also introduces an `id` field of type `String` to every model that uses a composite ID.
:::note
Currently, using the `@@id` attribute as a composite ID is not supported (`@@id([field1, field2])`).
:::

- The `@@id` attribute in your model is converted to an `@@unique` attribute.
- The field which was used as the primary key of the model through the `@@id` attribute is converted to an id field. This means the `@id` attribute is added to this field.
- If this field has no `@default()` attribute representing the default id field type, the `@default()` attribute will be added based on the field type (`String` => `@default(cuid())`, `Int` => `@default(autoincrement())`).
- If the primary key field is not named "id", it gets renamed to id and we add the `@map` attribute: `@map("originalFieldName")`.
- The field name in the `@@id` attribute is changed to "id", e.g. `@@id([field])` => `@@id([id])`.

Here's an example of this transformation:
Here is an example of this transformation:

```diff title="schema.prisma"
model DomainUnit {
+ id String @id @default(cuid())
domainId String
unitId String
+ id String @id @default(cuid()) @map("domainId")
- domainId String
unitId String

- @@id([domainId, unitId])
+ @@unique([domainId, unitId])
- @@id([domainId])
+ @@unique([id])
}
```

Expand Down
12 changes: 0 additions & 12 deletions docs/getting-started/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ The source code of all community Amplication plugins are [available on GitHub](h

Besides the community plugins created by the Amplication team, you can [develop your own custom plugins](/plugins/overview/).

## How To Install A Plugin

1. In the _All Plugins_ page, click **Install** for the required plugin.

![](./assets/all-plugins.png)

2. Go to the _Installed Plugins_ page. The installed plugins are listed.

![](./assets/installed-plugins.png)

3. To see the plugin on gitHub, select **View on GitHub**.

## Community Plugins List

You can view all community plugins on the _All Plugins_ page.
Expand Down
10 changes: 5 additions & 5 deletions docs/getting-started/service-entities-roles-permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ You might find it easier to first add all the fields you want, one after another
1. In the _Entity Fields_ text box (above the list of fields), type “Name”.
2. Click **Add field** (or just press Enter). The new field is added to the list and the field's property panel opens.
3. Click the **Required Field** toggle to configure the _Name_ field as required.
4. Leave the defaults for the other properties (_Searchable_ active, _Data Type_ "Single Line Text", and _Max Length_ "1000".)
4. Leave the defaults for the other properties (_Searchable_ active, _Data Type_ "Single Line Text", and _Max Length_ "1000").

![](./assets/first-app/name-field.png)

Expand All @@ -79,7 +79,7 @@ All changes are saved automatically.

1. In the _Entity Fields_ text box type “Description”.
2. Click **Add field** (or just press Enter). The new field is added to the list and the field's property panel opens.
3. Leave the defaults (_Required Field_ inactive _Searchable_ active, _Data Type_ "Multi Line Text", and _Max Length_ "1000".)
3. Leave the defaults (_Required Field_ inactive _Searchable_ active, _Data Type_ "Multi Line Text", and _Max Length_ "1000").

:::info

Expand All @@ -100,7 +100,7 @@ If needed, you can manually change the field name in the field's properties pane
:::

2. Click **Add field** (or just press Enter). The new field is added to the list.
3. The field's property panel opens. Leave the defaults (_Required Field_ inactive, _Searchable_ active, _Data Type_ "Date Time", and _Time Zone_ "Local Time".)
3. The field's property panel opens. Leave the defaults (_Required Field_ inactive, _Searchable_ active, _Data Type_ "Date Time", and _Time Zone_ "Local Time).

### Create the Owner Field

Expand Down Expand Up @@ -161,7 +161,7 @@ These actions can be set to one of the following:

By default, all of the actions are set as **All Roles**.

In this example, some of the actions have been changed to **Public**, while the others remain as **All Roles**
In this example, some of the actions have been changed to **Public**, while the others remain as **All Roles**.

![](./assets/first-app/permissions.png)

Expand Down Expand Up @@ -243,4 +243,4 @@ Now that you know how to create entities, commit changes, and build new versions

You'll also learn more about how Amplication automatically tracks your code and changes in a git repository.

[Building New Versions of Your Service](/building-new-versions/)
[Building New Versions of Your Service](/building-new-versions/)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions docs/how-to/code-generator-version-control.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Code Generator Version Control
description: This feature gives you the flexibility to chose which version of the code generator you want to use.
sidebar_label: Code Generator Version Control
slug: /code-generator-version-control
---

The **Code Generator Version Control** feature gives Pro and Enterprise plan users the flexibility to choose which version of the code generator they want to use.

Amplication's code generator periodically releases new versions with bug fixes, enhancements, and new features.

While it's recommended to use the latest version, some teams may prefer having more control over when to upgrade the generated code.

![Amplication Code Generator Version Control](./assets/code-generator-version-control.png)

## Benefits

- **Avoid Breaking Changes**: Upgrade on your own schedule and don't be forced to use a version that might contain breaking changes right away.

- **Test New Versions**: Try out a new version and see how it impacts your app before rolling it out to production.

- **Lock Down Stable Versions**: Lock in a stable version and keep generating code without unexpected changes.

## How It Works

1. In your service's **Settings** page, navigate to the **Code Generator Version** tab.

:::note
Only Code Generator versions that have been released since you created your service can be used. You can't use code generator versions that were released earlier than your service's creation date.
:::

2. Enable the `I want to select a specific version of the code generator` toggle into the ON state.

Every item in the dropdown is a specific version. Lock in a specific version for this service and it won't change until you manually update it.

:::tip
If you disable this toggle, Amplication will always use the latest version of the code generator.
:::

3. Click on `Version History` to view all previous code generator versions that you have used for your service.

4. Rebuild your service and commit your changes to see the new version applied.

Now whenever you generate code for your services, Amplication will use the code generator version you selected.

## Enable CodeGen Version Control

To use the **Code Generator Version Control** feature, upgrade to Amplication's Pro plan or Enterprise plan.

The feature will automatically become available in the settings page for each of your services.

For more details on Amplication's plans, visit our [pricing page](https://amplication.com/pricing).
6 changes: 3 additions & 3 deletions docs/running-amplication-platform/connect-server-to-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ When running a local Amplication server you first need to configure the server t
10. Clone [/packages/amplication-server/.env](https://github.com/amplication/amplication/blob/master/packages/amplication-server/.env) into `/packages/amplication-server/.env.local`
11. Update `/packages/amplication-server/.env.local` with the following variables

```sh
```sh title=".env.local"
# GitHub App (Git sync)
GITHUB_APP_APP_ID="replace with the github App ID"
GITHUB_APP_CLIENT_ID="replace with the github app Client ID"
GITHUB_APP_CLIENT_SECRET="replace with secret created as step 1.4"
GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----The key copied at step 1.5-----END RSA PRIVATE KEY-----"
GITHUB_APP_PRIVATE_KEY=-----BEGIN RSA PRIVATE KEY-----\nContent of the key created in step 1.5\n-----END RSA PRIVATE KEY-----

# replace [your-github-username]-amplication-local with your chosen name
GITHUB_APP_INSTALLATION_URL='https://github.com/apps/[your-github-username]-amplication-local/installations/new?state={state}'
Expand All @@ -64,7 +64,7 @@ When running a local Amplication server you first need to configure the server t
GITHUB_APP_APP_ID="replace with the github App ID"
# replace [your-github-username]-amplication-local with your chosen name
GITHUB_APP_INSTALLATION_URL='https://github.com/apps/[your-github-username]-amplication-local/installations/new?state={state}'
GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----The key copied at step 1.5-----END RSA PRIVATE KEY-----"
GITHUB_APP_PRIVATE_KEY=-----BEGIN RSA PRIVATE KEY-----\nContent of the key\n-----END RSA PRIVATE KEY-----
```

14. Restart Amplication server.
24 changes: 24 additions & 0 deletions docs/tutorials/community-tutorials.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Community Tutorials
sidebar_label: Community Tutorials
---

# Community Tutorials

The Amplication community has created some great tutorials showing how to build different types of backends using Amplication.
These tutorials demonstrate integrating Amplication with various frontends, databases, and other technologies.

## Tutorials

- [Creating a Chatroom in Angular using Amplication](https://dev.to/akshitadixit/creating-a-chatroom-in-angular-using-amplication-39l)
-[⚛️ Full Stack Amazon Clone with Next.js, Typescript, Tailwind CSS, Zustand, Next UI, Recharts and Amplication 🚀](https://dev.to/koolkishan/full-stack-amazon-clone-with-nextjs-typescript-tailwind-css-zustand-next-ui-recharts-and-amplication-1h89)
- [Building Scalable Microservices with Amplication, GraphQL, MongoDB, and Kafka](https://dev.to/tyaga001/building-scalable-microservices-with-amplication-graphql-mongodb-and-kafka-1ee0)
- [Creating a To-Do App in Flutter using Amplication](https://dev.to/hamdaanaliquatil/creating-a-to-do-app-in-flutter-using-amplication-2mem)
- [How to deploy Amplication app to DigitalOcean](https://dev.to/thucpn/how-to-deploy-amplication-app-to-digitalocean-o3e)
- [Building a Data-Heavy NodeJS App with Amplication](https://medium.com/faun/building-a-data-heavy-nodejs-app-with-amplication-2c82f44a912f)

## Add Your Tutorial

If you've written a tutorial for building backends with Amplication, please consider adding it to the documentation.
Just open a pull request adding your tutorial to this page.
We'd love to share what the community is building with Amplication!
4 changes: 3 additions & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ const sidebars = {
label: "Premium Features",
items: [
"how-to/enterprise-sso",
"how-to/git-branch-per-service"
"how-to/git-branch-per-service",
"how-to/code-generator-version-control"
]
},
{
Expand Down Expand Up @@ -220,6 +221,7 @@ const sidebars = {
},
items: [
"tutorials/index",
"tutorials/community-tutorials",
{
type: "link",
label: "Developer Tutorials",
Expand Down

0 comments on commit 82824be

Please sign in to comment.