
Expo Project Structure
FreeKickstart your new Expo app with a structured layout.
Free · Opens the source repo
What Expo Project Structure does
The Expo Project Structure skill provides a predefined folder layout for new Expo applications, guiding developers in organizing their project files effectively. This skill is specifically designed for projects that are being created from scratch, ensuring that the necessary components and files are structured logically from the outset. It emphasizes the separation of concerns, allowing developers to maintain a clean and scalable codebase as their application grows.
When using this skill, the recommended structure includes dedicated folders for assets, scripts, and source code, with a clear distinction between app routes, reusable components, screens, and server code. For instance, all API routes are organized under src/app/api/, while UI components are placed in src/components/. This organization not only aids in navigation but also enforces best practices, such as colocating styles and tests with their respective components.
The skill also highlights the importance of platform-specific code management, allowing developers to create components that can adapt to different environments without cluttering the main codebase. By following the conventions laid out in this skill, developers can ensure that their Expo applications are built on a solid foundation, making future development and maintenance more straightforward.
This skill is particularly useful for developers who are new to Expo or those who want to adhere to recommended practices without having to think through the initial structure themselves. It serves as a practical starting point, enabling users to focus on building features rather than organizing files.
When to use it
Use this skill when you are creating a new Expo application and need a structured layout to follow.
When not to use it
Do not use this skill for existing projects that already have a defined folder structure.
What you can build with it
Starting a New Expo App
Use this skill when you need a clear and organized folder structure for your new Expo application.
Following Best Practices
Apply this skill to ensure your project adheres to recommended practices for file organization in Expo.
Simplifying Project Setup
Leverage this skill to quickly scaffold a new Expo project without worrying about layout decisions.
How to install Expo Project Structure
View source1. Install with the skills CLI
npx skills add expo/skills/expo-project-structure --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by expoExpo Project Structure
A starting skeleton for a new Expo app — one with no committed folder structure yet.
Apply only to new projects. If the app already has a layout, follow its existing conventions and leave files where they are — a default to start from, never a standard to enforce or migrate toward. When unsure whether a project is new, ask before moving anything.
The whole layout, assembled from the rules below:
├── assets/
├── scripts/
├── src/
│ ├── app/ # Expo Router routes ONLY — every file is a route
│ │ ├── api/ # server API routes, grouped here
│ │ │ ├── user+api.ts
│ │ │ └── settings+api.ts
│ │ ├── _layout.tsx
│ │ ├── _layout.web.tsx # platform-specific layout
│ │ ├── index.tsx
│ │ └── settings.tsx
│ ├── components/ # reusable UI: button, card, table…
│ │ ├── table/ # complex component → folder + index.tsx
│ │ │ ├── cell.tsx
│ │ │ └── index.tsx
│ │ ├── bar-chart.tsx
│ │ ├── bar-chart.web.tsx # platform-specific variant
│ │ └── button.tsx
│ ├── screens/ # screen bodies that route files render
│ │ ├── home/
│ │ │ ├── card.tsx # used only by Home — not shared
│ │ │ └── index.tsx # rendered by src/app/index.tsx
│ │ └── settings.tsx
│ ├── server/ # server-only helpers used by app/api
│ │ ├── auth.ts
│ │ └── db.ts
│ ├── utils/ # standalone helpers + colocated tests
│ │ ├── format-date.ts
│ │ └── format-date.test.ts
│ ├── hooks/ # reusable hooks: use-theme.ts…
│ ├── constants.ts
│ └── theme.ts
├── app.json
├── eas.json
└── package.json
src/ and src/app
Keep app code under src/ to separate it from config files. Expo Router supports both app/ and src/app/ out of the box — to switch, move the folder and restart the bundler. The default template aliases @/* to ./src/* in tsconfig.json.
src/app is routes-only: every file there becomes a route, so nothing else belongs in it. Everything below lives in sibling folders.
components/ — reusable UI
Generic, reused UI (button, card, table) with one named export each. Name files in kebab-case (bar-chart.tsx), matching the default create-expo-app template. When a component grows, give it its own folder with the root in index.tsx and colocate its private sub-components beside it — the import path (@/components/table) stays unchanged.
screens/ — screen bodies
Because app/ files must be routes, complex screen UI that isn't reused has no home there. Once a screen grows big enough to need breaking out to separate components, put it in screens/ and let each route just render its screen:
import { Home } from "@/screens/home";
export default function HomeScreen() {
// route-specific concerns only — e.g. read url params here
return <Home />;
}
Colocate a screen's private components inside its folder (screens/home/components/). A bonus: the same screen can render under multiple routes.
server/ + app/api/ — separate server code
Appending +api to a file in app/ makes it a server API route. Server code is different from frontend code — it runs in a Node-like server environment (deployed with EAS Hosting or on third-party services) and can read secret env vars (process.env.X, not just EXPO_PUBLIC_*). Keep it apart:
- Group all routes under
app/api/→/api/user,/api/settings. This colocates them and avoids collisions (e.g. a/userscreen and a/userroute). - Put shared server-only helpers in
src/server/. - Consider ESLint rules that fence
+apifiles andserver/off from frontend-only checks.
Platform-specific code
Small differences: use Platform.select / Platform.OS. For larger ones, split into platform files instead of inline if/else — bar-chart.tsx + bar-chart.web.tsx, imported extension-free (@/components/bar-chart); Metro picks the right file per target.
- Props must be identical across variants.
- A default file (no platform extension) is always required — make it a no-op if the component is single-platform.
- Supported extensions:
.ios,.android,.native,.web.
Colocate styles and tests
- Styles: keep the
StyleSheet.create({ ... })object at the bottom of the component file rather than in a separate.stylesfile. - Tests: put
format-date.test.tsnext toformat-date.ts(preferred over a separate__tests__/folder) so tested files are obvious at a glance.
AI and config files
Agent instructions live at the repo root — AGENTS.md / CLAUDE.md, with project skills under .claude/. Other config and assets stay outside src/: app.json / app.config.ts, eas.json, package.json, assets/, and scripts/.
Based on Expo app folder structure best practices by Kadi Kraman. For src/ precedence and alias mechanics, see the Expo docs.
Submitting Feedback
If you encounter errors, misleading or outdated information in this skill, report it so Expo can improve:
npx --yes submit-expo-feedback@latest --category skills --subject "expo-project-structure" "<actionable feedback>"
Only submit when you have something specific and actionable to report. Include as much relevant context as possible. If an AI agent repeatedly failed or the user had to take over an Expo task, load the expo-skill-feedback skill and follow its eval-candidate flow instead of reusing the command above.
Frequently asked questions about Expo Project Structure
Similar skills
Playwright Component Testing
Test React and Vue components in isolation with Playwright.
Fluent UI Blazor
Integrate Fluent UI components in Blazor applications effortlessly.
Build MCP App
Create interactive UI widgets for MCP servers.
Web Design Reviewer
Identify and fix design issues in websites efficiently.
Markstream Install
Seamlessly integrate Markstream for Markdown rendering.
GSAP & Framer Scroll Animation
Create advanced scroll animations effortlessly.
