React Native Template Obytes
repository·master·Indexed 26 days ago
https://github.com/obytes/react-native-template-obytesA production-ready Expo and React Native starter kit designed for high-performance mobile app development. It features a pre-configured stack including Expo Router, NativeWind (TailwindCSS), Zustand, React Query, Axios, and Zod. The template emphasizes architectural consistency and developer experience, utilizing a custom dev client and providing a CLI tool, create-obytes-app, for project scaffolding.
What's inside react-native-template-obytes
- The Obytes Starter Kit is a production-ready Expo/React Native foundation designed to streamline app development. It focuses on high-quality code standards, architectural consistency, and developer productivity. It is built using the latest Expo SDK with support for Custom Dev Clients and multi-environment builds (Production, Preview, Development).
Overview of Obytes Starter features
masterObytes Starter is an all-in-one React Native/Expo starter kit designed for building high-quality mobile applications. Key features include:
- Core Frameworks: Uses the latest Expo SDK, Expo Router for navigation, and a custom development client for full package control.
- Styling & UI: Includes a minimal UI kit built with Tailwind CSS.
- State & Data Management: Uses Zustand for state management, React Query and Axios for data fetching/caching, and
react-native-mmkvfor fast, secure storage. - Forms & Validation: Implements React Hook Form for management and Zod for schema validation.
- Code Quality: Pre-configured with TypeScript, ESLint, Prettier, and Husky for consistent code style.
- Testing: Full setup for Unit tests (Jest + React Testing Library) and End-to-End (E2E) tests (Maestro).
- DevOps & CI/CD: Over 10 GitHub workflows for type checks, linting, formatting, versioning, and EAS Build.
- Environment Management: Supports multiple app environments with Zod-validated environment variables.
- Developer Experience: Includes VSCode settings, extensions, and snippets for React Query and other workflows.
Overview of React Native Template Obytes
masterReact Native Template Obytes is a production-ready Expo starter kit designed for high-performance mobile application development. It prioritizes developer experience and follows strict architectural principles to ensure consistency and scalability.
Key technical pillars include:
- Framework: Expo with Custom Dev Client support.
- Language: TypeScript for static type checking.
- Styling: TailwindCSS via NativeWind.
- Navigation: Expo Router.
- State Management: Zustand for global state and React Query for server state.
- Data Persistence:
react-native-mmkvfor secure, fast storage. - Forms: TanStack Form with Zod validation.
- Testing: Jest and React Testing Library for unit tests, and Maestro for E2E testing.
Understand the Feature-Oriented Architecture
masterThe project uses a feature-oriented architecture where each feature is a self-contained module. This promotes isolation, scalability, and maintainability by keeping related code (screens, components, API, and state) in one place.
Key Folder Roles
features/: Contains all feature-specific code. Each feature folder should contain its own screens, components, and logic.app/: Contains the Expo Router file-based routing structure. These files act as thin re-export layers for screens defined infeatures/.components/ui/: The design system. Contains reusable UI primitives (Button, Input, etc.) and shared utilities. Promote components here only if they are used in 2+ features and have no feature-specific logic.lib/: Core infrastructure and cross-cutting concerns like the shared API client, authentication utilities, global hooks, and internationalization.translations/: Centralized i18n resource files.
Determine if the Obytes starter kit is right for your project
masterThe Obytes starter kit is designed for various developer profiles:
- Beginners: Provides a foundation of best practices and industry-standard solutions.
- Experienced Developers: Offers a production-ready setup to accelerate project initialization.
- Teams: Ensures architectural consistency and easier onboarding.
- Explorers/Learners: Serves as a reference for modern React Native libraries and patterns.
- AI-assisted Development: The structured codebase and best practices help guide AI coding tools to generate high-quality, maintainable code.
You are not required to use the entire kit; you can cherry-pick specific configurations, ideas, or code snippets that suit your needs.
Understand the Starlight project structure
masterStarlight projects follow a specific directory structure for content and assets:
src/content/docs/: Place your.mdor.mdxfiles here. Each file is automatically exposed as a route based on its filename.src/assets/: Store images here to be embedded in Markdown using relative links.public/: Store static assets like favicons.astro.config.mjs: The main configuration file for Astro.src/content/config.ts: Configuration for content collections.
TypeScript support for translation keys
masterThe translation function is strictly typed. This provides auto-completion for available translation keys and throws TypeScript errors if you attempt to use a key that does not exist in your resource files.Understand the choice of Expo over React Native CLI
masterThis starter kit uses Expo as its main framework. This decision is based on the adoption of Continuous Native Generation (CNG) and follows the recommendation from the React Native core team, which suggests using Expo for new projects due to its best-in-class developer experience.Use Radio and Switch components
masterThe project providesRadioandSwitchcomponents that share the same underlying logic and structure as theCheckbox. They are designed to handle boolean values and useMotiViewfor icon animations based on their checked state. They are highly customizable via props similar to theCheckboxcomponent.Organize code within a feature folder
masterWhen creating a new feature in
features/, follow these conventions to ensure compatibility with Fast Refresh and maintainability:- Screens: Must use the
-screen.tsxsuffix and be placed in the feature root. - Components: Place feature-specific components in a
components/subfolder. - API: Use a single
api.tsfile for feature-specific API calls and React Query hooks (avoid using folders for API). - State: Use
use-*-store.tsxfor feature-specific state management (e.g., with Zustand).
Important: Do not use
index.tsbarrel exports within feature folders, as this causes issues with React Fast Refresh.- Screens: Must use the
Implement Dark Mode using the dark: variant
masterDark mode support is built-in via Tailwind'sdark:variant. To apply different styles for dark mode, prefix your utility classes withdark:. This is the preferred method over manually checking the color scheme.Upgrade non-native (JS-only) dependencies
masterFor JavaScript-only dependencies, use
pnpmto interactively select and update packages.Recommended Workflow:
- Update
devDependenciesfirst usingpnpm up -i. - Run
pnpm run doctorto revert anydevDependenciesthat are out of sync with your current Expo version. - Run the full verification suite (lint, type-check, test, etc.) to ensure no breaking changes were introduced.
- If stable, proceed to update the remaining production dependencies.
pnpm up -i # After updating devDependencies: pnpm run doctor # Then run verification suite rm -rf node_modules pnpm install pnpm lint pnpm type-check pnpm test pnpm prebuild --clean pnpm ios pnpm android pnpm start -c- Update