This is an example of a NodeJS server using express, graphql, typescript and prisma.
The code was stored on github, To run the server locally, I recommend using a database instance in docker with help of a bitnami container.
npm i
To create the instance of the database download and install docker, then run:
docker run --name postgresql -e POSTGRESQL_USERNAME=admin -e POSTGRESQL_PASSWORD=docker -e POSTGRESQL_DATABASE=airbank -p 5432:5432 bitnami/postgresql:latest
Copy the .env file based on the .env.template with the environment variables.
#Environment
NODE_ENV=development
PORT=4005
#Database
DATABASE_URL="postgresql://admin:docker@localhost:5432/airbank?schema=public"
SHADOW_DATABASE_URL="postgresql://admin:docker@localhost:5432/airbank?schema=public"
Model the database.
npm run migrate
Populate the database
npm run seed
To develop locally:
npm run dev
Just make a direct commit to the main branch.
git add folder/file
git commit -m "Deploy changes"
git push origin main