Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.
/ graphql-blog.api Public archive

Hands on GraphQL using Node.js, Prisma, Docker, Apollo Client

License

Notifications You must be signed in to change notification settings

rdok/graphql-blog.api

Repository files navigation

Graphql-Blog.API

Dev project hands-on GraphQL practise and showcasing the full pipeline, from develop to production.

API Production Build Status

API Test Build Status

Client

Development

Copy .env.example to .env, and modify as per your needs.

The following script will run all the developer dependency commands. Creating web server, db server, and prisma server through docker containers. When finished, you may interact with the web server for your dev needs, e.g. pressing rs will restart the nodemod server.

$ ./docker/up-dev.sh

When you want to execute a command you may use the running container graphql-blog-api_api_1. E.g.: $ docker exec -it graphql-blog-api_api_1 {npm install|prisma deploy|etc}

Useful commands

  • $ prisma login|token|deploy
  • $ npm run get-schema

Infrastructure

Initially the infrastructure was setup on a custom Linux machine, with all dependency provided by docker services. However, because the prisma docker container is quite memory expensive even when idle, and with this project primary intent being hands on experience; both the prisma and the database docker services were moved to prisma cloud & heroku respectively. As for the node web server, that still lives on premises.

Reference to the initial setup; useful & good learning opportunity for future reference. https://github.com/rdok/graphql-blog.api/blob/v1.0.0/docker/docker-compose.yml