PAC Belgrade 2020 - Backend
Typescript
NodeJS
Loopback 4
GraphQL
Postgres
Docker
Install dependencies via
Environment
Command
Description
Local
npm run dev
Run local Svelte with hot reloading enabled.
Local Prod
npm run start
Run local Svelte with production build.
Prod build
npm run build
Run production build.
Build will create new directory name build
and all files will be there
Task
Command
Description
Docker build
npm run docker:build
Run production build and create docker container
Docker run
npm run docker:run
Run already created docker container
All env variable are executed during run time and can be find in
.env file od dotenv folder.
Variable
Description
DB_HOST
Postgres Host
DB_PORT
Postgres Port
DB_USER
Postgres User
DB_PASSWORD
Postgres Password
DB_DATABASE
Postgres DB name
/
|
├─ api/
| |
| |─ src/
| | ├─ datasrource/ # Database configuration
│ │ ├─ graphql-resolvers/ # Graphql Resolvers
│ │ ├─ graphql-types/ # Graphql Types
│ │ ├─ helpers/ # Helpers method for migration and seed database
│ │ ├─ repositories/ # Methods to execute operation on database
│ │ ├─ seed-data/ # Data to seed database
│ │ ├─ services/ # Internal services
| |
├─ Dockerfile # Container definition
├─ .gitignore # List of files and folders not tracked by Git
├─ package.json # Project manifest
├─ package-lock.json # Project manifest with locked version
└─ README.md # This file