Skip to content

Spoke Architecture Overview (WIP)

Shaka Lee edited this page Jul 20, 2017 · 2 revisions

Spoke Overview

Organized by what technology, what that tech is and does in this project and where it is found in the code base

The parts and what they do:

What it is/does in this project

Where you'll find it in the code

React

Frontend

Apollo

Comes in Client and Server flavors. Talks to React and GraphQL. Use to inject responses to GraphQL queries and mutations into React component "data" prop. Caches query results.

See mapMutationsToProps and mapQueriesToProps, gql, component.props.data

GraphQL

Query language created by Facebook. Browse the GraphQL schema at http://localhost:3000/graphql "Mutations" = functions that perform custom create, update, delete operations. "Queries" = read operations. In schema, define types and arguments and map fields to their resolver functions.

. See https://github.com/MoveOnOrg/Spoke/tree/master/src/server/api for schemas and custom function https://github.com/MoveOnOrg/Spoke/blob/master/src/server/api/lib/utils.js#L3 that maps fields from RethinkDB models to GraphQL schemata

RethinkDB

Document-based database. Uses its own query language, ReQL

Thinky

ORM for RethinkDB

https://github.com/MoveOnOrg/Spoke/tree/master/src/server/models

Postgres (post-migration)

Relational database

Knex (post-migration)

ORM

Express

Lightweight Node.js app framework. Backend routing.

https://github.com/MoveOnOrg/Spoke/blob/master/src/server/index.js

Auth0

Authentication API, with Passport middleware

Twilio

Babel

Webpack

npm

(deployment)