# Quick Start Guide
## π― What You Have
A complete, configurable authentication package for React Native apps using Mana Core.
## π¦ Package Location
```
/Users/wuesteon/memoro_new/mana-2025/storyteller-project/@mana-auth-mobile/
```
## β‘ Quick Usage (After Completion)
### 1. Install in Your App
```bash
# Local testing
cd @mana-auth-mobile && npm link
cd ../mobile && npm link @mana/auth-mobile
# Or from npm (after publishing)
npm install @mana/auth-mobile
```
### 2. Wrap Your App
```typescript
// app/_layout.tsx
import { ManaAuthConfigProvider, ManaAuthProvider } from '@mana/auth-mobile';
export default function RootLayout() {
return (
{/* Your app content */}
);
}
```
### 3. Use in Screens
```typescript
// app/login.tsx
import { ManaLoginScreen } from '@mana/auth-mobile';
export default function LoginScreen() {
return ;
}
```
```typescript
// Any screen
import { useManaAuth } from '@mana/auth-mobile';
function MyScreen() {
const { user, signOut, isAuthenticated } = useManaAuth();
if (!isAuthenticated) return ;
return (
Welcome {user?.name}!
);
}
```
## π§ What Still Needs to be Done
To complete the package, copy these files from storyteller and adapt them:
### Files to Copy:
1. **Services** (from `mobile/src/services/`)
- `authService.ts` β Adapt backend URL and storage keys to use config
- `tokenManager.ts` β No changes needed
2. **Components** (from `mobile/app/` and `mobile/components/molecules/`)
- `login.tsx` β `ManaLoginScreen.tsx` (adapt to use theme/text config)
- `GoogleSignInButton.tsx` β Adapt to use config
- `AppleSignInButton.tsx` β Adapt to use config
3. **Context** (from `mobile/src/contexts/`)
- `AuthContext.tsx` β `ManaAuthContext.tsx` (make Supabase/RevenueCat optional)
### Key Adaptations:
```typescript
// BEFORE (Hardcoded)
const BACKEND_URL = 'http://localhost:3002';
const title = 'MΓ€rchenzauber';
const buttonColor = '#FFCB00';
// AFTER (Configurable)
const { environment } = useManaAuthConfig();
const { text, theme } = useManaAuthConfig();
const BACKEND_URL = environment.backendUrl;
const title = text.appName;
const buttonColor = theme.colors.buttonPrimary;
```
## π Documentation Files
- **README.md** - User documentation for npm
- **IMPLEMENTATION_GUIDE.md** - Detailed step-by-step implementation
- **PACKAGE_SUMMARY.md** - Complete overview of the package
- **QUICK_START.md** - This file
## π¨ Configuration Examples
### Storyteller (German)
```typescript
```
### Memoro (English)
```typescript
```
## β
Benefits
- β
One codebase for all Mana apps
- β
App-specific branding through configuration
- β
Easy maintenance and updates
- β
Type-safe configuration
- β
Supports multiple languages
- β
No code changes in storyteller
## π Next Steps
1. Read **IMPLEMENTATION_GUIDE.md** for detailed instructions
2. Copy the service files and adapt them
3. Copy the component files and adapt them
4. Test locally with `npm link`
5. Publish to npm
6. Update all Mana apps to use the package
## π Package Structure
```
@mana-auth-mobile/
βββ π package.json # NPM configuration
βββ π tsconfig.json # TypeScript config
βββ π README.md # Public documentation
βββ π IMPLEMENTATION_GUIDE.md # Implementation steps
βββ π PACKAGE_SUMMARY.md # Complete overview
βββ π QUICK_START.md # This file
βββ π src/
βββ π config/ # Configuration system β
βββ π types/ # TypeScript definitions β
βββ π utils/ # Utilities β
βββ π services/ # Auth services β³ TO COPY
βββ π components/ # UI components β³ TO COPY
βββ π contexts/ # Auth context β³ TO COPY
βββ π index.ts # Main exports β
```
Legend:
- β
= Created and ready
- β³ = Needs to be copied from storyteller
## π‘ Pro Tips
1. **Test locally first** - Use `npm link` before publishing
2. **Use TypeScript** - It will catch configuration errors
3. **Start simple** - Use default theme/text, then customize
4. **One app at a time** - Migrate storyteller first, then others
5. **Keep storyteller working** - This package is separate, no impact on current code
## π€ Support
If you have questions:
1. Check IMPLEMENTATION_GUIDE.md
2. Look at the storyteller implementation as reference
3. All types are documented with JSDoc comments