🎉 Creating Your First Project
From zero to running app in under 5 minutes
🎯 Learning Objectives
By the end of this lesson, you will have:
- Created a new Expo project using the CLI
- Understood the project folder structure
- Started the development server
- Run your app on Expo Go, simulator, or emulator
- Made your first code change and seen hot reload in action
⏱️ Estimated Time: 20-30 minutes
📑 In This Lesson
Creating the Project
Let's create your first React Native app! With Expo, this takes just one command. Open your terminal and navigate to where you want to create your project (e.g., your projects folder).
Step 1: Run the Create Command
# Navigate to your projects directory
cd ~/projects # or wherever you keep your code
# Create a new Expo project
npx create-expo-app@latest my-first-app
# Move into the project directory
cd my-first-app
The npx create-expo-app@latest command:
- Downloads the latest Expo project template
- Creates a new folder with your project name
- Installs all necessary dependencies
- Sets up TypeScript configuration
💡 Template Options
By default, you get a blank TypeScript template. You can also choose other templates:
# Blank template (default)
npx create-expo-app@latest my-app
# With specific template
npx create-expo-app@latest my-app --template blank-typescript
npx create-expo-app@latest my-app --template tabs # Tab navigation starter
What You'll See
The CLI will show progress as it creates your project:
✔ Downloaded and extracted project files.
> Installing dependencies...
✔ Installed dependencies.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd my-first-app
- npm run android
- npm run ios
- npm run web
✅ Success!
If you see the "Your project is ready!" message, you've successfully created your first React Native project! 🎉
Understanding the Project Structure
Let's explore what was created. Open the project in VS Code:
# Open in VS Code
code .
You'll see a folder structure like this:
The default Expo project structure with Expo Router
Key Files Explained
| File/Folder | Purpose |
|---|---|
app/ |
Your screens. Each file becomes a route (Expo Router) |
app/_layout.tsx |
Root layout — wraps all screens |
app/index.tsx |
Home screen (route: /) |
components/ |
Reusable UI components |
assets/ |
Static files: images, fonts, etc. |
app.json |
App configuration (name, icon, splash, etc.) |
package.json |
Dependencies and npm scripts |
📖 The app/ Folder is Special
With Expo Router, the app/ folder uses file-based routing — just like Next.js! Each file automatically becomes a route:
app/index.tsx→/(home)app/about.tsx→/aboutapp/settings/index.tsx→/settingsapp/user/[id].tsx→/user/123(dynamic)
Running Your App
Time for the exciting part — let's see your app running! Start the development server:
# Start the development server
npx expo start
You'll see output like this:
Starting project at /Users/you/projects/my-first-app
Starting Metro Bundler
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █▀▄▀▄█ ▄█ ▄▄▄▄▄ █
█ █ █ █▀▄ ▀ ▄▄█ █ █ █
█ █▄▄▄█ █ ▄▀▀▀▄ █ █▄▄▄█ █
█▄▄▄▄▄▄▄█ ▀▄▀ ▀▄█▄▄▄▄▄▄▄█
(QR Code)
› Metro waiting on exp://192.168.1.100:8081
› Scan the QR code above with Expo Go (Android) or the Camera app (iOS)
› Using Expo Go
› Press s │ switch to development build
› Press a │ open Android
› Press i │ open iOS simulator
› Press w │ open web
› Press j │ open debugger
› Press r │ reload app
› Press m │ toggle menu
› Press o │ open project code in your editor
› Press ? │ show all commands
Option 1: Run on Your Phone (Expo Go)
- Open Expo Go on your phone
- Android: Tap "Scan QR code" and scan the terminal QR code
- iOS: Open your Camera app, point at the QR code, tap the notification
- Wait for the bundle to load...
- 🎉 Your app is running!
⚠️ Connection Issues?
If your phone can't connect:
- Ensure phone and computer are on the same WiFi network
- Try pressing
sto switch to tunnel mode - Or run
npx expo start --tunnel
Option 2: Run on iOS Simulator (Mac Only)
# With server running, press 'i'
# Or run directly:
npx expo start --ios
This will:
- Open the iOS Simulator (if not already open)
- Install Expo Go on the simulator
- Launch your app
Option 3: Run on Android Emulator
# First, start your Android emulator from Android Studio
# Then, with server running, press 'a'
# Or run directly:
npx expo start --android
This will:
- Detect the running emulator
- Install Expo Go on the emulator
- Launch your app
What You Should See
Your first app running — it's not much, but it's yours!
✅ You Did It!
If you see an app running on your device or simulator, congratulations! You've just run your first React Native app. Take a moment to appreciate this — you're now a mobile app developer! 🎉
Your First Code Change
Now let's experience the magic of hot reloading. Open app/index.tsx in VS Code:
import { Text, View } from "react-native";
export default function Index() {
return (
<View
style={{
flex: 1,
justifyContent: "center",
alignItems: "center",
}}
>
<Text>Edit app/index.tsx to edit this screen.</Text>
</View>
);
}
Make a Change
Let's modify this to make it your own. Change the file to:
import { Text, View, StyleSheet } from "react-native";
export default function Index() {
return (
<View style={styles.container}>
<Text style={styles.title}>🚀 Hello, React Native!</Text>
<Text style={styles.subtitle}>My first app is running!</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#f0f4f8",
},
title: {
fontSize: 28,
fontWeight: "bold",
color: "#1a365d",
marginBottom: 10,
},
subtitle: {
fontSize: 16,
color: "#4a5568",
},
});
Save and Watch
- Save the file (
Ctrl/Cmd + S) - Look at your app...
- ✨ It updated instantly!
sequenceDiagram
participant You as 👨💻 You
participant Code as 📁 Code
participant Metro as ⚡ Metro
participant App as 📱 App
You->>Code: Save file
Code->>Metro: File changed!
Metro->>Metro: Bundle changes
Metro->>App: Send update
App->>App: Hot reload
Note over App: UI updates instantly!
Note over You,App: Total time: ~100-500ms
Hot reloading keeps your app running while applying code changes
⚡ The Power of Hot Reloading
Unlike traditional native development where rebuilding takes minutes, React Native updates your app in milliseconds. This tight feedback loop is one of the biggest productivity advantages of React Native.
Try More Changes
Experiment! Try these modifications and watch them update live:
// Change the background color
backgroundColor: "#1a365d", // Dark blue
// Change the text color
color: "#fff", // White text
// Add more text
<Text style={styles.subtitle}>Built with Expo 🎯</Text>
<Text style={styles.subtitle}>Running on {Platform.OS}</Text>
// (Add this import at the top)
import { Text, View, StyleSheet, Platform } from "react-native";
Understanding app.json
The app.json file is your app's configuration. It controls things like the app name, icon, splash screen, and more. Let's look at it:
{
"expo": {
"name": "my-first-app",
"slug": "my-first-app",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"splash": {
"image": "./assets/images/splash-icon.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"web": {
"bundler": "metro",
"output": "static",
"favicon": "./assets/images/favicon.png"
},
"plugins": [
"expo-router"
],
"experiments": {
"typedRoutes": true
}
}
}
Key Configuration Options
| Property | What It Does |
|---|---|
name |
Display name of your app |
slug |
URL-friendly identifier (used by Expo services) |
version |
Your app version (semver) |
icon |
App icon (1024x1024 PNG recommended) |
splash |
Splash screen shown while app loads |
orientation |
portrait, landscape, or default |
newArchEnabled |
Enable React Native New Architecture |
plugins |
Expo config plugins to enable features |
💡 Try Changing the Name
Change "name": "my-first-app" to your own app name. Restart the server (Ctrl+C, then npx expo start) to see the change in Expo Go's recent projects list.
Platform-Specific Configuration
Notice the ios and android sections? These let you configure platform-specific settings:
{
"expo": {
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.yourcompany.yourapp"
},
"android": {
"package": "com.yourcompany.yourapp",
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
}
}
}
Summary
🎉 What You Accomplished
- ✅ Created your first Expo project with
npx create-expo-app - ✅ Explored and understood the project structure
- ✅ Started the Metro development server
- ✅ Ran your app on a device or simulator
- ✅ Made your first code change and experienced hot reloading
- ✅ Learned about
app.jsonconfiguration
Commands to Remember
| Command | What It Does |
|---|---|
npx create-expo-app@latest my-app |
Create a new project |
npx expo start |
Start the development server |
i (in terminal) |
Open iOS Simulator |
a (in terminal) |
Open Android Emulator |
r (in terminal) |
Reload the app |
🚀 What's Next?
You have a running app! In the next lesson, we'll dive deeper into the development workflow — understanding Metro bundler, debugging tools, and how to be productive in your day-to-day development.
📝 Before You Move On
Try these exercises to reinforce what you learned:
- Change the background color to your favorite color
- Add your name to the screen
- Add a third line of text with today's date
- Try changing the
fontSizeand see how it affects the layout
🎉 You're a Mobile Developer Now!
You've created, run, and modified a real mobile app. Everything from here builds on this foundation. Well done!