You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This service was generated with Amplication. The server-side of the generated project. This component provides the different backend services - i.e., REST API, GraphQL API, authentication, authorization, logging, data validation and the connection to the database. Additional information about the server component and the architecture around it, can be found on the [documentation](https://docs.amplication.com/guides/getting-started) site.
10
+
11
+
# Getting started
12
+
13
+
## Step 1: Configuration
14
+
15
+
Configuration for the server component can be provided through the use of environment variables. These can be passed to the application via the use of the `.env` file in the base directory of the generated service. Below a table can be found which show the different variables that can be passed - these are the variables which exist by default, through the use of plugins additional integrations could require additional values. These values are provided default values after generation, change them to the desired values.
| BCRYPT_SALT | the string used for hashing |[random-string]|
20
+
| COMPOSE_PROJECT_NAME | the identifier of the service plus prefix | amp_[service-identifier]|
21
+
| PORT | the port on which to run the server | 3000 |
22
+
| DB_URL | the connection url for the database |[db-provider]://[username]:[password]@localhost:[db-port]/[db-name]|
23
+
| DB_PORT | the port used by the database instance |[db-provider-port]|
24
+
| DB_USER | the username used to connect to the database |[username]|
25
+
| DB_PASSWORD | the password used to connect to the database |[password]|
26
+
| DB_NAME | the name of the database |[service-name] / [project-name]|
27
+
| JWT_SECRET_KEY | the secret used to sign the json-web token |[secret]|
28
+
| JWT_EXPIRATION | the expiration time for the json-web token | 2d |
29
+
30
+
> **Note**
31
+
> Amplication generates default values and stores them under the .env file. It is advised to use some form of secrets manager/vault solution when using in production.
32
+
33
+
## Step 2.1: Scripts - pre-requisites
34
+
35
+
After configuration of the server the next step would be to run the application. Before running the server side of the component, make sure that the different pre-requisites are met - i.e., node.js [^16.x], npm, docker. After the setup of the pre-requisites the server component can be started.
36
+
37
+
```sh
38
+
# installation of the dependencies
39
+
$ npm install
40
+
41
+
# generate the prisma client
42
+
$ npm run prisma:generate
43
+
```
44
+
45
+
## Step 2.2: Scripts - local development
46
+
47
+
```sh
48
+
# start the database where the server component will connect to
49
+
$ npm run docker:dev
50
+
51
+
# initialize the database
52
+
$ npm run db:init
53
+
54
+
# start the server component
55
+
$ npm run start
56
+
```
57
+
By default, your app comes with one user with the username "admin" and password "admin".
58
+
59
+
## Step 2.2: Scripts - container based development
60
+
61
+
```shell
62
+
# start the server component as a docker container
0 commit comments