Every rebar application consists of units. All units are stored in the
units/ directory. The reserved prefixes for units are:
urb-- Universal Relay Boilerplate Unit.
rb-- Rebar Unit.
cf-- Reserved for Code Foundries.
The postfixes of the names of the units are:
-app- Functionality for a React Native client.
-client- Scripts shared between the React Native and React Web clients.
-server- Functionality for the server.
-tools- Miscellaneous tools to support development.
-universal- Scripts shared between both React Web and React Native clients and the server.
-webapp- Functionality for a React Web client.
Prefixes are important and have to be specified correctly. No other prefixes can be used.
_configuration directory is also available in the units directory and contains project-specific assets used to configure the units.
One single unit of functionality can be broken out into multiple units depending on where the code is executed. For example, the
Inscriptio example contains the following units:
urb-example-inscriptio-app- react native client.
urb-example-inscriptio-client- client side functionality shared between native and web - relay mutations.
urb-example-inscriptio-server- server code with GraphQL definitions and functionality.
urb-example-inscriptio-webapp- react web client.
The following files have special meaning:
package.part.json- contains parts of
package.jsonthat will be inserted when it is rebuilt by
A server unit has postfix
-server and contains code executed on the server. Special files and directories:
serverXYZ.js- contains a Express server to perform the unit functionality. Most server units will not need this, since GraphQL is the primary mode of communication between the server and the client.
graphql/- contains all GraphQL definitions and functionality on the server.
graphql/model- contains the persistence models and GraphQL classes used for all Object Types defined in the unit.
graphql/mutation- contains all GraphQL mutations.
type/- Contains object types and connections defined in the unit.
type/ViewerFields- Exports fields that will be included in the
Viewerobject from this unit.
A client unit has postfix
-client and contains code executed both in the web client and the react native client. Special files and directories:
relay/- Contains client side relay mutation definitions.
A web client unit has postfix
-webapp and contains code executed within the web client. Special files and directories:
routeAppFrame<name>.jsx- Contains route that will be inserted into the
AppFrameroute of the web app router.
components/- Contains all components that are used by the unit.