Skip to content

Commit fa1c0a4

Browse files
authored
Add mobile examples (#13764)
1 parent ad2d058 commit fa1c0a4

37 files changed

Lines changed: 40741 additions & 16825 deletions

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ audius-cmd stream
7171

7272
- **packages/web**: React web client with Vite, Redux Toolkit, Emotion CSS
7373
- **packages/mobile**: React Native app for iOS/Android
74+
- **packages/mobile/examples**: Runnable mobile examples (auth/sign-in, upload) with READMEs for AI and developer reference—see [packages/mobile/examples/README.md](packages/mobile/examples/README.md)
7475
- **packages/common**: Shared code between web and mobile (state, models, utilities)
7576
- **packages/sdk**: JavaScript SDK for interacting with Audius protocol
7677
- **packages/harmony**: Design system components and tokens
@@ -88,6 +89,7 @@ audius-cmd stream
8889
- SDK (@audius/sdk) handles all protocol interactions
8990
- Services layer in packages/common/src/services
9091
- API adapters for web3 and traditional HTTP endpoints
92+
- **Mobile examples**: For auth (sign-in/OAuth-style), upload, etc., see `packages/mobile/examples/`; each example has a README with run instructions and source-of-truth file paths.
9193

9294
### Styling Approach
9395

package-lock.json

Lines changed: 21330 additions & 16824 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"mobile": "npm run start -w @audius/mobile",
4848
"mobile:clean": "npm run clean:auto -w @audius/mobile && npm run clean:modules",
4949
"mobile:clear-cache": "watchman watch-del-all && npm run start -w @audius/mobile -- --reset-cache",
50+
"mobile:example:trending": "cd packages/mobile/examples/trending && npx expo start",
5051
"EMBED======================================": "",
5152
"embed:prod": "npm run start:prod -w embed",
5253
"embed:stage": "npm run start:stage -w embed",

packages/mobile/examples/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Mobile Examples
2+
3+
Runnable examples for building Audius-style mobile features (React Native). Use these when implementing **authentication (sign-in / OAuth-style flows)** or similar capabilities so that AIs and developers can find reference implementations quickly.
4+
5+
## Quick start (run the app)
6+
7+
From the **repository root** (`apps/`):
8+
9+
```bash
10+
npm install
11+
npm run ios:dev # iOS simulator
12+
# or
13+
npm run android:dev # Android emulator
14+
```
15+
16+
Environment: copy `packages/mobile/.env.dev` if needed; the app runs against staging by default.
17+
18+
## Available examples
19+
20+
| Example | Description | How to run in the app |
21+
|--------|-------------|------------------------|
22+
| [trending](./trending/) | **Expo app**: SDK setup + trending tracks (code example) | From repo root: `cd packages/mobile/examples/trending && npx expo start` or `npm run mobile:example:trending` |
23+
| [auth-sign-in](./auth-sign-in/) | **Expo app**: OAuth + bearer token (SDK). Main app: Hedgehog email/password. | OAuth example: `cd packages/mobile/examples/auth-sign-in && npx expo start` or `npm run mobile:example:auth-sign-in`. Main app: open app → sign-in. |
24+
25+
## For AI / code search
26+
27+
- **SDK setup (mobile / Expo):** trending example, getSDK, sdk(appName), polyfills, Buffer process, trending tracks.
28+
- **Authentication**: sign-in, login, OAuth, bearer token, Hedgehog, identity service, `authService`, `createAuthService`, `sdk({ bearerToken })`, `oauth.login`.
29+
30+
Implementation lives in `packages/mobile/src` and `packages/common`; each example folder links to the exact files and entry points.
31+
32+
## Adding new examples
33+
34+
1. Add a new directory under `packages/mobile/examples/<example-name>/`.
35+
2. Add a `README.md` with: purpose, keywords for search, **How to run** (where to navigate in the app), and **Source of truth** (file paths in this repo).
36+
3. Update this README's table and any run script if applicable.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
> Why do I have a folder named ".expo" in my project?
2+
3+
The ".expo" folder is created when an Expo project is started using "expo start" command.
4+
5+
> What do the files contain?
6+
7+
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
8+
- "settings.json": contains the server configuration that is used to serve the application manifest.
9+
10+
> Should I commit the ".expo" folder?
11+
12+
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
13+
Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"devices": []
3+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.env
2+
.env.local
3+
*.jks
4+
*.p8
5+
*.p12
6+
*.key
7+
*.mobileprovision

0 commit comments

Comments
 (0)