Boilerplate Project Structure

Naming conventions are used wherever possible. The following tags are used to comprise names of files:

Tag Description
{Entity} Name of entity in the data store, like User, ToDo item, etc.
{Mutation} Indicates type of mutation applied to an entity, like add, delete, update, list_delete, etc.
{Version} Version of the project, as specified in package.json, like 3.1.1.
{Unit} Name of unit, for instance urb-example-compendium.

Below is the list of the main files and folders for this project. Asterisk on the right means link into the repository for quick viewing.

Folder/File Description
android/ Android app project. *
app/ Root for the react-native app. *
configuration/ Configuration code and settings described in Configuration Folder *
graphql/ Holds the elements of the GraphQL schema and data access methods. *
graphql/type/ System types. *
graphql/type/GraphQLDateTime.js GraphQL scalar datetime type. *
graphql/type/MutationType.js Type that includes all the mutations. *
graphql/type/QueryType.js Query type that resolves nodes to entities. *
graphql/type/ViewerType.js Current user and entry point for any information retrieved. *
graphql/CassandraClient.js Promisified Cassandra client. *
graphql/CassandraOptions.js Load and set options for connecting to Cassandra used by client and logger. *
graphql/mutation_helper.js Helper for GraphQL mutations. *
graphql/NodeInterface.js The main node interface. *
graphql/ObjectManagerBase.js Manage objects for GraphQL resolvers using DataLoader and Cassandra or in-memory persistence. *
graphql/ObjectPersisterCassandra.js Persists objects in Cassandra. *
graphql/ObjectPersisterMemory.js Persists objects in memory. *
graphql/schema.js Entry point for the schema, points at the query type and the mutation type. *
graphql/server.js The GraphQL Express server. *
ios/ iOS app project. *
public/ This folder is served as root of the website. *
public/assets/ Assets generated by webpack.
public/assets/{Version}/app.css CSS assets compiled by WebPack. Not much to see.
public/assets/{Version}/app.js All the nice ES5-compliant JavaScript for the SPA.
scripts/build-mui-icon-list.js Rebuilds the list of Materual-UI icons. Modify this file to control how many icons are displayed. *
scripts/build-schema.js Rebuilds the GraphQL schema files. Must be run when the schema is modified. *
scripts/delayPromise.js Returns a promise to execute code after a certain delay. *
scripts/update-local-ip-for-app.js Update the IP setting for mobile development. *
server/ The Node.js server serving isomorphic content, GraphQL, public files and authentication requests. *
server/auth.js Authentication service, verifies user name and password and creates JWT tokens. *
server/credentials_check.js Functions for verifying issued JWT tokens and protecting against CRSF. *
server/log.js Logging functionality using Winston. *
server/server.js Main script. Loads all other servers. *
units/ Units included in application, including all elements of the stack. *
units/{Unit}/ A single unit. See table below for per-unit structure *
webapp/ Root for the entire web application. *
webapp/components/ All the JSX components used by the web app. *
webapp/mui-themes/ Material-UI themes. *
webapp/scripts/ Scripts used by the client. *
webapp/styles/ Styles used by the client. *
webapp/styles/main.css Example style included in the app. Currently not used. *
webapp/client.js Starts the client-side SPA using data generated during server rendering. *
webapp/renderOnServer.ejs Template for the HTML served by the isomorphic server rendered. *
webapp/renderOnServer.js Performs server-side rendering. *
webapp/server.js Server for the web app. *

The structure of each unit is as follows:

Folder/File Description
/ Root of unit at relative path units/{Unit}/ *
/app/ React Native files. *
/graphql/ All files included in the express-graphql server schema. *
/graphql/mutation/ Mutations. *
/graphql/type/ Object types. *
/graphql/type/_ViewerFields.js Fields from this unit to be used in the viewer object.
/graphql/type/*Connection.js Connection between two types.
/graphql/type/*Type.js GraphQL Object Type definition.
/relay/ All Relay client side files shared between React DOM and native. *
/webapp/ React DOM files. *