TypeScript code of this project is a part of me doing a Udemy Course AWS AppSync & Amplify with React & GraphQL - Complete Guide.
Java code of this project is a part of me extending the knowledge on GraphQL and I used this Youtube Playlist to understand Java implementation: Spring Boot GraphQL Tutorial - Full Course. The author has this course on Github.
Docker files are an additional parts that make this repo run smoothly.
To run all docker containers execute docker-compose up --build
comman in the root direcotry. This will run four containers:
- MongoDB that will be accessible on default port
27017
. - Mongo-Express, a web GUI to interact with MongoDB.
- Node App with two GraphQL implementations (on two different URLs).
- A Java Microservice that exposes:
- few REST endpoints,
- the main GraphQL endpoint,
- Playground endpoint
- and Voyager endpoint.
To stop all of these containers run docker-compose down
. And the subsequent start of these containers can be faster if run without --build
option since all of these containers are already built. Execute just docker-compose up
.
First, the easy way, is to open a web page at localhost:8081 which is an exposed Mongo-Express page to mange Mongo database.
Second way is to connect directly to a Mongo DB (e.g. with the VS Code) use the following connection string:
mongodb://mongo_user:[email protected]:27017/graph_ql_db?authSource=admin
The Node App has two URLs. One uses an internal variables (in TypeScript code) to store data. The second URL uses the mentioned Mongo DB to store data. These URLs are:
The Java Microservice has two URLs related to GraphQL. One URL is expose documentation and a place to play with GraphQL queries and mutations. The other URL is to visualize relations between objects. Data are stored in the same Mongo DB as Node App uses.
These are a Spring Boot Microservice endpoints and they can be used either by Postman or via Swagger page avaliable at localhost:
These REST endpoints provides the same functionality as GraphQL endpoint in Java Microservice. Data are stored in the same Mongo DB as GraphQL Java endpoint a d Node App use.