Welcome to the companion app of Odyssey's Voyage II: Federating the Monolith! This is the server
backend of the Airlock app. You can find the course lessons and instructions on Odyssey, Apollo's learning platform.
You can preview the completed demo app here.
You can find the client counterpart here.
The course will walk you through step by step how to turn this monolithic graph into a federated graph. This codebase is the starting point of your journey!
To get started:
In a terminal window, navigate to the monolith
directory.
- Run
npm install
. - Run
npm start
.
This will start the GraphQL API server on http://localhost:4000
Next, let's run some local services.
- In a new terminal window, still in the
monolith
directory, runnpm run launch
. This will run 4 local services, which you can learn about in the accompanying Odyssey course.
After playing around with the data, you may want to reset to its initial state. To do this, run npm run db:reset
.
You can take a peek at what the final version of the code should look like (after completing all the steps in the course).
To run the final
version, navigate to the final/router
directory.
In a new terminal window, run APOLLO_KEY=<APOLLO_KEY> APOLLO_GRAPH_REF=<APOLLO_GRAPH_REF> ./router --config config.yaml
.
Make sure to replace the values for APOLLO_KEY
and APOLLO_GRAPH_REF
(see course content for more details on how to set these up).
This will start the router on http://localhost:4000
Next, let's run the subgraphs we split off according to the course instructions: the monolith subgraph (what's left of it) and the accounts
subgraph.
- In a new terminal window, navigate to the root of the
final/monolith
directory, runnpm start
. - In a new terminal window, navigate to the
final/subgraph-accounts
directory, runnpm install
thennpm start
.
Finally, let's run some local services.
- In a new terminal window, navigate to the
final/monolith
directory, then runnpm run launch
. This will run 4 local services, which you can learn about in the accompanying Odyssey course.
For any issues or problems concerning the course content, please refer to the Odyssey topic in our community forums.