This talk has been presented at React Day Berlin 2023, check out the latest edition of this React Conference.
Video: How Do We Use React Native at Mattermost. Architecture and Design
FAQ
Mattermost is an open-source alternative to Slack and Microsoft Teams. It is a chat application with a mobile app written in React Native.
Daniel Espino-Garcia is a software design engineer at Mattermost who gave a talk about using React Native at Mattermost.
You can contact Daniel Espino-Garcia by dropping by the office at the Mattermost community server.
Mattermost uses React Native for its mobile app because it allows for a single codebase that works on both iOS and Android, and it uses JavaScript, which is consistent with the rest of Mattermost's frontend stack.
Mattermost faced challenges such as support for multi-server, data isolation, and offline support. These challenges led to a complete overhaul of the app with a new architecture and interface.
Mattermost initially used Redux for state management but switched to WatermelonDB to handle large states, offline support, and multi-server scalability. WatermelonDB stores the state in a SQL-like database and uses RxJS for reactivity.
Mattermost uses TypeScript for type safety, organizes components functionally, follows specific coding rules and component order, and uses custom hooks to reduce boilerplate and complexity.
Yes, the Mattermost mobile app is open source, and its complete code is available on GitHub.
Mattermost has implemented custom native features such as EMM for session separation, improved text input handling, custom logging, and id-loaded notifications for push notifications to address data residency concerns.
WatermelonDB is a database solution that stores state in a SQL-like database, allowing for scalable state management without loading the entire state into memory. Mattermost chose it for its scalability, offline support, and multi-server capabilities.
Check out more articles and videos
We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career
Workshops on related topic
Tests rely on many conditions and are considered to be slow and flaky. On the other hand - end-to-end tests can give the greatest confidence that your app is working. And if done right - can become an amazing tool for boosting developer velocity.
Detox is a gray-box end-to-end testing framework for mobile apps. Developed by Wix to solve the problem of slowness and flakiness and used by React Native itself as its E2E testing tool.
Join me on this workshop to learn how to make your mobile end-to-end tests with Detox rock.
Prerequisites- iOS/Android: MacOS Catalina or newer- Android only: Linux- Install before the workshop
Appflow is the cloud mobile DevOps platform built by Ionic. Using a service like Appflow to build React Native apps not only provides access to powerful computing resources, it can simplify the deployment process by providing a centralized environment for managing and distributing your app to multiple platforms. This can save time and resources, enable collaboration, as well as improve the overall reliability and scalability of an app.
In this workshop, you’ll deploy a React Native application for delivery to Android and iOS test devices using Appflow. You’ll also learn the steps for publishing to Google Play and Apple App Stores. No previous experience with deploying native applications is required, and you’ll come away with a deeper understanding of the mobile deployment process and best practices for how to use a cloud mobile DevOps platform to ship quickly at scale.
In this three-hour workshop we’ll address these questions by discussing how to integrate Detox into your development workflow. You’ll walk away with the skills and information you need to make Detox testing a natural and productive part of day-to-day development.
Table of contents:
- Deciding what to test with Detox vs React Native Testing Library vs manual testing- Setting up a fake API layer for testing- Getting Detox running on CI on GitHub Actions for free- Deciding how much of your app to test with Detox: a sliding scale- Fitting Detox into you local development workflow
Prerequisites
- Familiarity with building applications with React Native- Basic experience with Detox- Machine setup: a working React Native CLI development environment including either Xcode or Android Studio
In this workshop you’ll walk through setting up the skeleton for a React Native Web app that works great and looks awesome. You can use the resulting codebase as a foundation to build whatever app you like on top of it, using the React paradigms and many JavaScript libraries you’re used to. You might be surprised how many types of app don’t really require a separate mobile and web codebase!
What's included1. Setting up drawer and stack navigators with React Navigation, including responsiveness2. Configuring React Navigation with URLs3. Setting up React Native Paper including styling the React Navigation drawer and headers4. Setting up a custom color theme that supports dark mode5. Configuring favicons/app icons and metadata6. What to do when you can’t or don’t want to provide the same functionality on web and mobile
Prerequisites- Familiarity with building applications with either React or React Native. You do not need to know both.- Machine setup: Node LTS, Yarn, be able to successfully create and run a new Expo app following the instructions on https://docs.expo.dev/get-started/create-a-new-app/