mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 11:41:08 +02:00
Move inactive projects out of active workspace: - bauntown (community website) - maerchenzauber (AI story generation) - memoro (voice memo app) - news (news aggregation) - nutriphi (nutrition tracking) - reader (reading app) - uload (URL shortener) - wisekeep (AI wisdom extraction) Update CLAUDE.md documentation: - Add presi to active projects - Document archived projects section - Update workspace configuration Archived apps can be re-activated by moving back to apps/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
6.3 KiB
6.3 KiB
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
# 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
// app/_layout.tsx
import { ManaAuthConfigProvider, ManaAuthProvider } from '@mana/auth-mobile';
export default function RootLayout() {
return (
<ManaAuthConfigProvider
environment={{
backendUrl: 'https://your-backend.com',
googleClientId: 'your-google-client-id',
}}
theme={{
colors: { primary: '#FFCB00' },
}}
text={{
appName: 'My App',
}}
>
<ManaAuthProvider>
{/* Your app content */}
</ManaAuthProvider>
</ManaAuthConfigProvider>
);
}
3. Use in Screens
// app/login.tsx
import { ManaLoginScreen } from '@mana/auth-mobile';
export default function LoginScreen() {
return <ManaLoginScreen />;
}
// Any screen
import { useManaAuth } from '@mana/auth-mobile';
function MyScreen() {
const { user, signOut, isAuthenticated } = useManaAuth();
if (!isAuthenticated) return <LoginScreen />;
return (
<View>
<Text>Welcome {user?.name}!</Text>
<Button title="Sign Out" onPress={signOut} />
</View>
);
}
🔧 What Still Needs to be Done
To complete the package, copy these files from storyteller and adapt them:
Files to Copy:
-
Services (from
mobile/src/services/)authService.ts→ Adapt backend URL and storage keys to use configtokenManager.ts→ No changes needed
-
Components (from
mobile/app/andmobile/components/molecules/)login.tsx→ManaLoginScreen.tsx(adapt to use theme/text config)GoogleSignInButton.tsx→ Adapt to use configAppleSignInButton.tsx→ Adapt to use config
-
Context (from
mobile/src/contexts/)AuthContext.tsx→ManaAuthContext.tsx(make Supabase/RevenueCat optional)
Key Adaptations:
// 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)
<ManaAuthConfigProvider
environment={{
backendUrl: process.env.EXPO_PUBLIC_STORYTELLER_BACKEND_URL,
googleClientId: process.env.EXPO_PUBLIC_GOOGLE_CLIENT_ID,
enableGoogleSignIn: true,
enableAppleSignIn: true,
}}
theme={{
colors: {
primary: '#FFCB00',
buttonPrimary: '#FFCB00',
},
fonts: {
header: 'Grandstander_700Bold',
},
backgroundImage: require('../assets/images/marchenzauber-dadgirl.jpg'),
}}
text={{
appName: 'Märchenzauber',
loginTitle: 'Märchenzauber',
loginButton: 'Anmelden',
registerButton: 'Registrieren',
loginWithEmail: 'Mit E-Mail anmelden',
loginWithGoogle: 'Mit Google anmelden',
loginWithApple: 'Mit Apple anmelden',
emailPlaceholder: 'E-Mail Adresse eingeben...',
passwordPlaceholder: 'Passwort eingeben...',
forgotPassword: 'Passwort vergessen?',
backButton: 'Zurück',
}}
/>
Memoro (English)
<ManaAuthConfigProvider
environment={{
backendUrl: process.env.EXPO_PUBLIC_MEMORO_BACKEND_URL,
googleClientId: process.env.EXPO_PUBLIC_GOOGLE_CLIENT_ID,
}}
theme={{
colors: {
primary: '#0099FF',
buttonPrimary: '#0099FF',
},
backgroundImage: require('../assets/images/memoro-background.jpg'),
}}
text={{
appName: 'Memoro',
loginTitle: 'Welcome to Memoro',
loginButton: 'Sign In',
registerButton: 'Sign Up',
}}
/>
✅ 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
- Read IMPLEMENTATION_GUIDE.md for detailed instructions
- Copy the service files and adapt them
- Copy the component files and adapt them
- Test locally with
npm link - Publish to npm
- 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
- Test locally first - Use
npm linkbefore publishing - Use TypeScript - It will catch configuration errors
- Start simple - Use default theme/text, then customize
- One app at a time - Migrate storyteller first, then others
- Keep storyteller working - This package is separate, no impact on current code
🤝 Support
If you have questions:
- Check IMPLEMENTATION_GUIDE.md
- Look at the storyteller implementation as reference
- All types are documented with JSDoc comments