How fbsamples/f8app works
Project Type and Purpose
• This is a full-stack, cross-platform mobile application (React Native) used as the official F8 conference app.
• Frontend (js/, android/, ios/) implements UI, navigation, state management (Redux), Relay/GraphQL client, and integrates with device services (push, maps).
• Backend (server/) comprises a GraphQL microservice, a Parse Server with cloud code & jobs, and a MongoDB data store (with initial dump in mongorestore/).
File-Structure Analysis
• Top level:
• android/, ios/ — native wrappers for React Native
• js/ — all React Native JavaScript code (UI components, tabs, actions, reducers, Relay environment)
• server/ — three sub-services:
– graphql/ — Node.js GraphQL API
– parse-server/ — Parse Server Cloud Code & triggers
– parse-dashboard/ — admin UI for Parse data
– mongorestore/ — initial MongoDB BSON data dumps
• docker-compose.yml & Dockerfiles — local/dev orchestration
• scripts/ — build, test, and run helpers
• CI config (.circleci/)
• Presence of Relay, GraphQL schemas, Parse cloud functions, and Mongo dumps indicates a micro-service backend with a document store.
a. Main Components
1. Mobile Clients
• iOS (native shell + JS bundle)
• Android (native shell + JS bundle)
• React Native bundle loaded from Metro bundler or embedded
2. Presentation & State Management (on mobile)
• React Components (js/common, js/tabs, js/filter, etc.)
• Redux store (js/store)
• Relay environment (js/relay-environment.js) for GraphQL data fetching
3. Network & API Layer (mobile)
• GraphQL client (Relay)
• REST endpoints (Parse Server REST API for push, login, optional)
4. Backend Services
• GraphQL Service (server/graphql)
• Parse Server (server/parse-server)
• Parse Dashboard (server/parse-dashboard)
• MongoDB (data store)
5. Dev & Ops
• Docker Compose orchestrator
• CI/CD (CircleCI)
• Scripts (build, tests, data import)
b. Relationships & Data Flows
1. Mobile App → GraphQL Service
• Queries & Mutations via Relay over HTTPS
2. GraphQL Service → Parse Server & MongoDB
• Resolves queries by calling Parse SDK or direct Mongo queries
3. Mobile App → Parse Server
• Push notification registration & delivery
• Cloud function invocation (e.g., survey exports)
4. Parse Server → MongoDB
• CRUD operations on conference data, users, schedules
5. Dev Tools
• Docker Compose wires up GraphQL, Parse, Mongo, Dashboard
• CircleCI runs tests (js/__tests__, server tests) and lint/flow checks
6. External Services
• Push (APNs, FCM) via Parse Server
• Analytics (custom F8Analytics.js → remote tracking endpoints)
c. Architectural Patterns & Design Principles
• Frontend: Component-based UI, unidirectional data flow (Redux + Relay).
• Backend: Polyglot microservices (GraphQL + Parse), separation of concerns.
• Shared code: Cloud business logic centralized in Parse Cloud Code.
• DevOps: Infrastructure as code (Dockerfiles, docker-compose.yml), automated pipelines.
d. Key Technologies
• React Native, Redux, Relay/GraphQL (frontend)
• Node.js, Express (assumed), Apollo or graphql-js (GraphQL service)
• Parse Server (cloud code, jobs, triggers)
• MongoDB (document DB)
• Docker, Docker Compose, CircleCI