Skip to content

Production-grade, scalable folder structure

Here’s a production-grade, scalable folder structure for building apps with Expo + Bun, designed the way senior teams structure real-world apps (clean, modular, maintainable).


myApp/
β”‚
β”œβ”€β”€ app/ # Expo Router (recommended)
β”‚ β”œβ”€β”€ (auth)/ # Auth group (route grouping)
β”‚ β”‚ β”œβ”€β”€ login.tsx
β”‚ β”‚ β”œβ”€β”€ register.tsx
β”‚ β”‚
β”‚ β”œβ”€β”€ (tabs)/ # Main app tabs
β”‚ β”‚ β”œβ”€β”€ home.tsx
β”‚ β”‚ β”œβ”€β”€ profile.tsx
β”‚ β”‚
β”‚ β”œβ”€β”€ _layout.tsx # Root layout
β”‚ └── index.tsx # Entry route
β”‚
β”œβ”€β”€ src/ # Core app logic
β”‚ β”œβ”€β”€ components/ # Reusable UI components
β”‚ β”‚ β”œβ”€β”€ common/
β”‚ β”‚ β”‚ β”œβ”€β”€ Button.tsx
β”‚ β”‚ β”‚ β”œβ”€β”€ Input.tsx
β”‚ β”‚ β”‚
β”‚ β”‚ β”œβ”€β”€ layout/
β”‚ β”‚ β”‚ β”œβ”€β”€ ScreenWrapper.tsx
β”‚ β”‚ β”‚
β”‚ β”‚ └── index.ts
β”‚ β”‚
β”‚ β”œβ”€β”€ features/ # Feature-based modules (IMPORTANT)
β”‚ β”‚ β”œβ”€β”€ auth/
β”‚ β”‚ β”‚ β”œβ”€β”€ api.ts
β”‚ β”‚ β”‚ β”œβ”€β”€ hooks.ts
β”‚ β”‚ β”‚ β”œβ”€β”€ store.ts
β”‚ β”‚ β”‚ β”œβ”€β”€ types.ts
β”‚ β”‚ β”‚ └── components/
β”‚ β”‚ β”‚
β”‚ β”‚ β”œβ”€β”€ user/
β”‚ β”‚ β”‚ β”œβ”€β”€ api.ts
β”‚ β”‚ β”‚ β”œβ”€β”€ store.ts
β”‚ β”‚ β”‚ └── types.ts
β”‚ β”‚
β”‚ β”œβ”€β”€ services/ # Global services
β”‚ β”‚ β”œβ”€β”€ api/
β”‚ β”‚ β”‚ β”œβ”€β”€ client.ts # Axios/fetch wrapper
β”‚ β”‚ β”‚ β”œβ”€β”€ interceptors.ts
β”‚ β”‚ β”‚
β”‚ β”‚ β”œβ”€β”€ storage/ # AsyncStorage / SecureStore
β”‚ β”‚ β”‚ β”œβ”€β”€ storage.ts
β”‚ β”‚ β”‚
β”‚ β”‚ β”œβ”€β”€ analytics/
β”‚ β”‚ └── notifications/
β”‚ β”‚
β”‚ β”œβ”€β”€ store/ # Global state (Zustand/Redux)
β”‚ β”‚ β”œβ”€β”€ index.ts
β”‚ β”‚
β”‚ β”œβ”€β”€ hooks/ # Shared hooks
β”‚ β”‚ β”œβ”€β”€ useAuth.ts
β”‚ β”‚ β”œβ”€β”€ useDebounce.ts
β”‚ β”‚
β”‚ β”œβ”€β”€ utils/ # Utility functions
β”‚ β”‚ β”œβ”€β”€ helpers.ts
β”‚ β”‚ β”œβ”€β”€ validators.ts
β”‚ β”‚
β”‚ β”œβ”€β”€ constants/ # App constants
β”‚ β”‚ β”œβ”€β”€ colors.ts
β”‚ β”‚ β”œβ”€β”€ config.ts
β”‚ β”‚
β”‚ β”œβ”€β”€ types/ # Global TS types
β”‚ β”‚ β”œβ”€β”€ global.d.ts
β”‚ β”‚
β”‚ └── lib/ # Third-party configs
β”‚ β”œβ”€β”€ react-query.ts
β”‚ β”œβ”€β”€ i18n.ts
β”‚
β”œβ”€β”€ assets/ # Images, fonts, icons
β”‚ β”œβ”€β”€ images/
β”‚ β”œβ”€β”€ fonts/
β”‚
β”œβ”€β”€ config/ # Environment configs
β”‚ β”œβ”€β”€ env.ts
β”‚ β”œβ”€β”€ eas.json
β”‚
β”œβ”€β”€ scripts/ # Automation scripts
β”‚
β”œβ”€β”€ tests/ # Unit & integration tests
β”‚ β”œβ”€β”€ setup.ts
β”‚
β”œβ”€β”€ .env # Environment variables
β”œβ”€β”€ .env.production
β”œβ”€β”€ app.json # Expo config
β”œβ”€β”€ bun.lockb
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

Instead of dumping everything in /components, each feature owns its logic:

features/
auth/
api.ts
store.ts
hooks.ts

πŸ‘‰ This keeps:

  • Logic isolated
  • Easy team collaboration
  • Easier refactoring

Using /app directory:

  • File-based routing (like Next.js)
  • Clean navigation separation
  • Supports layouts & groups

services/api/client.ts

Centralized API handling:

  • Token injection
  • Error handling
  • Retry logic

TypeLocation
Global state/store
Feature-specific/features/*/store.ts

Pair this structure with:

  • State: Zustand (lightweight)
  • API: React Query (TanStack Query)
  • Styling: NativeWind (Tailwind for RN)
  • Forms: React Hook Form + Zod
  • Navigation: Expo Router
  • Storage: SecureStore + MMKV

Use path aliases in tsconfig.json:

{
"compilerOptions": {
"paths": {
"@/*": ["src/*"]
}
}
}

Then:

import { Button } from '@/components/common/Button';
import { useAuth } from '@/features/auth/hooks';

  • Fast installs: bun install
  • Script running: bun run dev
  • CLI usage: bunx expo start

❌ Putting everything in /components ❌ Mixing API logic inside UI ❌ No feature separation ❌ Hardcoding configs instead of /config/env.ts ❌ Not using aliases β†’ messy imports


As your app grows, evolve into domain-driven structure:

features/
payments/
chat/
notifications/

Each becomes almost like a mini app.


If you want next level, I can give you:

  • πŸ”₯ Full starter repo template (copy-paste ready)
  • βš™οΈ Setup with NativeWind + Zustand + React Query
  • 🧠 Enterprise patterns (offline sync, caching, error boundaries, logging)