Back to Amplication

Amplication Server

packages/amplication-server/README.md

3.15.05.1 KB
Original Source

Amplication Server

Amplication Server is the main component that provides critical back-end functionality to support the operation of the platform.

The server exposes a GraphQL API for all operations. The server is built with the following awesome open source technologies: Node.js, NestJS, Prisma, PostgreSQL, GraphQL, and many more.

Setup

Amplication is using a mono-repo with multiple packages. To initialize all the packages on a local development environment, follow the Getting Started With Local Development section to do that in a few quick steps.

Useful Targets

Targets can be run using Nx Workspaces. You can read more about targets in the Nx Documentation.

You can find a full list of targets in the project.json file.

serve

Runs the app in development mode.

npx nx serve amplication-server

test

Executes tests.

npx nx test amplication-server

lint

Performs a linting check using ESLint.

npx nx lint amplication-server

build

Builds the app for production. The distributable is expored to the dist folder in the repository's root folder.

npx nx build amplication-server

Environment Variables

EnvironmentDescriptionValue
DEBUG_MODEdebug level1
NODE_ENVenvironment modedevelopment
POSTGRESQL_URLconnection url to the databasepostgresql://admin:admin@localhost:5432/amplication
POSTGRESQL_USERusername for the local databaseadmin
POSTGRESQL_PASSWORDpassword for the local databaseadmin
CORS_ENABLEenable CORS1
PORTthe post that the server is running on3000
HOSTlocalhosthttp://localhost:3000
GRAPHQL_DEBUGGraphQL debug1
PLAYGROUND_ENABLEenable GraphQL playground1
JWT_SECRETJWT secretXAFzBpM3es
BCRYPT_SALT_OR_ROUNDSsalt for bcrypt10
SERVICE_JWT_SECRETJWT secret/QN%^4uefRUR%]Ar
DEFAULT_DISKdefault storage disklocal
LOCAL_DISK_ROOTlocal storage disk root./artifacts
BASE_BUILDS_FOLDERpath to a folder where your builds will be savedAbsolute path to a folder where your builds will be saved for development purposes, leave this variable empty to use .amplication/storage relative to the execution folder.
CONTAINER_BUILDER_DEFAULTwhere to build containers by defaultdocker
KAFKA_BROKERSkafka client must be configured with at least one broker. The brokers on the list are considered seed brokers and are only used to bootstrap the client and load initial metadata["localhost:9092"]
KAFKA_CLIENT_IDA logical identifier of an application. Can be used by brokers to apply quotas or trace requests to a specific application. Example: booking-events-processorserver-queue-client
KAFKA_GROUP_IDprevent collisions between Nest microservice client and server components"main-server-group"
GENERATE_PULL_REQUEST_TOPICKafka topics are the categories used to organize messages. Each topic has a name that is unique across the entire Kafka cluster"git.pr.generate.message"
CHECK_USER_ACCESS_TOPICkafka topic for user access"auth.user.access"
COMPOSE_PROJECT_NAMEname of the docker imageamplication-server
LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQ0lqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FnOEFNSUlDQ2dLQ0FnRUFvUmh5d1dnK3h2UmhKN2lFMDJlaQpJMGVNL1lqVnFpTHpFbEwzYUR2MTQ5cUxYZk9FeUR0NzV0emk4RlpraHh5TjJOV0R0REpKdGJETmlKVklISmVlCnR5cWl5WUF6VCtZOUM5SlpQdE9DOTBwaVg0YmxIRG1KQVltZGs2b1VjTU5BbjNwaW5rWWFnVW5mV3piS0p3NnkKdmdYR2JUS2VKejVNcEVrRUY0UXQwM2JOVlk2VHZBZVNqS0d1bEhsbHZqMnRlTFp0Ui9IbjRtYmhVdUZwenh1VAo3LzgwZEVVUWx5Mk9hMSsxSUZ0OVhBTTBvdjhUWUFQMnpjV0dlWWs3K2RIRndKMThlVkp5cGUyMkxSbEVONXdrClNkUXJvcmVBV1FjUjcvKzZBRGJyR1VNVU1BM3p1SVg5U292UkMwOWdEdUR6TGxncC9ieitWRVlaa0Z4dmRneHAKKzZVY0VsNnhPUXJoMW0wVW9BWlEreTRQb0svazY1bHBHeUhnWW92WHlQRzdoTWJRNmhQQjl3Wmx4TjNFeHBkUQpLWTg2T3gwajlWSVB6bTZxVDNZenJmZ0FhTXpSRDRxOHhUQURPVTEvY1hEOVFPY2grYmkrcHR2eFAvY1ZhWWZBCkcvdjF4Wkxzem9rTWFYUFJCa2NuUWRMdVY1TzREUDIreFBScitPYXZtWVBOVUIvRHNGZGRraFlJMFNQQ2d2cmUKRERCWXJWYTRCZ0FMR294TTJGYkJoZ3dWN2FRNEFXYXFLTVdWUy9nT1pYRUgxZlV6aGVqay9yeGh0NXN2eFBIUApsRWpsdEFvRzY2bEsyandsYjRab09INnl6Yjg0b0pVeDRjZE4vQmJEMWpDaERaZEJoN0M0YVFCaUFKRmtkc0lRCjdMWmVJOVJmRFlKVms5SnRzWTNzZjlrQ0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ==
GITHUB_APP_CLIENT_SECRETsecret of your github app[use-secret-manager]
GITHUB_APP_CLIENT_IDinstalled github app client ID[github-app-client-id]
GITHUB_APP_APP_IDID of the installed github app[github-app-app-id]
GITHUB_APP_PRIVATE_KEYprivate key of the installed github app[github-app-private-key]
GITHUB_APP_INSTALLATION_URLthe url of your github app[github-app-installation-url]

Optional: Google Cloud Platform

If you use the Google Cloud Platform integration make sure to execute:

bash
gcloud auth login
gcloud auth application-default login