Skip to content

chaosweasl/cognify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Cognify

AI-Powered Spaced Repetition Study Platform
Transform your learning with AI-generated flashcards and proven spaced repetition algorithms

Next.js 15 Supabase TypeScript Tailwind CSS


✨ Features

πŸ€– AI-Powered Content Generation

  • Multi-Provider Support: OpenAI, Anthropic, Ollama, LM Studio, DeepSeek, and custom endpoints
  • BYO API Keys: Secure client-side key storage - never stored on our servers
  • PDF to Flashcards: Extract and generate study materials from any PDF document
  • Intelligent Parsing: Advanced content chunking and context-aware generation

πŸ“š Spaced Repetition System (SRS)

  • Evidence-Based Algorithms: Optimized intervals based on memory science
  • Adaptive Learning: Personalized scheduling based on your performance
  • Progress Tracking: Detailed analytics on learning patterns and retention
  • Study Sessions: Structured practice with immediate feedback

🎯 Study Management

  • Project Organization: Group flashcards by subject or topic
  • Flexible Import/Export: JSON, CSV, and Anki-compatible formats
  • Duplicate Detection: Smart identification of similar content
  • Bulk Operations: Efficient management of large flashcard collections

πŸ”’ Security & Privacy

  • Row Level Security (RLS): Database-level user isolation
  • Client-Side Keys: API keys stored locally, never on servers
  • Open Source: Full transparency and community-driven development
  • Self-Hostable: Deploy on your own infrastructure

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and pnpm
  • Supabase account and project
  • AI Provider API key (OpenAI, Anthropic, etc.)

Installation

  1. Clone and Install

    git clone https://github.com/chaosweasl/cognify.git
    cd cognify
    pnpm install
  2. Environment Setup

    cp .env.example .env.local

    Configure your environment variables:

    NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
    SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
  3. Database Setup

    # Run migrations in your Supabase dashboard or via CLI
    # Schema is provided in schema-dump.sql
  4. Development Server

    pnpm dev

    Visit http://localhost:3000


πŸ”§ Configuration

AI Providers Setup

Cognify supports multiple AI providers. Set up your preferred provider:

  1. Navigate to Settings β†’ AI Configuration
  2. Choose Provider: OpenAI, Anthropic, Ollama, etc.
  3. Enter API Key: Stored securely in your browser's localStorage
  4. Test Connection: Verify your configuration works

BYO (Bring Your Own) API Keys Model

  • βœ… Your Keys, Your Control: API keys never leave your browser
  • βœ… No Usage Limits: Use your own quotas and billing
  • βœ… Provider Choice: Switch between providers anytime
  • ⚠️ Security Notice: Keys are stored in localStorage - clear them when using shared computers

πŸ“– Usage Guide

Creating Your First Study Set

  1. Create a Project: Organize flashcards by topic
  2. Add Content:
    • Upload PDF documents for AI generation
    • Import JSON/CSV files
    • Create flashcards manually
  3. Review & Edit: Preview AI-generated content before saving
  4. Start Studying: Begin spaced repetition sessions

Study Workflow

  1. Study Session: Practice flashcards with SRS scheduling
  2. Self-Assessment: Rate difficulty (Easy/Medium/Hard)
  3. Progress Tracking: Monitor retention and performance
  4. Adaptive Scheduling: System adjusts based on your responses

πŸ—οΈ Architecture

Tech Stack

  • Frontend: Next.js 15 (App Router), React 18, TypeScript
  • Backend: Supabase (PostgreSQL, Auth, RLS)
  • Styling: Tailwind CSS, ShadCN/ui components
  • AI Integration: Multi-provider support with client-side calls
  • State Management: Zustand for global state
  • Deployment: Vercel-ready, self-hostable

Project Structure

cognify/
β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”œβ”€β”€ (main)/            # Authenticated routes
β”‚   β”œβ”€β”€ api/               # API endpoints
β”‚   └── auth/              # Authentication pages
β”œβ”€β”€ components/            # Reusable UI components
β”œβ”€β”€ hooks/                 # Custom React hooks
β”œβ”€β”€ lib/                   # Core libraries
β”‚   β”œβ”€β”€ ai/               # AI provider integrations
β”‚   β”œβ”€β”€ srs/              # Spaced repetition logic
β”‚   └── supabase/         # Database utilities
└── src/                   # Feature components

🀝 Contributing

We welcome contributions! This project follows a BYO (Bring Your Own) AI model for security and flexibility.

Development Workflow

  1. Fork & Clone: Create your feature branch
  2. Install Dependencies: pnpm install
  3. Start Development: pnpm dev
  4. Run Tests: pnpm test (when available)
  5. Type Check: npx tsc --noEmit
  6. Submit PR: Include tests and documentation

Key Development Notes

  • Security First: Never store API keys server-side
  • RLS Compliance: All database operations respect Row Level Security
  • Draft-First UX: AI-generated content requires user acceptance
  • Provider Agnostic: Support multiple AI providers equally

πŸ”’ Security & API Keys

Our Approach

  • No Server Storage: API keys remain in your browser's localStorage
  • Explicit Consent: Clear warnings before persisting keys locally
  • Ephemeral Mode: Use keys without saving for maximum security
  • Open Source: Full code transparency for security auditing

Best Practices

  • πŸ”‘ Use API Keys with Limited Scope: Create keys with minimal permissions
  • πŸ”„ Rotate Keys Regularly: Update keys periodically for security
  • 🧹 Clear Keys on Shared Devices: Remove keys from localStorage when done
  • πŸ“± Use Device-Specific Keys: Different keys for different devices

πŸ“Š Roadmap

Current Status: BYO AI-First MVP

  • βœ… Multi-provider AI integration
  • βœ… PDF to flashcard generation
  • βœ… Spaced repetition system
  • βœ… Secure key management

Coming Soon

  • πŸ”„ Cheatsheet & Quiz Generation: Beyond just flashcards
  • πŸ“š Documentation Site: Copy/paste prompts for non-developers
  • 🌐 CORS Fallback: Manual workflow when browser calls fail
  • πŸ“± Mobile App: React Native application
  • πŸ”Œ Browser Extension: Quick content capture

Future Enhancements

  • YouTube Integration: Generate content from video transcripts
  • Collaboration: Share study sets and team learning
  • Advanced Analytics: ML-powered learning insights
  • Community Marketplace: Share and discover study materials

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Spaced Repetition Research: Built on decades of memory science
  • Open Source Community: ShadCN/ui, Tailwind CSS, and countless libraries
  • AI Providers: OpenAI, Anthropic, and the broader AI community
  • Early Users: Thank you for testing and providing feedback

πŸ“ž Support


Transform your learning with AI-powered spaced repetition. Start studying smarter, not harder. πŸš€

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •