Skip to content
Open
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8aaf147
chore: update Readme Agents md
rferrari Mar 13, 2026
2cf50b7
packages: expo update
rferrari Mar 13, 2026
6740f18
feat: layout revolution start
rferrari Mar 13, 2026
0532955
feat: no leaderboard top icon to match layout
rferrari Mar 13, 2026
400b64b
chore: update package.json
rferrari Mar 13, 2026
d39b3a2
feat: login and account management flow. Account deletion is now secu…
rferrari Mar 13, 2026
f2a7db6
fix: Android OOM Fix & UI Branding Update
rferrari Mar 13, 2026
cfafb4e
fix: video zindex bug
rferrari Mar 13, 2026
23b3efb
feat: Scroll Locking and Follow Button Features
rferrari Mar 13, 2026
bdf1ca2
feat: Updating Matrix Toast to use MatrixRain pattern
rferrari Mar 13, 2026
cc03aba
feat: Refining Header & Mocking Feed Filters
rferrari Mar 13, 2026
b112ee3
feat: Lifting Conversation Drawer Out of PostCard
rferrari Mar 13, 2026
cdb8e31
feat: Vote Weight Preset Buttons Setting
rferrari Mar 13, 2026
104cae6
feat: About page redesign! πŸ›Ή
rferrari Mar 13, 2026
c3a639c
Merge branch 'main' into feat/revolucao and resolve conflicts
rferrari Mar 13, 2026
5e75996
fix: largeHeap true
rferrari Mar 14, 2026
f250875
fix: memory optimizations to address the crashes.
rferrari Mar 14, 2026
4a0478f
Merge branch 'main' of https://github.com/rferrari/mobileapp-skatehive
rferrari Mar 14, 2026
4bf30fd
Merge branch 'main' into fix/memory-leak
rferrari Mar 14, 2026
6af4fc8
Merge branch 'main' into feat/revolucao
rferrari Mar 14, 2026
c03ec47
feat: implement unified conversation drawer across feed, videos and n…
rferrari Mar 14, 2026
9085d71
Merge branch 'fix/memory-leak' into feat/unified-comments and resolve…
rferrari Mar 14, 2026
19813b6
Merge branch 'feat/revolucao' into feat/unified-comments
rferrari Mar 14, 2026
95a58fe
Implementing Unified Conversation Drawer
rferrari Mar 14, 2026
d5275e6
fix: the "swipe to close" gesture to cover the entire surface of the …
rferrari Mar 14, 2026
b441895
fix: he "hollow" area issue!
rferrari Mar 14, 2026
aea818c
feat: Responsive Header and Tab Bar refactor! πŸš€
rferrari Mar 14, 2026
eb02757
feat: Settings & Account Management UI! πŸ›Ήβš™οΈ
rferrari Mar 14, 2026
dfc3c92
feat: The feed title is now simply "Skatehive" and the filter dropdow…
rferrari Mar 14, 2026
c6242ba
fix: restore app.json (undo EAS removal)
rferrari Mar 14, 2026
634e391
Merge branch 'feat/responsive-header'
rferrari Mar 14, 2026
cf3552c
feat: Stance Setting (Regular/Goofy) and refactored the SideMenu as r…
rferrari Mar 14, 2026
666c705
Merge branch 'feat/stance'
rferrari Mar 14, 2026
2b88fa8
feat: Unified Rendering modular multimedia system!
rferrari Mar 15, 2026
7ce1af4
feat: Lazy Media Rendering and the Modular Media System.
rferrari Mar 15, 2026
a54cb77
moved the API URLs to environment variables! πŸš€
rferrari Mar 14, 2026
3beb35c
feat: Implement Core Mute Filtering
rferrari Mar 15, 2026
51664e1
feat: using skatehive api muted list
rferrari Mar 15, 2026
67813c8
feat: followers cache enhanc
rferrari Mar 14, 2026
eb6bc64
Phase 0 (Cache) and Phase 1 (Wallet) are both done! πŸš€ Here's what was…
rferrari Mar 14, 2026
e5100a8
chore: removed agents.md local file
rferrari Mar 18, 2026
785af9b
fix: review fixes:
rferrari Mar 18, 2026
7b70938
fix: fliped AppSettingsProvider
rferrari Mar 18, 2026
2c4940d
fix: env.d type and Remove the duplicated inline contentStyle objects…
rferrari Mar 18, 2026
a300646
fix: Move useEffect inside RootLayout and add error handling to splas…
rferrari Mar 18, 2026
f9f4004
fix: screenOptions is missing contentStyle, causing non-dark backgrou…
rferrari Mar 18, 2026
91b6e2f
fix: useEffect in RootLayout calls
rferrari Mar 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ yarn-error.*

# local env files
.env
/.env
.env*.local
.env.local
.env.production

# typescript
*.tsbuildinfo
Expand Down
145 changes: 30 additions & 115 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# SkateHive Mobile App β€” Agent Guide
# SkateHive Mobile App – Agent Guide

This file provides context for AI agents working on this codebase.
This file provides critical context for AI agents working on the SkateHive mobile codebase.

## Repository Overview

**SkateHive** is a React Native/Expo mobile app for a skateboarding community built on the HIVE blockchain. Users post skateboarding content (photos, videos, text), vote on posts, comment, follow each other, and earn crypto rewards (HIVE/HBD).
**SkateHive** is a React Native/Expo mobile app for the skateboarding community built on the HIVE blockchain. Users post content, vote, comment, and earn crypto rewards (HIVE/HBD).

## Architecture Summary

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Expo Router β”‚
Expand All @@ -17,7 +15,7 @@ This file provides context for AI agents working on this codebase.
β”‚ components/Feed/ components/auth/ components/ui/ β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Business Logic (lib/) β”‚
β”‚ auth-provider hive-utils secure-key upload/ β”‚
β”‚ auth-provider hive-utils secure-key theme β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Data Layer β”‚
β”‚ React Query | HIVE RPC Nodes | REST API β”‚
Expand All @@ -27,122 +25,39 @@ This file provides context for AI agents working on this codebase.
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

## Critical Files to Understand First

| File | Purpose | Lines |
|------|---------|-------|
| `lib/auth-provider.tsx` | Authentication context, session mgmt, multi-account, biometric/PIN | ~490 |
| `lib/hive-utils.ts` | ALL blockchain operations (vote, comment, follow, power-up, etc.) | ~1200 |
| `lib/secure-key.ts` | AES encryption of private keys with PBKDF2 key derivation | ~150 |
| `lib/types.ts` | TypeScript interfaces for Post, AuthSession, etc. | ~130 |
| `lib/theme.ts` | Complete design system (colors, spacing, fonts, radii) | ~65 |
| `lib/constants.ts` | API URLs, community tag, app name | ~25 |
| `app/_layout.tsx` | Root layout wrapping all context providers | β€” |
| `app/(tabs)/_layout.tsx` | Tab bar configuration (5 visible + 1 hidden tab) | β€” |
## Critical Files
- `lib/auth-provider.tsx`: Auth context, session, multi-account, biometric/PIN logic.
- `lib/hive-utils.ts`: ALL blockchain operations (vote, comment, follow, etc.).
- `lib/secure-key.ts`: AES encryption of private keys (PBKDF2).
- `lib/theme.ts`: Central design system (colors, spacing, fonts).
- `app/_layout.tsx`: Root layout wrapping all providers.

## Agent Task Patterns

### Adding a New Screen
1. Create file in `app/` (or `app/(tabs)/` for tabbed screens)
2. Expo Router auto-registers routes from file names
3. Protected routes check `useAuth()` session in `app/_layout.tsx`
4. Import theme from `lib/theme.ts` for consistent styling

### Adding a New Blockchain Operation
1. Add function in `lib/hive-utils.ts`
2. Use `hiveClient` (pre-configured with failover nodes)
3. Require `decryptedKey` from `useAuth()` session
4. Wrap in try/catch β€” blockchain ops can fail on any node
1. Create file in `app/` (or `app/(tabs)/` for tabbed screens).
2. Expo Router auto-registers routes from filenames.
3. Import `theme` from `lib/theme.ts` for all styling.

### Adding a New Hook
1. Create in `lib/hooks/`
2. Use `useQuery`/`useMutation` from `@tanstack/react-query`
3. Follow existing patterns in `useQueries.ts` for cache keys and stale times
4. Export and use in components
### Blockchain Operations
1. Use functions in `lib/hive-utils.ts`.
2. Wrap in try/catch β€” RPC nodes can fail; the client handles failover.
3. Require `decryptedKey` from `useAuth()` session.

### Modifying the Feed
- Feed data flows: `useSnaps()` -> `getSnapsContainers()` -> `getContentReplies()`
- Each post is rendered by `components/Feed/PostCard.tsx`
- Media parsing happens inside PostCard (extracts images/videos from markdown body)
- Voting UI uses `components/ui/VotingSlider.tsx`

### Media Upload Changes
- Images: `lib/upload/image-upload.ts` (HEIC conversion + HIVE image hosting)
- Videos: `lib/upload/video-upload.ts` (dynamic transcoder discovery + IPFS)
- Post assembly: `lib/upload/post-utils.ts` (permlink, tags, metadata, broadcast)
### Data Hooks
1. Create in `lib/hooks/`.
2. Use `useQuery`/`useMutation` from `@tanstack/react-query`.
3. Follow patterns in `useQueries.ts` for cache keys.

## Key Conventions

### Styling
- **Dark theme only** β€” never add light mode
- All colors come from `lib/theme.ts` (primary=#32CD32, bg=#000000)
- Use `StyleSheet.create()` β€” no inline styles, no NativeWind in practice
- Font: FiraCode (monospace) for all text

### State Management
- **Server state:** React Query (`@tanstack/react-query`)
- **Auth state:** React Context (`lib/auth-provider.tsx`)
- **Notifications:** React Context (`lib/notifications-context.tsx`)
- **Toasts:** React Context (`lib/toast-provider.tsx`)
- **Local state:** `useState`/`useReducer`

### Imports
- Use `~/` path alias (maps to project root via tsconfig)
- Example: `import { theme } from '~/lib/theme'`

### Security Rules
- NEVER store private keys in plaintext
- NEVER log private keys or decrypted values
- Always use `expo-secure-store` for sensitive data
- Blockchain writes require `AuthSession.decryptedKey`

## Provider Hierarchy (app/_layout.tsx)

```
QueryClientProvider
└── AuthProvider
└── NotificationProvider
└── ToastProvider
└── ViewportTrackerProvider
└── <Slot /> (screens)
```
- **Dark Theme Only**: Background `#000000`, Primary `#32CD32`.
- **Styling**: Use `StyleSheet.create()` β€” no inline styles, no Tailwind/NativeWind.
- **Security**: NEVER store or log private keys in plaintext.
- **Imports**: Use `~/` path alias (e.g., `import { theme } from '~/lib/theme'`).

## Common Gotchas

1. **Version drift:** app.json, Info.plist, project.pbxproj, and package.json all have independent version numbers that must be synced manually before builds.

2. **Android versionCode:** Historically stuck at 1 β€” must be incremented for Play Store releases.

3. **newArchEnabled mismatch:** `app.json` says `false`, `ios/Podfile.properties.json` says `true`. Pick one and sync.

4. **Test account in auth-provider:** Hardcoded credentials for Apple App Store review β€” should be removed after approval.

5. **HIVE RPC nodes:** Multiple fallback nodes configured in `hive-utils.ts`. If one fails, the client retries on the next. Don't hardcode a single node.

6. **Video autoplay:** Uses viewport tracking (`lib/ViewportTracker.tsx`). Videos auto-play when 60%+ visible, pause when scrolled away.

7. **No test suite:** There are no automated tests in the project currently. The `scripts/` directory is empty.

## Environment Setup

```bash
# Prerequisites
node >= 18
pnpm

# Install & run
pnpm install
cp .env.example .env # Configure API_BASE_URL
pnpm dev # Start Expo dev server

# Build for production
eas build --platform ios --profile production
eas build --platform android --profile production
```

## API Dependencies
- `https://api.skatehive.app/api/v1` β€” SkateHive backend
- `https://api.skatehive.app/api/v2/leaderboard` β€” Leaderboard data
- `https://api.skatehive.app/api/transcode/status` β€” Video transcoding service
- `https://images.hive.blog` β€” HIVE image CDN
- HIVE RPC nodes (multiple, with failover)
1. **Version Drift**: `app.json`, `Info.plist`, `project.pbxproj`, and `package.json` must be synced manually.
2. **Native Modules**: This is a **Bare Workflow** project; native changes require `pnpm prebuild` or EAS.
3. **RPC Nodes**: Multiple fallback nodes are configured in `hive-utils.ts`.
5. **React Lists**: Always ensure every child in a list (e.g., `map()` or `FlatList`) has a unique `key` prop to prevent standard React warnings.
6. **New Architecture**: You can ignore the warning: `setLayoutAnimationEnabledExperimental is currently a no-op in the New Architecture.`
Loading