Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit f880be8

Browse files
committed
Add breadcrumbs
1 parent fda4eac commit f880be8

23 files changed

+57
-11
lines changed

docs/admin/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../readme.md)
2+
13
# Admin
24

35
This directory runs an internal application for viewing core metrics on the platform. While it can be built and run locally, we don't encourage contributors to spend much time here as the dashboard itself will only ever be used internally by the Spectrum team. The code can of course be reviewed for those interested to see what kind of numbers and tools are accessible to our team.

docs/api/graphql/fragments.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../../readme.md) / [API](../intro.md) / [GraphQL](./intro.md)
2+
13
# Fragments
24

35
Fragments help us to always know exactly what kind of data will be returned for a given query and ensure that we are consistent in what data should be returned to any given component.

docs/api/graphql/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../../readme.md) / [API](../intro.md)
2+
13
# GraphQL Intro
24

35
We use [`graphql-tools`](http://dev.apollodata.com/tools/graphql-tools/index.html) which lets us use the GraphQL schema language to design our schema. This schema written in the schema language is then combined with our resolvers (which live somewhere else) using `graphql-tools`, which outputs our finished schema that's then used.

docs/api/graphql/pagination.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../../readme.md) / [API](../intro.md) / [GraphQL](./intro.md)
2+
13
# Pagination with GraphQL
24

35
Even though there is no specific built-in way to paginate GraphQL queries there is a quasi-standard that most people (including us) follow called [Relay Connections Specification](https://facebook.github.io/relay/graphql/connections.htm). Rather than reading a spec that might not help you in pratical applications we recommend reading these two article to get a grasp of the why and how:

docs/api/graphql/testing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../../readme.md) / [API](../intro.md) / [GraphQL](./intro.md)
2+
13
# Testing
24

35
We use [Jest](https://facebook.github.io/jest/) for testing. (we recommend reading through the documentation, since it has a lot of great features you might not expect) Most of our tests are "e2e". That's in quotes because with GraphQL "e2e" tests don't do any network request, they still hit our database though and all that. (which is awesome since it's much faster!)

docs/api/graphql/tips-and-tricks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../../readme.md) / [API](../intro.md) / [GraphQL](./intro.md)
2+
13
# Tips and Tricks
24

35
## Keep resolvers as small as possible

docs/api/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../readme.md)
2+
13
# API
24

35
The Spectrum API is a Node.js web server based on Express.js and GraphQL. It's also houses a websocket server for all of our subscription needs.

docs/deployments.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Deployment
1+
[Table of contents](./readme.md)
2+
3+
# Deployments
24

35
We use [`now`](https://now.sh) by Zeit for all of our deployments.
46

5-
## Installation
7+
### Installation
68

79
We recommend installing the [now desktop app](http://zeit.co/download) as it'll keep the command line tool up to date automatically!
810

@@ -12,11 +14,11 @@ If you'd rather not install an app (or are using Windows Substem for Linux) you
1214
npm install -g now
1315
```
1416

15-
## Naming scheme
17+
### Naming scheme
1618

1719
All our workers are aliased to `<workername>.workers.spectrum.chat`, with the one exception being the API (the API server) which runs at `api.spectrum.chat`.
1820

19-
### Path aliases
21+
#### Path aliases
2022

2123
[Now's path alias feature](https://zeit.co/docs/features/path-aliases) takes care of routing requests to the right workers. To see our current production aliases check the `rules.json` file in the root of the project.
2224

@@ -28,11 +30,11 @@ now alias spectrum.chat -r rules.json
2830

2931
The same command with a different URL and slightly adapted rules can also be used to create an alpha/beta/staging/... version of the site.
3032

31-
## Frontend and Hyperion
33+
### Frontend and Hyperion
3234

3335
Since the frontend is the part that changes the most often the repo is set up such that typing `now` in the root directory will deploy the frontend with hyperion. (the server-side rendering worker)
3436

35-
### Deploying
37+
#### Deploying
3638

3739
First, make sure you're in the Space Program `now` team:
3840

@@ -60,11 +62,11 @@ now alias spectrum-grtertb34.now.sh hyperion.workers.spectrum.chat
6062

6163
And that's it, you've now deployed a new version of hyperion and the frontend!
6264

63-
## Other workers
65+
### Other workers
6466

6567
We use [`backpack`](https://github.com/palmerhq/backpack) to get a nice development setup and build process in place for our workers. Since this is a mono-repo and `now` doesn't have any special functionality to handle monorepos we have to deploy the _built_ version of the workers. (compared to the frontend deploy where you deploy the raw code which gets built on the server)
6668

67-
### Deploying
69+
#### Deploying
6870

6971
First, build the worker you want to deploy to get a bundle with the newest code rather than deploying a stale version:
7072

@@ -91,7 +93,7 @@ now build-athena
9193

9294
This will give you an immutable deploy with a unique URL of this worker, something like `https://build-athena-ahsgut23sdyf.now.sh`.
9395

94-
### Replacing the old deploy
96+
#### Replacing the old deploy
9597

9698
Since we want to keep the workers alive even if nobody sends a request to their healthcheck endpoints we alias them to `<workername>.workers.spectrum.chat`. This ensures `now` overrides the older deploy and only the newest code is running.
9799

docs/hyperion (server side rendering)/development.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../readme.md) / [Hyperion](./intro.md)
2+
13
# Hyperion development
24

35
### Normal development workflow

docs/hyperion (server side rendering)/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../readme.md)
2+
13
# Hyperion
24

35
*Hyperion: (/haɪˈpɪəriən/) is one of the twelve Titan children of Gaia and Uranus.*

docs/operations/deleting-users.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../readme.md)
2+
13
# Deleting users
24

35
Occassionally people request that their account gets deleted on Spectrum. We have a safe way to do this so that it respects the integrity of data across the rest of the database.

docs/operations/importing-rethinkdb-backup.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../readme.md)
2+
13
# Importing production data locally
24

35
Sometimes it's useful to have production data running locally in rethinkdb for debugging and testing. To get production data running locally, follow these steps:

docs/testing/integration.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../readme.md) / [Testing](./intro.md)
2+
13
# Integration tests
24

35
We use [Cypress](https://cypress.io) to run our integration tests, which gives you a nice GUI that you can use for your test runs. To run integration tests you have to have both api and the client running. You also need API to be connected to the test database, which you do by setting `TEST_DB`:
@@ -40,7 +42,7 @@ Note that while the Cypress API looks synchronous, it's actually totally asynchr
4042

4143
Also note that Cypress uses Mocha under the hood, where our unit tests use Jest. This means rather than `expect().toEqual()` you'd have to write `expect().to.equal()` due to the syntax difference between the `expect` implementations.
4244

43-
#### Test IDs
45+
### Test IDs
4446

4547
To verify that certain elements are or aren't on the page we use custom `data-cy` attributes. You render them from React like so:
4648

docs/testing/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../readme.md)
2+
13
# Testing
24

35
We have a test suite consisting of a bunch of unit tests (mostly for the API) and integration tests to verify Spectrum keeps working as expected. The entire test suite is run in CI for every commit and PR, so if you introduce a breaking change the CI will fail and the PR will not be merge-able.

docs/testing/unit.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
## Unit tests
1+
[Table of contents](../readme.md) / [Testing](./intro.md)
2+
3+
# Unit tests
24

35
We use [`Jest`](https://github.com/facebook/jest) for our unit testing needs. To run Jest in watch mode locally so the tests run automatically while you're developing run:
46

docs/workers/athena/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../../readme.md) / [Workers](../intro.md)
2+
13
# Athena
24

35
*Athena (/əˈθiːnə/) is the goddess of wisdom, craft, and war.*

docs/workers/background-jobs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../readme.md) / [Workers](intro.md)
2+
13
# Background jobs
24

35
We use [`bull`](https://github.com/OptimalBits/bull) for all of our background job needs. (at the moment that mostly means notification processing and emails) `bull` uses redis under the hood (see docs/setup.md for instructions on how to install redis) to store information about these jobs.

docs/workers/chronos/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../../readme.md) / [Workers](../intro.md)
2+
13
# Chronos
24

35
*Chronos (/ˈkroʊnɒs/) is the personification of Time in pre-Socratic philosophy*

docs/workers/hermes/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../../readme.md) / [Workers](../intro.md)
2+
13
# Hermes
24

35
*Hermes (/ˈhɜːrmiːz/) is the messenger god, moving between the worlds of the mortal and the divine.*

docs/workers/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../readme.md)
2+
13
# Workers
24

35
Our asynchronos background job processing is powered by a series of worker servers.

docs/workers/mercury/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../../readme.md) / [Workers](../intro.md)
2+
13
# Mercury
24

35
*HMercury (/ˈmɜːrkjʊri/) is the patron god of financial gain, commerce, eloquence (and thus poetry), messages/communication (including divination), travelers, boundaries, luck, trickery and thieves*

docs/workers/pluto/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../../readme.md) / [Workers](../intro.md)
2+
13
# Pluto
24

35
*Pluto was the ruler of the underworld in classical mythology*

docs/workers/vulcan/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[Table of contents](../../readme.md) / [Workers](../intro.md)
2+
13
# Vulcan
24

35
*Vulcan is the god of fire, including the fire of volcanoes, metalworking, and the forge.*

0 commit comments

Comments
 (0)