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
Your teaching team
2 minHow the module is graded
4 minThe 60% coursework, week by week:
- Week 2Team + ideaSubmit your idea for approval
- Week 6Phase 1Diagrams, architecture, 9 screens (3 each)30 marks
- Week 12Phase 2Full app, storage, 3 unit tests, AI log50 marks
- Final weekDemo30-min team demo + questions20 marks
Every project must have
2 min1 Google API
Maps, YouTube, Drive, Calendar, Translate…
1 device feature
Camera, location, sensors, microphone…
AI log
Every prompt → the output → your changes → why
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
Why React Native?
4 minNative
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
React Native
TypeScript + React
- One codebase → Android + iOS
- Real native UI
- React skills also work on the web
Your toolkit
5 minInstall the VS Code extensions
3 minESLint
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:
Part 3: Build your first app
28 min
Open VS Code & the terminal
3 minEXPLORER
▾ MY-FIRST-APP
▸ app
▤ _layout.tsx
▤ index.tsx
▸ app-example
▸ assets
▤ .gitignore
▤ app.json
▤ package.json
▤ README.md
1import { Text, View } from "react-native"; export default function Index() { return (…); }2
PS C:\Users\you\my-first-app> ▍3- Explorer: your project’s files and folders
- Editor: where you write code
- Terminal: where you type commands. Open it with Terminal → New Terminal or
Ctrl + ` - Source Control: Git inside VS Code
- 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 installnpx
Node Package eXecute
Runs a package, without installing it
npx create-expo-app@latestCheck that everything is installed:
Create the project
5 minIn the terminal, go to the folder where you keep your course work (for example cd Documents), then run:
npxrun a package without installing itcreate-expo-app@latestthe tool that creates an Expo project.@latest= newest versionmy-first-appthe name of the new folder
Checkpoint
You see ✅ Your project is ready! and a new folder called my-first-app.
Open it & know your folder
2 mincdchange directory: go into a foldermy-first-appthe folder you just created
codeopen VS Code.this folder (the dot means "here")
- 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
Reset the project
3 minThe starter comes with demo screens. Reset it to a blank app:
npm runrun a script written in package.jsonreset-projectthe script that clears the demo app
- app/
- _layout.tsxthe app shell
- index.tsxYOUR first screen
- app-example/the old demo, kept for reference
- assets/
- .gitignore
- package.json
- README.md
Run it on your phone
5 minnpxrun a packageexpothe Expo command-line toolstartstart the development 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:
Edit app/index.tsx to edit this screen.
Build a tiny UI — the 5 basics
10 minView: the box that holds everything (like adiv)Image: a picture from a file or a URL (likeimg)Text: all text must be insideText(likep)TextInput: a box the user can type in (likeinput)Pressable: anything the user can tap (likebutton)
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.
- Push main→Laptop → GitHub
git push - New branchlaptopYour laptop
git switch -c - Commit a changelaptopYour laptop
git commit - Push the branch→Laptop → GitHub
git push - Pull request + mergeGitHubOn GitHub
- Pull it back→GitHub → laptop
git pull
README & .gitignore
2 min- 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 startTip
.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
.envCreate your GitHub account
4 minGo to github.com/signup:
Sign up to GitHub
- Email: an address you can open right now. GitHub sends you a code
- Password: long and new, not your university password
- Username: your public name, as in
github.com/username. Keep it professional (e.g.mariam-ahmed) - Country/Region: where you live
- Continue: next, solve the short puzzle, then type the code from your email
Tell Git who you are
2 mingit configchange a Git setting--globalfor every project on this laptopuser.namethe setting: your name"Your Name"the value, in quotes
Create the repository
4 minCreate a new repository
A repository contains all project files, including the revision history.
- Repository template: leave it as No template
- Owner: you
- Repository name:
my-first-app. GitHub shows ✓ if the name is free - Description (optional): one line about the project
- Public / Private: pick Public today so your TA can see it. Private = only people you invite
- README / .gitignore / License: leave them all off. Your project already has them
- Create repository
You'll land here
Quick setup — if you've done this kind of thing before
…or push an existing repository from the command line
- HTTPS: keep HTTPS selected
- Copy your repository URL. You need it in Task 4.6
- These 3 commands are exactly what you run in Task 4.6
Create a token
6 minGitHub does not accept your password in the terminal. It wants a token: a long, secret password made just for Git.
New personal access token (classic)
Personal access tokens (classic) function like ordinary OAuth access tokens. They can be used instead of a password for Git over HTTPS.
- Note: a name so you remember what it’s for, e.g.
mobile-dev-laptop - Expiration: 90 days lasts the whole semester
- repo: tick it. This lets the token push to your repositories
- Generate token
Personal access tokens (classic)
- GitHub shows the token only once
- 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.
Commit & push
6 mingit pushupload your commits-uremember where to push, so next timegit pushis enoughoriginnickname of your GitHub repomainthe branch to upload
Sign in when asked. On Windows this window pops up:
Connect to GitHub
Don't have an account? Sign up
- Click the Token tab
- Paste your token
- 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:
Checkpoint
Refresh your repo page on GitHub. Your files are there.
Create a branch & change something
4 mingit switchmove to a branch-ccreate it firstfeature/add-footerthe new branch name
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 },Checkpoint
Push the branch
2 minMerge it on GitHub
6 minOpen your repo on GitHub:
- Compare & pull request: GitHub noticed your new branch. Click the green button
Open a pull request
Create a new pull request by comparing changes across two branches.
- base: main: the branch that receives the changes
- compare: feature/add-footer: the branch that gives the changes
- Able to merge: no conflicts, safe to merge
- Title: what this change does
- Description: optional, a short explanation
- Create pull request
Add footer with my name #1
- A
✓ This branch has no conflicts with the base branch
Merging can be performed automatically.
Merge pull request ▾1 - BMerge pull request #1 from your-username/feature/add-footerConfirm merge2Cancel
- C⇄ MergedPull request successfully merged and closedYou're all set — the feature/add-footer branch can be safely deleted.Delete branch3
- Merge pull request: joins your branch into
main - Confirm merge: click to confirm
- Merged ✓. You can now Delete branch; its commits are safe inside
main
Pull it back
4 minMission 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"
The terminal is not inside the project folder.
Go into the project folder first, then run it again.
cd my-first-appnpm run reset-projectExpo Go keeps loading / can't connect
Your phone and laptop are on different networks, or the campus Wi-Fi blocks them from reaching each other.
Stop the server with Ctrl + C and start it in tunnel mode.
npx expo start --tunnel"Author identity unknown — Please tell me who you are"
Git doesn't know your name and email yet.
Do Task 4.3, then commit again.
git config --global user.name "Your Name"git config --global user.email "you@bue.edu.eg""Support for password authentication was removed"
You typed your GitHub password. The terminal only accepts a token.
Push again and paste your token (Task 4.5) where it asks for the password.
git push -u origin main403 / "Permission denied" on push (Windows)
Windows saved a different GitHub account.
Open Credential Manager → Windows Credentials, remove git:https://github.com, then push again and sign in with your token.
"error: remote origin already exists"
Point origin at the correct URL instead of adding it again.
git remote set-url origin https://github.com/your-username/my-first-app.git"error: src refspec main does not match any"
There is no commit yet, or the branch isn't called main.
Commit first, then rename the branch and push.
git add .git commit -m "First commit"git branch -M maingit push -u origin mainStill stuck? Search the troubleshooting center or ask your TA.
End of lab · attendance
Check in for Lab 01
Checking whether check-in is open…
