Skip to content

mongrov/react-native-template-obytes

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

723 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Mongrov Starter

Enterprise React Native starter template, built on Obytes Template

A production-ready React Native / Expo template with structured logging, Sentry integration, JWT auth scaffolding, API interceptors, and a built-in dev tools screen. Powered by @mongrov/core.

Expo SDK 54 | React Native 0.81 | TypeScript | TailwindCSS | Expo Router | React Query | Zustand

πŸš€ Motivation

Our goal with this starter kit was to streamline the process of building React Native apps, both for our own team and for our clients. We wanted to create a resource that would allow us to create high-quality apps faster and with less effort, while ensuring that all of our projects adhere to the same code standards and architectural principles.

The benefits of using this starter kit are numerous. It helps our team easily switch between projects, as we can rely on a consistent foundation of code. It also allows us to focus on the business logic of each project rather than getting bogged down in boilerplate code. And, because it promotes consistency across projects, it makes it easier to maintain and scale our apps, as well as share code between teams.

Overall, our starter kit is designed to facilitate efficient and effective app development, helping us to bring the best possible products to our clients

✍️ Philosophy

When creating this starter kit, we had several guiding principles in mind::

  • πŸš€ Production-ready: We wanted to ensure that this starter was ready for real-world use, providing a solid foundation for building production-grade apps.
  • πŸ₯· Developer experience and productivity: Our focus was on creating a starter that would enhance the developer experience and increase productivity.
  • 🧩 Minimal code and dependencies: We aimed to keep the codebase and dependencies as small as possible.
  • πŸ’ͺ Well-maintained third-party libraries: We included only well-maintained and reliable third-party libraries, to provide stability and support for our projects.

⭐ Key Features

  • βœ… Latest Expo SDK with Custom Dev Client: Leverage the best of the Expo ecosystem while maintaining full control over your app.
  • πŸŽ‰ TypeScript for enhanced code quality and bug prevention through static type checking.
  • πŸ’… Minimal UI kit built with TailwindCSS, featuring common components essential for your app.
  • βš™οΈ Multi-environment build support (Production, Staging, Development) using Expo configuration.
  • 🦊 Husky for Git Hooks: Automate your git hooks and enforce code standards.
  • πŸ’‘ Clean project structure with Absolute Imports for easier code navigation and management.
  • 🚫 Lint-staged: Run Eslint and TypeScript checks on Git staged files to maintain code quality.
  • πŸ—‚ VSCode recommended extensions, settings, and snippets for an enhanced developer experience.
  • β˜‚οΈ Pre-installed Expo Router with examples for comprehensive app navigation.
  • πŸ’« Auth flow implementation using Zustand for state management and react-native-mmkv for secure data storage.
  • πŸ›  10+ Github Actions workflows for building, releasing, testing, and distributing your app.
  • πŸ”₯ React Query and axios for efficient data fetching and state management.
  • 🧡 Robust form handling with TanStack Form and zod for validation, plus keyboard handling.
  • 🎯 Localization support with i18next, including Eslint for validation.
  • πŸ§ͺ Unit testing setup with Jest and React Testing Library.
  • πŸ” E2E testing capabilities with Maestro for comprehensive app testing.

πŸ”§ Mongrov Additions

This fork includes production-ready modules from @mongrov/core and additional scaffolding for enterprise apps:

Structured Logging (@mongrov/core)

A zero-vendor-lock logging system integrated via LoggingProvider in the root layout:

  • Ring buffer β€” In-memory circular buffer for recent log entries, viewable in the Dev Tools screen.
  • File transport β€” Rolling daily JSONL files via expo-file-system with configurable retention.
  • Webhook transport β€” HTTP batched log shipping with offline queue (persisted via MMKV, exponential backoff).
  • Dev Tools screen β€” Hidden screen accessible by tapping the version number 5 times in Settings, once in __DEV__ mode, or immediately if the user has the dev-tools permission via JWT. Displays filterable log entries with export-to-share functionality.

Configuration is driven by environment variables:

Variable Purpose
EXPO_PUBLIC_LOG_LEVEL Minimum log level (debug, info, warn, error)
EXPO_PUBLIC_LOG_WEBHOOK_URL Webhook endpoint for remote log shipping
EXPO_PUBLIC_LOG_WEBHOOK_HEADERS JSON string of headers for the webhook

Sentry Integration (lib/sentry/)

  • initSentry(dsn) β€” Initializes @sentry/react-native with environment-aware trace sampling.
  • SentryErrorBoundary β€” Wraps the app and reports uncaught errors to Sentry.
  • useSentryScreenTracking() β€” Adds screen-change breadcrumbs via expo-router.
  • Controlled by EXPO_PUBLIC_SENTRY_DSN env var β€” omit to disable entirely.

Auth Scaffolding (lib/auth/)

  • secure-token.ts β€” expo-secure-store wrapper for access/refresh token storage.
  • use-session.ts β€” useSession() hook that decodes the JWT and returns user, tenant, permissions, and a hasPermission() helper.

API Interceptors (lib/api/interceptors/)

  • Auth interceptor β€” Attaches Bearer token, handles 401 with refresh-token retry, signs out on failure.
  • Error transform interceptor β€” Normalizes error shapes into a consistent AppError class.
  • Logging interceptor β€” Logs request/response/error with duration. Automatically wired up in APIProvider which has access to the Logger via LoggingProvider context.

Utility Modules

Module Location Description
Network state lib/network/ Re-exports useNetworkState() from @mongrov/core
App updates lib/updates/ useAppUpdate() hook β€” checks expo-updates on mount
Lifecycle lib/lifecycle/ useAppState() and useOnForeground(callback) hooks
Permissions lib/permissions/ Generic usePermission(requestFn) hook with status/request/openSettings

New Dependencies

Package Purpose
@mongrov/core Structured logging engine
@sentry/react-native Error tracking and performance monitoring
expo-file-system File-based log transport
expo-network Network connectivity monitoring
expo-secure-store Secure token storage
expo-local-authentication Biometric authentication support
expo-updates OTA update checking
jwt-decode JWT token decoding for session management

Expo Go Compatibility

All native module imports (expo-secure-store, @sentry/react-native) use lazy require() with try/catch so the app runs in Expo Go without crashing. When native modules are unavailable:

  • SecureStore falls back to MMKV storage
  • Sentry calls become no-ops (errors still render via react-error-boundary)

For production builds with a custom dev client, all native modules are fully functional.

Is this starter for me?

Yes πŸ˜€

This starter kit is designed to benefit a wide range of React Native developers, from beginners to experienced professionals. Here's why it might be a good fit for you:

  1. For beginners: It provides a solid foundation with best practices and common solutions, helping you learn industry-standard approaches to React Native development.

  2. For experienced developers: It offers a well-structured, production-ready setup that can save you time and effort in project initialization and configuration.

  3. For teams: It ensures consistency across projects and team members, making it easier to onboard new developers and maintain code quality.

  4. For explorers: Even if you prefer not to use starter kits, this project can serve as a valuable reference. You can explore the codebase, documentation, and architectural decisions to gain insights and potentially adopt specific solutions for your projects.

  5. For learners: The starter kit incorporates up-to-date libraries and patterns, allowing you to familiarize yourself with current best practices in the React Native ecosystem.

  6. For AI-assisted development: This starter kit works well with AI coding tools. It provides a solid structure and best practices that can guide AI-generated code. This helps ensure that AI assistance leads to high-quality, maintainable code that fits well within your project.

Remember, you don't have to use the entire starter kit as-is. Feel free to cherry-pick ideas, configurations, or code snippets that align with your project needs. Whether you're building a new app from scratch or looking to improve your existing development process, this starter kit can provide valuable insights and practical solutions.

Why Expo and not React Native CLI?

We have been using Expo as our main framework since the introduction of Continuous Native Generation (CNG) concept and we are happy with the experience.

I think this question is not valid anymore, especially after the last React conference when the core React native team recommended using Expo for new projects.

"As of today, the only recommended community framework for React Native is Expo. Folks at Expo have been investing in the React Native ecosystem since the early days of React Native and as of today, we believe the developer experience offered by Expo is best in class." React native core team

Still hesitating? Check out this article or this video, maybe this one video too.

πŸ§‘β€πŸ’» Stay up to date

We are committed to continually improving our starter kit and providing the best possible resources for building React Native apps. To that end, we regularly add new features and fix any bugs that are discovered.

If you want to stay up to date with the latest developments in our starter kit, you can either watch the repository or hit the "star" button. This will allow you to receive notifications whenever new updates are available.

We value the feedback and contributions of our users, and we encourage you to let us know if you have any suggestions for improving our starter kit. We are always looking for ways to make it even more effective and useful for our community. So, please do not hesitate to reach out and share your thoughts with us.

πŸ’Ž Libraries used

Contributors

This starter is maintained by Obytes mobile tribe team and we welcome new contributors to join us in improving it. If you are interested in getting involved in the project, please don't hesitate to open an issue or submit a pull request.

In addition to maintaining this starter kit, we are also available to work on custom projects and help you build your dream app. If you are looking for experienced and reliable developers to bring your app vision to life, please visit our website at obytes.com/contact to get in touch with us. We would be happy to discuss your project in more detail and explore how we can help you achieve your goals.

πŸ”₯ How to contribute?

Thank you for your interest in contributing to our project. Your involvement is greatly appreciated and we welcome your contributions. Here are some ways you can help us improve this project:

  1. Show your support for the project by giving it a 🌟 on Github. This helps us increase visibility and attract more contributors.
  2. Share your thoughts and ideas with us by opening an issue. If you have any suggestions or feedback about any aspect of the project, we are always eager to hear from you and have a discussion.
  3. If you have any questions about the project, please don't hesitate to ask. Simply open an issue and our team will do our best to provide a helpful and informative response.
  4. If you encounter a bug or typo while using the starter kit or reading the documentation, we would be grateful if you could bring it to our attention. You can open an issue to report the issue, or even better, submit a pull request with a fix.

We value the input and contributions of our community and look forward to working with you to improve this project.

❓ FAQ

If you have any questions about the starter and want answers, please check out the Discussions page.

πŸ”– License

This project is MIT licensed.

About

πŸ“± A template for your next React Native project: Expo, PNPM, TypeScript, TailwindCSS, Husky, EAS, GitHub Actions, Env Vars, expo-router, react-query, react-hook-form.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 88.8%
  • JavaScript 8.7%
  • CSS 2.3%
  • Shell 0.2%