React Native Template Obytes

repository·master·Indexed 26 days ago

https://github.com/obytes/react-native-template-obytes

A 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.

Tokens
23.5K
Snippets
57
Records
146
Agent score
87%

What's inside react-native-template-obytes

  1. Overview of Obytes React Native / Expo Starter Kit

    master
    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).
  2. Overview of Obytes Starter features

    master

    Obytes 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-mmkv for 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.
  3. Overview of React Native Template Obytes

    master

    React 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-mmkv for secure, fast storage.
    • Forms: TanStack Form with Zod validation.
    • Testing: Jest and React Testing Library for unit tests, and Maestro for E2E testing.
  4. Understand the Feature-Oriented Architecture

    master

    The 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 in features/.
    • 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.
  5. Determine if the Obytes starter kit is right for your project

    master

    The 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.

  6. Understand the Starlight project structure

    master

    Starlight projects follow a specific directory structure for content and assets:

    • src/content/docs/: Place your .md or .mdx files 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.
  7. Organize code within a feature folder

    master

    When creating a new feature in features/, follow these conventions to ensure compatibility with Fast Refresh and maintainability:

    • Screens: Must use the -screen.tsx suffix and be placed in the feature root.
    • Components: Place feature-specific components in a components/ subfolder.
    • API: Use a single api.ts file for feature-specific API calls and React Query hooks (avoid using folders for API).
    • State: Use use-*-store.tsx for feature-specific state management (e.g., with Zustand).

    Important: Do not use index.ts barrel exports within feature folders, as this causes issues with React Fast Refresh.

  8. Upgrade non-native (JS-only) dependencies

    master

    For JavaScript-only dependencies, use pnpm to interactively select and update packages.

    Recommended Workflow:

    1. Update devDependencies first using pnpm up -i.
    2. Run pnpm run doctor to revert any devDependencies that are out of sync with your current Expo version.
    3. Run the full verification suite (lint, type-check, test, etc.) to ensure no breaking changes were introduced.
    4. 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