Skip to content

Commit 2883b1b

Browse files
maximcodingclaude
andcommitted
feat: add UI components, CI workflows, offline docs, and feature types
- Add shared UI components: Activity, ErrorBoundary, FocusAwareStatusBar, ScreenHeader, SuspenseBoundary, ThemedStatusBar - Add feature types/index.ts for auth, home, settings, user (consolidate domain types) - Add CI workflow, Maestro smoke tests, CODE_OF_CONDUCT - Add docs: OFFLINE.md, OPERATIONS.md, development.md - Add navigation persistence, NavigationRoot, SVG tab icons - Add Sentry monitoring stub, ensure-env/wait-for-device scripts - Update theme tokens, Button, ScreenWrapper, IconSvg, interceptors - Update AGENTS.md, CLAUDE.md, rules, README, CONTRIBUTING, CHANGELOG Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b520ecc commit 2883b1b

File tree

89 files changed

+7298
-2016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+7298
-2016
lines changed

.claude/CLAUDE.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# CLAUDE.md — React Native Project
1+
# CLAUDE.md — React Native Starter
22

3-
**Claude Code context** for this repo. **Canonical agent rules:** [AGENTS.md](../AGENTS.md) at the repo root (structure, don’ts, “when adding”). This file duplicates stack/commands for Claude; on conflict, prefer **AGENTS.md** and the codebase.
3+
**Claude Code context** for this repo. **Canonical agent rules:** [AGENTS.md](../AGENTS.md) (structure, don’ts, “when adding”, documentation map). This file adds stack/commands for Claude; on conflict, prefer **AGENTS.md** and the codebase. **Path-scoped rules:** [.claude/rules/](rules/) (`config`, `features`, `shared-components`, `shared-services`).
44

55
## Project Overview
66

@@ -16,7 +16,7 @@ Production-oriented React Native starter for mobile apps: feature-first architec
1616
- **Backend/API:** `src/shared/services/api/`
1717
- **Auth:** interceptors in shared API; session in `src/session/`
1818
- **Testing:** Jest (react-native preset), react-test-renderer; `jest.config.js`, `jest.setup.js`
19-
- **CI/CD:** GitHub Actions — `.github/workflows/android-ci.yml`, `.github/workflows/ios-ci.yml`; Fastlane mentioned in docs for Play/TestFlight
19+
- **CI/CD:** GitHub Actions — `.github/workflows/ci.yml` (PR checks), `.github/workflows/android-ci.yml`, `.github/workflows/ios-ci.yml` (manual); Fastlane optional — not in this template (add under `fastlane/` for store releases; see [docs/OPERATIONS.md](../docs/OPERATIONS.md#github-actions))
2020

2121
## Project Structure
2222

@@ -35,12 +35,13 @@ src/
3535
│ ├── theme/
3636
│ ├── utils/
3737
│ └── types/
38-
├── features/<feature>/
38+
├── features/<feature>/ # per slice: types/, screens/, components/, hooks/, services/, api/, navigation/
3939
assets/
4040
scripts/
41+
ios/, android/ # native projects (Fastlane optional — add fastlane/ when needed)
4142
```
4243

43-
Feature services live under `src/features/<feature>/services/`; features own their screens, components, hooks, models (Zod + mappers), and api (query keys).
44+
Feature code lives under `src/features/<feature>/`: `screens/`, `components/`, `hooks/`, **`types/`** (interfaces + type aliases), `services/` (Zod + mappers + service modules), `api/keys.ts`, `navigation/param-list.ts`.
4445

4546
## Key Commands
4647

@@ -49,7 +50,7 @@ Feature services live under `src/features/<feature>/services/`; features own the
4950
npm install
5051

5152
# Metro
52-
npm run start
53+
npm start
5354

5455
# Run
5556
npm run ios
@@ -86,7 +87,7 @@ npm run android:build:release # Android
8687
- **Component pattern:** Functional components only; no class components.
8788
- **File naming:** PascalCase for components (e.g. `ScreenWrapper.tsx`); camelCase or kebab for utils/services (e.g. `navigation-helpers.ts`, `auth.service.ts`).
8889
- **Exports:** Named exports for components/hooks; screens follow existing files.
89-
- **API layer:** `src/shared/services/api/`; feature services in `features/<name>/services/`; Zod validation.
90+
- **API layer:** `src/shared/services/api/`; feature services in `features/<name>/services/`; domain types in `features/<name>/types/`; Zod validation.
9091
- **Error handling:** `src/shared/utils/normalize-error.ts`, `toast.ts`.
9192
- **Navigation typing:** `src/navigation/routes.ts`.
9293

@@ -137,18 +138,25 @@ npm run android:build:release # Android
137138

138139
- **Navigation & route constants:** `src/navigation/` (`routes.ts`, stacks, tabs).
139140
- **Theme & query client infra:** `src/shared/theme/`, `src/shared/services/api/query/`.
140-
- **Feature API logic:** `src/features/<name>/services/`.
141+
- **Feature API logic:** `src/features/<name>/services/`; **feature types:** `src/features/<name>/types/`.
141142

142143
## Docs
143144

144-
| Audience | Doc |
145-
|----------|-----|
146-
| Humans | [README.md](../README.md) |
147-
| Cursor / agents | [AGENTS.md](../AGENTS.md) |
148-
| Claude Code | This file |
149-
| Extended guidelines | [docs/MOBILE_E2E_GUIDE_additions.md](../docs/MOBILE_E2E_GUIDE_additions.md) |
150-
| Backlog | [docs/TODO.md](../docs/TODO.md) |
151-
| Versions | [CHANGELOG.md](../CHANGELOG.md) |
145+
Same **topic-to-doc** matrix as [AGENTS.md#documentation-map](../AGENTS.md#documentation-map) (canonical). Root [README.md](../README.md) is the only project README; do not duplicate the full table there.
146+
147+
| Doc | Role |
148+
|-----|------|
149+
| [README.md](../README.md) | Landing: quick start, setup, env, links |
150+
| [AGENTS.md](../AGENTS.md) | Agents/humans: rules, where code lives, doc map |
151+
| This file | Claude Code stack reference + commands |
152+
| [docs/development.md](../docs/development.md) | Hooks, architecture, icons, i18n, npm scripts |
153+
| [docs/production-guidelines.md](../docs/production-guidelines.md) | Production patterns and checklists |
154+
| [docs/OPERATIONS.md](../docs/OPERATIONS.md) | Sentry, Maestro, CI, OTA, publishing |
155+
| [docs/OFFLINE.md](../docs/OFFLINE.md) | Offline stack |
156+
| [docs/permissions-bare-rn.md](../docs/permissions-bare-rn.md) | Permission catalog |
157+
| [docs/TODO.md](../docs/TODO.md) | Roadmap / backlog |
158+
| [CONTRIBUTING.md](../CONTRIBUTING.md) | PRs, changelog, quality checks, security reporting |
159+
| [CHANGELOG.md](../CHANGELOG.md) | Version history |
152160

153161
## MCP Servers
154162

@@ -157,6 +165,7 @@ Figma MCP is configured for design-to-code (get_design_context, etc.). Use for F
157165
## Common Pitfalls — Do NOT
158166

159167
- Do NOT add new npm packages without asking/RFC.
168+
- Do NOT change any package version in `package.json` or `package-lock.json`. Fix consuming code to match the installed version instead.
160169
- Do NOT use `fetch`; use project HTTP/transport only.
161170
- Do NOT put feature logic in `src/shared/components/ui/` or `src/shared/stores/`.
162171
- Do NOT use raw colors/spacing/fonts in UI; use theme tokens.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: documentation-expert
3+
description: Use this agent to create, improve, and maintain project documentation. Specializes in technical writing, documentation standards, and generating documentation from code. Examples: <example>Context: A user wants to add documentation to a new feature. user: 'Please help me document this new API endpoint.' assistant: 'I will use the documentation-expert to generate clear and concise documentation for your API.' <commentary>The documentation-expert is the right choice for creating high-quality technical documentation.</commentary></example> <example>Context: The project's documentation is outdated. user: 'Can you help me update our README file?' assistant: 'I'll use the documentation-expert to review and update the README with the latest information.' <commentary>The documentation-expert can help improve existing documentation.</commentary></example>
4+
color: cyan
5+
---
6+
7+
You are a Documentation Expert specializing in technical writing, documentation standards, and developer experience. Your role is to create, improve, and maintain clear, concise, and comprehensive documentation for software projects.
8+
9+
**This repository:** Canonical doc matrix is [AGENTS.md](../../AGENTS.md#documentation-map). The root [README.md](../../README.md) is the only project README—do not reintroduce a second index under `docs/`. Path-scoped authoring rules live in [.claude/rules/](../rules/).
10+
11+
Your core expertise areas:
12+
- **Technical Writing**: Writing clear and easy-to-understand explanations of complex technical concepts.
13+
- **Documentation Standards**: Applying documentation standards and best practices, such as the "Diátaxis" framework or "Docs as Code".
14+
- **API Documentation**: Generating and maintaining API documentation using standards like OpenAPI/Swagger.
15+
- **Code Documentation**: Writing meaningful code comments and generating documentation from them using tools like JSDoc, Sphinx, or Doxygen.
16+
- **User Guides and Tutorials**: Creating user-friendly guides and tutorials to help users get started with the project.
17+
18+
## When to Use This Agent
19+
20+
Use this agent for:
21+
- Creating or updating project documentation (e.g., README, CONTRIBUTING, USAGE).
22+
- Writing documentation for new features or APIs.
23+
- Improving existing documentation for clarity and completeness.
24+
- Generating documentation from code comments.
25+
- Creating tutorials and user guides.
26+
27+
## Documentation Process
28+
29+
1. **Understand the audience**: Identify the target audience for the documentation (e.g., developers, end-users).
30+
2. **Gather information**: Collect all the necessary information about the feature or project to be documented.
31+
3. **Structure the documentation**: Organize the information in a logical and easy-to-follow structure.
32+
4. **Write the content**: Write the documentation in a clear, concise, and professional style.
33+
5. **Review and revise**: Review the documentation for accuracy, clarity, and completeness.
34+
35+
## Documentation Checklist
36+
37+
- [ ] Is the documentation clear and easy to understand?
38+
- [ ] Is the documentation accurate and up-to-date?
39+
- [ ] Is the documentation complete?
40+
- [ ] Is the documentation well-structured and easy to navigate?
41+
- [ ] Is the documentation free of grammatical errors and typos?
42+
43+
## Output Format
44+
45+
Provide well-structured Markdown files with:
46+
- **Clear headings and sections**.
47+
- **Code blocks with syntax highlighting**.
48+
- **Links to relevant resources**.
49+
- **Images and diagrams where appropriate**.

.claude/rules/config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
globs: src/config/**
33
---
44

5+
Global rules: [AGENTS.md](../../AGENTS.md). Claude stack summary: [CLAUDE.md](../CLAUDE.md).
6+
57
# Rules — config
68

79
`src/config/` is the **environment boundary**: everything that varies between dev / staging / prod lives here and nowhere else.

.claude/rules/features.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
globs: src/features/**
33
---
44

5+
Global rules: [AGENTS.md](../../AGENTS.md). Claude stack summary: [CLAUDE.md](../CLAUDE.md).
6+
57
# Rules — features
68

79
Each feature (`auth`, `home`, `settings`, `user`, …) is a self-contained vertical slice.
@@ -12,6 +14,8 @@ src/features/<name>/
1214
screens/ # Screen components (route leaf nodes)
1315
components/ # Feature-private UI
1416
hooks/ # Feature-private React hooks (useLoginMutation, useMeQuery, …)
17+
types/ # Interfaces and type aliases (domain models; re-export schema types if useful)
18+
index.ts # Barrel — import from @/features/<name>/types
1519
services/ # API schemas (Zod) + mappers + service functions
1620
api/
1721
keys.ts # React Query key factory

.claude/rules/shared-components.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
globs: src/shared/components/**
33
---
44

5+
Global rules: [AGENTS.md](../../AGENTS.md). Claude stack summary: [CLAUDE.md](../CLAUDE.md).
6+
57
# Rules — shared/components
68

79
Components here are **stateless, themed primitives**. They form the UI kit used across all features.

.claude/rules/shared-services.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
globs: src/shared/services/**
33
---
44

5+
Global rules: [AGENTS.md](../../AGENTS.md). Claude stack summary: [CLAUDE.md](../CLAUDE.md).
6+
57
# Rules — shared/services
68

79
Infrastructure-level data layer. Split into two sub-trees:
@@ -28,5 +30,5 @@ shared/services/
2830

2931
## Must not
3032
- Do not import from `src/features/**` — this layer is feature-agnostic.
31-
- Do not put business logic or domain models here. Domain logic belongs in `src/features/<name>/services/`.
33+
- Do not put business logic or domain models here. Domain logic belongs in `src/features/<name>/services/`; domain **interfaces and type aliases** belong in `src/features/<name>/types/`.
3234
- Do not use Zustand stores inside this layer — pass data up via return values or callbacks.

.env.example

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
API_URL=http://localhost:3000
2+
# Dev: enables mock REST + pre-fills login (demo@example.com / password) on Auth screen
3+
USE_MOCK_API=true
4+
5+
# Optional: Sentry (https://docs.sentry.io/platforms/react-native/)
26
SENTRY_DSN=
7+
# Set to 1 to send events from __DEV__ builds (default: off)
8+
SENTRY_ENABLE_IN_DEV=0
9+
# 0–1, performance sampling in production (0 = traces off)
10+
SENTRY_TRACES_SAMPLE_RATE=0
11+
12+
# OTA / CodePush-style keys — see docs/OPERATIONS.md#over-the-air-updates (optional)
313
CODEPUSH_KEY_IOS=
4-
CODEPUSH_KEY_ANDROID=
5-
USE_MOCK_API=true
14+
CODEPUSH_KEY_ANDROID=

.github/CODE_OF_CONDUCT.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our pledge
4+
5+
We pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our standards
8+
9+
Examples of behavior that contributes to a positive environment:
10+
11+
- Using welcoming and inclusive language
12+
- Being respectful of differing viewpoints and experiences
13+
- Accepting constructive criticism gracefully
14+
- Focusing on what is best for the community
15+
16+
Examples of unacceptable behavior:
17+
18+
- Harassment, trolling, or insulting comments
19+
- Public or private harassment
20+
- Publishing others’ private information without permission
21+
22+
## Enforcement
23+
24+
Project maintainers may remove, edit, or reject contributions that violate this code. Violations may result in a temporary or permanent ban from the project spaces.
25+
26+
Reports may be sent to the maintainers via GitHub (e.g. direct message or issue, per project preference). Replace this section with a dedicated contact if you run a public fork.
27+
28+
## Attribution
29+
30+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.

.github/workflows/android-ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Android CI Build
22

3+
# Manual native release build (template). PR quality checks live in ci.yml.
34
on:
45
workflow_dispatch:
56

@@ -14,10 +15,11 @@ jobs:
1415
- name: Setup Node
1516
uses: actions/setup-node@v4
1617
with:
17-
node-version: 18
18+
node-version: '20'
19+
cache: npm
1820

19-
- name: Install packages
20-
run: npm install
21+
- name: Install dependencies
22+
run: npm ci
2123

2224
- name: Install JDK
2325
uses: actions/setup-java@v4

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
quality:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
cache: npm
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Biome
24+
run: npm run lint
25+
26+
- name: Typecheck
27+
run: npx tsc --noEmit
28+
29+
- name: Unit tests
30+
run: npm test
31+
32+
- name: Check icons registry
33+
run: npm run check:icons
34+
35+
- name: Check import paths
36+
run: npm run check:imports

0 commit comments

Comments
 (0)