Final cleanup of references missed in previous rename commits: - Dockerfiles: PUBLIC_MANA_CORE_AUTH_URL → PUBLIC_MANA_AUTH_URL - Go modules: github.com/manacore/* → github.com/mana/* (7 go.mod files) - launchd plists: com.manacore.* → com.mana.* (14 files renamed + content) - Image assets: *_Manacore_AI_Credits* → *_Mana_AI_Credits* (11 files) - .env.example files: ManaCore brand strings → Mana - .prettierignore: stale apps/manacore/* paths → apps/mana/* - Markdown docs (CLAUDE.md, /docs/*): mana-core-auth → mana-auth, etc. Excluded from rename: .claude/, devlog/, manascore/ (historical content), client testimonials, blueprints, npm package refs (@mana-core/*). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4.3 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
This is the mobile app within the "picture" monorepo. It's an Expo React Native application built with TypeScript, using Expo Router for navigation and NativeWind (Tailwind CSS) for styling. The app integrates with a NestJS backend for all API calls and uses Zustand for state management.
Monorepo Structure
This app is part of a PNPM workspace monorepo:
picture/
├── apps/
│ ├── backend/ # NestJS API server
│ ├── mobile/ # This React Native app (Expo)
│ ├── web/ # SvelteKit web app
│ └── landing/ # Astro landing page
├── packages/
│ └── shared/ # Shared code (TypeScript types, utilities)
└── pnpm-workspace.yaml
Shared Package (@picture/shared)
The shared package provides:
- Database Types - TypeScript types from database schema
- Shared Utilities - Common helper functions and types
Import from shared package:
import type { Database } from '@picture/shared/types';
Development Commands
⚠️ WICHTIG: Alle Commands müssen vom Root-Verzeichnis ausgeführt werden!
Running the App
pnpm dev:mobile- Start mobile dev server (from root)pnpm dev:web- Start web dev server (from root)pnpm dev:landing- Start landing page dev server (from root)pnpm dev- Start ALL apps in parallel (from root)
Building for Deployment
pnpm build:mobile- Build mobile app via EAS Buildpnpm build:web- Build web apppnpm build:landing- Build landing pagepnpm build- Build all apps
Code Quality
pnpm lint- Run ESLint and Prettier checks (all apps)pnpm type-check- Run TypeScript checks (all apps)
Other Commands
pnpm install- Install dependencies for all workspace packagespnpm clean- Remove all node_modules and build artifacts
Architecture & Structure
Navigation
The app uses Expo Router (file-based routing):
app/_layout.tsx- Root layout with Stack navigatorapp/(tabs)/_layout.tsx- Tab navigator with two tabsapp/(tabs)/index.tsx- First tab screenapp/(tabs)/two.tsx- Second tab screenapp/modal.tsx- Modal screen
State Management
Zustand store in store/store.ts - Currently contains a sample "bears" store that should be replaced with actual app state.
Backend Integration
All API calls go through the NestJS backend:
import { fetchApi } from '~/services/api/client';
import { getRateLimits } from '~/services/api/profiles';
import { generateImage } from '~/services/api/generate';
- API client configured with JWT authentication via
@mana/shared-auth - Environment variables managed at root level
- Database is PostgreSQL accessed through the backend
API Services
Located in services/api/:
client.ts- Base API client with auth handlingimages.ts- Image CRUD operationsgenerate.ts- Image generation endpointsmodels.ts- AI model endpointsprofiles.ts- User profile and rate limitstags.ts- Image tagging
Styling
- NativeWind (Tailwind CSS for React Native) configured
- Global styles in
global.css - Tailwind config in
tailwind.config.js
UI Components
- WICHTIG: Immer
Pressableverwenden, NICHTTouchableOpacityPressablebietet bessere Performance und mehr Flexibilität- Unterstützt
pressedState für visuelle Feedbacks - Beispiel:
<Pressable onPress={handlePress} className={({ pressed }) => `${pressed ? 'opacity-70' : 'opacity-100'}`} > <Text>Button</Text> </Pressable>
Key Dependencies
- Navigation: expo-router, react-navigation
- UI: NativeWind, @expo/vector-icons
- Auth: @mana/shared-auth
- State: zustand
- Development: expo-dev-client for custom native builds
Environment Variables
Required environment variables (in .env or similar):
EXPO_PUBLIC_API_URL- Backend API URLEXPO_PUBLIC_MIDDLEWARE_API_URL- Auth middleware URL
EAS Build Configuration
The project is configured for EAS Build with:
- Development builds with dev client
- Preview builds for internal distribution
- Production builds with auto-incrementing version numbers
- Project ID:
a74891be-7ff7-420c-9ff0-d33c37a59e5a