The architecture of a 'React application' should be such that the user interface (written using the React library) is a layer of superficial tissue around a robust Javascript application. This React-layer should be as thin as humanly possible. Keeping this layer thin helps us avoid testing React components. Instead, we write end-to-end tests and rely on QA to ensure that the UI is working.
- dependencies
- query/mutate data as enabled by GraphQL APIs using network-only
urql
clients - store and cache application data (gotten via GraphQL APis) in
RxDB
collections- which expose observable queries using
rxjs
Observables - which can be subscribed to in a React component using
observable-hooks
- which expose observable queries using
- query/mutate data as enabled by GraphQL APIs using network-only
- src
- app
- GraphQL Operations
- services
- db
- util
- rxjs: How to develop
rxjs
operators - rxdb/operators: Operators for transforming RxDocuments to a format usable in a React context
- rxjs: How to develop
- screens
- gql types
- testing
- topics
You'll need
- a
config.json
pointing to some environment (I point todevl
personally) - a
credentials.json
containing an object{username, password}
with valid credentials for that environment.
At that point, you can
yarn
yarn gen
yarn start
yarn test:unit
yarn test:integrations
To run integration tests, you will need to have a credentials file at <repo-root>/test-credentials.json
. This is in the same format described above (in Getting Started). You can also use a <repo-root>/test-config.json
file. In the absense of either of these, the test suite fallsback to <repo-root>/{credentials,config}.json
.
For more info on how and what to test, see the testing doc.
select and create a network-only GraphQL clientuse client to query / mutate data
setup and use an RxDB instancein memorypersistent
organize app as singleton instance, globally importable by appenable configuration of environment (APIs) and credentials, for authenticated use of APIsquery and subscribe to data in RxDB and generate views from these data; use react-router to create ScreensJobListJobContent
demonstrate organization of app components in directory structuresetup integration test bed for application codedemonstrate unit tests of RxJs operatorswrite an integration test for an 'imperative shell' (e.g., 'query and cache a Job')generate RxSchema types from GraphQL schemagenerate TypeScript types from GraphQL schemagenerate test fixture factories from GraphQL schemaimplement throttled batch-get of a given resourcedocument high level components, technologies, with links to resources for further reading- demonstrate a data migration
- authentication as not a strict gate
- demonstrate a view with multiple queries
- document anti-patterns
- generate graphql fragments
add max-batch-size to batch-bufferer- implement knowledgebase search
- add sign-in page, demonstrate app architecture with auth/not auth delineation
- implement model-layer for persistent, offline-first mutations of resources