An AI-powered educational companion mobile application built with Expo and React Native, facilitating interactive learning through conversational AI and structured study materials.
- Multi-Provider Support: Seamless integration with Anthropic Claude, Google Gemini, and OpenAI GPT models
- Conversational Learning: Natural language interactions for concept explanations and Q&A
- Smart Routing: Automatic provider selection based on user preferences and availability
- Streaming Responses: Real-time AI response streaming for enhanced user experience
- Flashcard Creation: AI-generated flashcards with technical definitions and simplified explanations
- Dual Explanations: Both complex and simplified versions for comprehensive understanding
- Subject Organization: Course-based flashcard collections with custom icons and colors
- Learning Status Tracking: New, learning, and mastered card progression
- Daily Learning Logs: Structured daily study sessions with completion tracking
- Session History: Persistent chat conversations for review and reference
- Learning Analytics: Comprehensive insights across different subjects and topics
- Activity Tracking: Detailed logging of study sessions and AI interactions
- Encrypted API Storage: Secure management of AI provider API keys
- Row Level Security: Database-level security ensuring user data isolation
- Real-time Sync: Cross-device synchronization with data privacy protection
- Expo SDK 54 / React Native 0.81
- TypeScript with comprehensive type safety
- Expo Router for nested navigation and routing
- Vercel AI SDK for unified AI provider abstraction
- Supabase (PostgreSQL) with real-time capabilities
- Supabase Auth for secure user authentication
- Row Level Security for data protection
- Zustand stores for complex state logic
- Moti for smooth, engaging animations
- React Query for server state management (planned)
- Jest with comprehensive test coverage
- ESLint & Prettier with Husky pre-commit hooks
- pnpm for efficient dependency management
- Expo Application Services (EAS) for builds and deployment
- Node.js 18+
- pnpm
- Expo CLI
- Supabase account for backend services
-
Clone the repository:
git clone https://github.com/umairrx/kogn cd kogn -
Install dependencies:
pnpm install
-
Environment Setup: Create a
.envfile with your API credentials:EXPO_PUBLIC_SUPABASE_URL=your-supabase-project-url EXPO_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key # AI Provider API Keys (optional - users can add their own) EXPO_PUBLIC_ANTHROPIC_API_KEY=your-anthropic-key EXPO_PUBLIC_OPENAI_API_KEY=your-openai-key EXPO_PUBLIC_GOOGLE_API_KEY=your-google-key
-
Database Setup:
- Create a new Supabase project at database.new
- Run the SQL migrations to set up the database schema
- Enable Row Level Security policies
-
Start the development server:
pnpm start
kogn/
βββ app/ # Main application screens
β βββ _layout.tsx # Root layout with navigation
β βββ index.tsx # Home screen with recent chats
β βββ login.tsx # Authentication screen
β βββ signup.tsx # User registration
β βββ forgot-password.tsx # Password recovery
β βββ (tabs)/ # Main tab navigation
βββ components/ # Reusable UI components
β βββ AuthGuard.tsx # Authentication protection
β βββ Logo.tsx # App branding component
β βββ QueryProvider.tsx # React Query provider
β βββ ThemeProvider.tsx # Theme management
β βββ auth/ # Authentication components
β βββ chat/ # Chat interface components
β βββ common/ # Shared UI components
β βββ settings/ # Settings and preferences
β βββ study/ # Study material components
βββ constants/ # Application constants
β βββ aiModels.ts # AI model configurations
β βββ chatConfig.ts # Chat settings
β βββ theme.ts # Theme definitions
βββ hooks/ # Custom React hooks
β βββ useAIModels.ts # AI model management
β βββ useAuthMutations.ts # Authentication operations
β βββ useChatApiKey.ts # API key handling
β βββ useChatError.ts # Error management
β βββ useChatModelSelection.ts # Model selection logic
β βββ useChatSession.ts # Chat session management
β βββ useChatSetup.ts # Chat initialization
β βββ useChatStyles.ts # Chat UI styling
β βββ useCopyToClipboard.ts # Clipboard operations
β βββ useFonts.ts # Font loading
β βββ useFormInputStyles.ts # Form styling
β βββ useMessageSync.ts # Message synchronization
β βββ useProviderApiKey.ts # Provider key management
β βββ useProviderModelSelection.ts # Provider selection
β βββ useScreenHeaderStyles.ts # Header styling
βββ stores/ # Global state management
β βββ appStore.ts # Application state
β βββ authStore.ts # Authentication state
β βββ ... # Additional stores
βββ supabase/ # Database configuration
βββ utils/ # Utility functions
βββ types/ # TypeScript definitions
βββ AGENTS.md # Agent documentation
βββ CLAUDE.md # Claude-specific documentation
βββ jest.config.js # Testing configuration
βββ setup-testing.js # Test setup
βββ polyfills.js # JavaScript polyfills
This project uses Supabase for authentication. Follow these steps to set up:
- Go to database.new to create a new Supabase project
- Wait for the project to be set up
- Go to your project's API settings in the Supabase dashboard
- Copy your Project URL and anon/public key
- Update the
.envfile with your credentials
- In your Supabase dashboard, go to Authentication > Providers
- Enable the "Email" provider
- Configure email templates if needed
Enable Row Level Security (RLS) in your Supabase database for secure data access and implement appropriate policies for your tables.
# iOS development build
eas build --platform ios --profile development
# Android development build
eas build --platform android --profile development# Production builds for app stores
eas build --platform ios --profile production
eas build --platform android --profile production
# Submit to app stores
eas submit --platform ios --profile production
eas submit --platform android --profile production# Publish updates to production
eas update --branch production- User registration/login via Supabase Auth
- Automatic profile creation with default preferences
- API key setup and validation for AI providers
- User selects AI provider and model from available options
- Chat session created with course context and metadata
- Messages exchanged with selected AI provider via Vercel AI SDK
- Responses parsed, stored, and displayed with streaming
- Session data synchronized across devices via Supabase
- AI generates contextual flashcards based on conversation topics
- Cards organized into subject-based decks with learning status
- Progress tracked through spaced repetition principles
- Daily logs created for comprehensive learning analytics
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is proprietary and part of a personal development portfolio.
Umair Khan
- LinkedIn: linkedin.com/in/m-umair-k
- Portfolio: umairrx.dev
- GitHub: github.com/umairrx
Built with β€οΈ to democratize AI-powered education