This project is a distributed system that re-creates some functionality of existing aviation systems.
This project uses Graphql, each service exposes its own set of Graphql Application Programming Interface's (API's), and there is a routing layer that uses Apollo Router for routing to the correct subgraph.
Important
The system uses a federated graph which means that some queries need multiple services to be running. It is recommended to run all of the services when querying the router.
The project runs the router in a Docker container, but the configuration of the router is done in the router.yml file and it uses this supergraph.
The routers use a single federated graph or supergraph which is made from all of the individual services graphs or sub-graphs. The supergraph can be created using the Apollo Rover CLI.
Caution
Before using the router make sure that the supergraph has been created or updated.
Either follow this guide to get started or follow the repository-specific steps below.
- Install rover
You can either use a CLI or npm.
curl -sSL https://rover.apollo.dev/nix/latest | shnpm install -g @apollo/rover- Usage
There are many ways to run an application using rover and some can be found here. This project uses rover to create a supergraph, to configure the creation of the supergraph use the supergraph.yml file. To create the supergraph use this command.
rover supergraph compose --config ./supergraph.yml --output supergraph.graphqlBuf is used to manage Protobuf definitions and generate client and server stubs for our services. Buf is configured in the buf.yml and the code generation is in buf.gen.yml.
Please follow the official instructions to install buf. Then verify it is installed correctly using
buf --version- Linting of proto files
buf lint- Generating code stubs
buf generate --template buf.gen.yaml