LAB01

Kick-off — Tools, Git & Your First Expo App

Meet the course and the tools, build a tiny React Native app, then put it on GitHub: create a repo, push, make one branch, merge it on GitHub and pull it back.

Beginner 1.5 hoursreact-nativeexponpm-npxui-basicsgitgithub

Your progress

0 / 23 tasks

4 parts · 90 min

Before you start

Who’s doing Lab 01?

Waiting for your TA to start this lab session. You can read the content in the meantime.

By the end you will

  • Know your teaching team and how the coursework works
  • Explain why we use React Native + Expo instead of native or Flutter
  • Create, reset and run an Expo app on your phone
  • Build a tiny screen with the 5 UI basics
  • Push to GitHub, create one branch, merge it on GitHub and pull it back

You need

  • Laptop with VS Code, Node.js LTS and Git installed (Setup)
  • Expo Go on your phone, or an Android emulator
  • An email address for your GitHub account

Part 1: Meet the course

10 min

TASK 1.2

How the module is graded

4 min

The 60% coursework, week by week:

  1. Week 2Team + ideaSubmit your idea for approval
  2. Week 6Phase 1Diagrams, architecture, 9 screens (3 each)30 marks
  3. Week 12Phase 2Full app, storage, 3 unit tests, AI log50 marks
  4. Final weekDemo30-min team demo + questions20 marks
TASK 1.3

Every project must have

2 min

1 Google API

Maps, YouTube, Drive, Calendar, Translate…

1 device feature

Camera, location, sensors, microphone…

AI log

Every prompt → the output → your changes → why

TASK 1.4

The Git rule — mandatory

2 min
  • 1 Own branch
  • 2 Own commits, from your own GitHub account
  • 3 Merge into main

Important

Git & GitHub are mandatory for every member of the group. Each of you commits to the team repo from your own GitHub account, on your own branch, with your own commits. Your commits are the proof of your work.

Today you practise it alone: your own repo, one branch, one merge.

Part 2: The tools

12 min

TASK 2.1

Why React Native?

4 min

Native

Kotlin + Swift

  • Fastest, full access to the phone
  • Two apps in two languages
  • Two IDEs to learn

Flutter

Dart

  • One codebase
  • A new language (Dart)
  • Draws its own widgets
We use this

React Native

TypeScript + React

  • One codebase → Android + iOS
  • Real native UI
  • React skills also work on the web
TASK 2.3

Install the VS Code extensions

3 min

ESLint

Flags bugs as you type

Prettier

Formats your code on save

Error Lens

Shows errors on the line

Expo Tools

Autocomplete for app.json

React Native Tools

Debugging support

GitLens

Who changed each line

ES7+ Snippets

Type rnfe for a full component

Tailwind IntelliSense

Hints for NativeWind classes

Paste this in the VS Code terminal to install them all:

Terminal — install extensions
code --install-extension dbaeumer.vscode-eslint
code --install-extension esbenp.prettier-vscode
code --install-extension usernamehw.errorlens
code --install-extension expo.vscode-expo-tools
code --install-extension msjsdiag.vscode-react-native
code --install-extension eamodio.gitlens
code --install-extension dsznajder.es7-react-js-snippets
code --install-extension bradlc.vscode-tailwindcss

Part 3: Build your first app

28 min

TASK 3.1

Open VS Code & the terminal

3 min
  1. Explorer: your project’s files and folders
  2. Editor: where you write code
  3. Terminal: where you type commands. Open it with Terminal → New Terminal or Ctrl + `
  4. Source Control: Git inside VS Code
  5. Extensions: install the extensions from Task 2.3

Two words you’ll type all the time:

npm

Node Package Manager

Installs packages into your project

npm install

npx

Node Package eXecute

Runs a package, without installing it

npx create-expo-app@latest

Check that everything is installed:

Terminal
node -v
v22.12.0
npm -v
10.9.0
npx -v
10.9.0
git -v
git version 2.47.1
any version numbers are fine
TASK 3.2

Create the project

5 min

In the terminal, go to the folder where you keep your course work (for example cd Documents), then run:

npxcreate-expo-app@latestmy-first-app
  1. npxrun a package without installing it
  2. create-expo-app@latestthe tool that creates an Expo project. @latest = newest version
  3. my-first-appthe name of the new folder
Terminal — create
npx create-expo-app@latest my-first-app
Need to install the following packages: create-expo-app Ok to proceed? (y) y
Creating an Expo project using the default template.
✔ Downloaded and extracted project files.
✔ Installed JavaScript dependencies.
✅ Your project is ready!

Checkpoint

You see ✅ Your project is ready! and a new folder called my-first-app.

TASK 3.3

Open it & know your folder

2 min
cdmy-first-app
  1. cdchange directory: go into a folder
  2. my-first-appthe folder you just created
code.
  1. codeopen VS Code
  2. .this folder (the dot means "here")
my-first-app (before reset)
  • app/the demo screens
  • assets/images & fonts
  • components/demo components
  • constants/
  • hooks/
  • scripts/contains reset-project.js
  • .gitignoremade for you
  • app.jsonapp name, icon, settings
  • package.jsonpackages + scripts
  • README.md
TASK 3.4

Reset the project

3 min

The starter comes with demo screens. Reset it to a blank app:

npm runreset-project
  1. npm runrun a script written in package.json
  2. reset-projectthe script that clears the demo app
Terminal — reset
npm run reset-project
Do you want to move existing files to /app-example instead of deleting them? (Y/n): Y
📁 /app-example directory created.
📁 New /app directory created.
📄 app/index.tsx created.
📄 app/_layout.tsx created.
✅ Project reset complete.
my-first-app (after reset)
  • app/
  • _layout.tsxthe app shell
  • index.tsxYOUR first screen
  • app-example/the old demo, kept for reference
  • assets/
  • .gitignore
  • package.json
  • README.md
TASK 3.5

Run it on your phone

5 min
npxexpostart
  1. npxrun a package
  2. expothe Expo command-line tool
  3. startstart the development server
Terminal — dev server
npx expo start
Starting Metro Bundler
› Metro waiting on exp://192.168.1.5:8081
› Scan the QR code above with Expo Go (Android) or the Camera app (iOS)
› Press a │ open Android
› Press r │ reload app
Ctrl + C stops the server

Phone

Open Expo Go and scan the QR code. Use the same Wi-Fi as your laptop.

Emulator

Start it in Android Studio, then press a in the terminal.

Won't connect?

Stop the server and run npx expo start --tunnel.

Checkpoint

Your phone shows the blank starter screen:

TASK 3.6

Build a tiny UI — the 5 basics

10 min
  1. View: the box that holds everything (like a div)
  2. Image: a picture from a file or a URL (like img)
  3. Text: all text must be inside Text (like p)
  4. TextInput: a box the user can type in (like input)
  5. Pressable: anything the user can tap (like button)

Open app/index.tsx, delete everything and paste:

import { useState } from 'react';
import { View, Text, Image, TextInput, Pressable, StyleSheet } from 'react-native';

export default function Index() {
  const [name, setName] = useState('');   // what the user typed
  const [count, setCount] = useState(0);   // how many taps

  return (
    <View style={styles.screen}>
      <Image source={{ uri: 'https://reactnative.dev/img/tiny_logo.png' }} style={styles.logo} />
      <Text style={styles.title}>Hello, {name || 'Mobile Dev'} 👋</Text>
      <TextInput style={styles.input} placeholder="Type your name…" value={name} onChangeText={setName} />
      <Pressable style={styles.button} onPress={() => setCount(count + 1)}>
        <Text style={styles.buttonText}>Tapped {count} times</Text>
      </Pressable>
    </View>
  );
}

const styles = StyleSheet.create({
  screen: { flex: 1, alignItems: 'center', justifyContent: 'center', gap: 16, padding: 24 },
  logo: { width: 64, height: 64 },
  title: { fontSize: 24, fontWeight: '700' },
  input: { width: '100%', borderWidth: 1, borderColor: '#ccc', borderRadius: 10, padding: 12 },
  button: { backgroundColor: '#111', paddingVertical: 12, paddingHorizontal: 20, borderRadius: 10 },
  buttonText: { color: '#fff', fontWeight: '600' },
});

Checkpoint

Save. The phone updates by itself (Fast Refresh). Type your name and tap the button:

Part 4: Git & GitHub

40 min

Your mission for Part 4. You work alone: your own repo, one branch, merged on GitHub, then pulled back to your laptop.

  1. Push main→Laptop → GitHubgit push
  2. New branchlaptopYour laptopgit switch -c
  3. Commit a changelaptopYour laptopgit commit
  4. Push the branch→Laptop → GitHubgit push
  5. Pull request + mergeGitHubOn GitHub
  6. Pull it back→GitHub → laptopgit pull
TASK 4.1

README & .gitignore

2 min
my-first-app
  • app/
  • assets/
  • .gitignoremade by Expo: do NOT touch
  • package.json
  • README.mdwrite your own

Replace everything in README.md with:

# My First App

Lab 01 — Mobile Application Development (25CSCI38H)
Made by: Your Name · Student ID: 123456

Run it: npm install, then npx expo start

Tip

.gitignore tells Git which files not to upload, like node_modules (thousands of files). Expo created it for you, so leave it alone. Only if it is missing, create it with the lines below.

node_modules/
.expo/
dist/
*.log
.env
TASK 4.2

Create your GitHub account

4 min

Go to github.com/signup:

  1. Email: an address you can open right now. GitHub sends you a code
  2. Password: long and new, not your university password
  3. Username: your public name, as in github.com/username. Keep it professional (e.g. mariam-ahmed)
  4. Country/Region: where you live
  5. Continue: next, solve the short puzzle, then type the code from your email
TASK 4.3

Tell Git who you are

2 min
git config--globaluser.name"Your Name"
  1. git configchange a Git setting
  2. --globalfor every project on this laptop
  3. user.namethe setting: your name
  4. "Your Name"the value, in quotes
Terminal
git config --global user.name "Your Name"
git config --global user.email "you@bue.edu.eg"
use the SAME email as your GitHub account
TASK 4.4

Create the repository

4 min
  1. Repository template: leave it as No template
  2. Owner: you
  3. Repository name: my-first-app. GitHub shows ✓ if the name is free
  4. Description (optional): one line about the project
  5. Public / Private: pick Public today so your TA can see it. Private = only people you invite
  6. README / .gitignore / License: leave them all off. Your project already has them
  7. Create repository

You'll land here

  1. HTTPS: keep HTTPS selected
  2. Copy your repository URL. You need it in Task 4.6
  3. These 3 commands are exactly what you run in Task 4.6
TASK 4.5

Create a token

6 min

GitHub does not accept your password in the terminal. It wants a token: a long, secret password made just for Git.

  1. Note: a name so you remember what it’s for, e.g. mobile-dev-laptop
  2. Expiration: 90 days lasts the whole semester
  3. repo: tick it. This lets the token push to your repositories
  4. Generate token
  1. GitHub shows the token only once
  2. Copy it now and keep it somewhere safe. If you lose it, just make a new one

Warning

A token works like your password. Never share it, never paste it in your code, never commit it.

TASK 4.6

Commit & push

6 min
you are here
Terminal — first push
git status
shows what changed
git add .
stage everything (. = this folder)
git commit -m "Lab 01: first screen + README"
save a snapshot with a message
git branch -M main
make sure the branch is called main
git remote add origin https://github.com/your-username/my-first-app.git
connect to your GitHub repo (paste YOUR url)
git push -u origin main
git push-uoriginmain
  1. git pushupload your commits
  2. -uremember where to push, so next time git push is enough
  3. originnickname of your GitHub repo
  4. mainthe branch to upload

Sign in when asked. On Windows this window pops up:

  1. Click the Token tab
  2. Paste your token
  3. Sign in. Windows remembers it for next time

On macOS or Linux the terminal asks instead. Paste the token as the password. Nothing shows while you paste; that’s normal:

Terminal — macOS / Linux
Username for 'https://github.com': your-username
Password for 'https://your-username@github.com': (paste your token)
Enumerating objects: 25, done.
To https://github.com/your-username/my-first-app.git
* [new branch] main -> main
branch 'main' set up to track 'origin/main'.

Checkpoint

Refresh your repo page on GitHub. Your files are there.

TASK 4.7

Create a branch & change something

4 min
you are here
git switch-cfeature/add-footer
  1. git switchmove to a branch
  2. -ccreate it first
  3. feature/add-footerthe new branch name
Terminal
git switch -c feature/add-footer
Switched to a new branch 'feature/add-footer'

Add a footer under the button in app/index.tsx:

      <Pressable style={styles.button} onPress={() => setCount(count + 1)}>
        <Text style={styles.buttonText}>Tapped {count} times</Text>
      </Pressable>

      <Text style={styles.footer}>Made by Your Name</Text>
    </View>
  );
}
// … and inside StyleSheet.create:
  footer: { color: '#666', fontSize: 12 },
Terminal
git add .
git commit -m "Add footer with my name"
this commit exists only on the branch

Checkpoint

TASK 4.8

Push the branch

2 min
you are here
Terminal — push branch
git push -u origin feature/add-footer
remote: Create a pull request for 'feature/add-footer' on GitHub by visiting:
remote: https://github.com/your-username/my-first-app/pull/new/feature/add-footer
* [new branch] feature/add-footer -> feature/add-footer
TASK 4.9

Merge it on GitHub

6 min
you are here

Open your repo on GitHub:

  1. Compare & pull request: GitHub noticed your new branch. Click the green button
  1. base: main: the branch that receives the changes
  2. compare: feature/add-footer: the branch that gives the changes
  3. Able to merge: no conflicts, safe to merge
  4. Title: what this change does
  5. Description: optional, a short explanation
  6. Create pull request
  1. Merge pull request: joins your branch into main
  2. Confirm merge: click to confirm
  3. Merged ✓. You can now Delete branch; its commits are safe inside main
TASK 4.10

Pull it back

4 min
you are here
Terminal — pull
git switch main
Switched to branch 'main'
the footer DISAPPEARS: main on your laptop does not have it yet
git pull
Updating a1b2c3d..e4f5a6b
Fast-forward
app/index.tsx | 4 ++++
the footer is back, now on main
BEFORE
AFTER

Mission complete

Your repo on GitHub has your app, your branch is merged into main, and your laptop is up to date. 🎉

Stuck?

"Missing script: reset-project"
Cause

The terminal is not inside the project folder.

Fix

Go into the project folder first, then run it again.

Run
cd my-first-app
npm run reset-project
Expo Go keeps loading / can't connect
Cause

Your phone and laptop are on different networks, or the campus Wi-Fi blocks them from reaching each other.

Fix

Stop the server with Ctrl + C and start it in tunnel mode.

Run
npx expo start --tunnel
"Author identity unknown — Please tell me who you are"
Cause

Git doesn't know your name and email yet.

Fix

Do Task 4.3, then commit again.

Run
git config --global user.name "Your Name"
git config --global user.email "you@bue.edu.eg"
"Support for password authentication was removed"
Cause

You typed your GitHub password. The terminal only accepts a token.

Fix

Push again and paste your token (Task 4.5) where it asks for the password.

Run
git push -u origin main
403 / "Permission denied" on push (Windows)
Cause

Windows saved a different GitHub account.

Fix

Open Credential Manager → Windows Credentials, remove git:https://github.com, then push again and sign in with your token.

"error: remote origin already exists"
Fix

Point origin at the correct URL instead of adding it again.

Run
git remote set-url origin https://github.com/your-username/my-first-app.git
"error: src refspec main does not match any"
Cause

There is no commit yet, or the branch isn't called main.

Fix

Commit first, then rename the branch and push.

Run
git add .
git commit -m "First commit"
git branch -M main
git push -u origin main

Still stuck? Search the troubleshooting center or ask your TA.

End of lab · attendance

Check in for Lab 01

Checking whether check-in is open…