Skip to content

amirb101/three-sided

Repository files navigation

πŸ“š Three-Sided Flashcard System

Welcome to Three-Sided - a comprehensive flashcard system with dual frontend architecture and AI-powered learning.

πŸ—οΈ System Overview

Three-Sided operates with two complete systems that share the same Firebase backend:

System URL Technology Status Use Case
Original / Vanilla JS βœ… Production Stable, proven
React /new/ React + Vite βœ… Production Modern, enhanced

πŸ”‘ Key Principle: 100% backwards compatibility - both systems work together seamlessly.

πŸš€ Quick Start

For Users

  • Try the React version: Visit /new/ for modern UI and AI features
  • Use the original: Visit / for the proven, stable interface
  • Mix and match: Create profiles/cards with either system

For Developers

πŸ“– Documentation

Complete technical documentation covering:

  • Card creation systems (old vs React)
  • Profile systems and compatibility
  • Search & discovery mechanics
  • Data flow diagrams
  • Troubleshooting guides

βš›οΈ src/README.md

React-specific documentation:

  • Component architecture
  • Development guidelines
  • Backwards compatibility rules
  • Build and deployment

🎯 Key Features

✨ Shared Features (Both Systems)

  • πŸ” Google Authentication - Shared user accounts
  • πŸ“š Flashcard Creation - Mathematical content with LaTeX
  • πŸ” Search & Discovery - Community flashcard browsing
  • πŸ‘€ User Profiles - Public profile pages with cards
  • πŸ’Ύ Same Backend - Shared Firebase collections

πŸ†• React Enhancements (/new/)

  • πŸ€– AI Integration - DeepSeek-powered hints and suggestions
  • 🎨 Modern UI - Responsive design with smooth animations
  • ⚑ Better Performance - Optimized loading and interactions
  • πŸ“± Enhanced UX - Improved navigation and user flow

πŸ”„ Backwards Compatibility

Both systems are fully compatible:

graph TD
    A[User] --> B{Choose System}
    B -->|Original /| C[Vanilla JS Interface]
    B -->|React /new/| D[React Interface]
    C --> E[Shared Firebase Backend]
    D --> E
    E --> F[Same Data & URLs]
    F --> G[/card/slug URLs work]
    F --> H[/profile/slug URLs work]
Loading

Examples:

  • Create profile with original system β†’ Cards work in React system βœ…
  • Create cards with React system β†’ Visible on original profile page βœ…
  • Same URLs work: /card/my-card-slug and /profile/my-username βœ…

πŸ—‚οΈ Firebase Collections

Shared Backend Structure

πŸ“ Firebase Collections
β”œβ”€β”€ πŸ“„ publicCards/         # Public flashcards (both systems)
β”œβ”€β”€ πŸ“„ profiles/            # User profiles (both systems)  
β”œβ”€β”€ πŸ“„ userToSlug/          # Profile slug mapping (both systems)
β”œβ”€β”€ πŸ“„ flashcards/          # Private cards (original system)
β”œβ”€β”€ πŸ“„ cards/               # Private cards (React system)
β”œβ”€β”€ πŸ“„ userUpvotes/         # Upvote tracking (both systems)
└── πŸ“„ automation*/         # Bot automation (admin only)

πŸ› οΈ Development

Local Development

# React development
cd src
npm install
npm run dev

# Original system (no build needed)
firebase serve

Deployment

# Build React version
cd src && npm run build

# Deploy everything
firebase deploy

Project Structure

three-sided/
β”œβ”€β”€ πŸ“‹ SYSTEM_ARCHITECTURE.md    # Complete system documentation
β”œβ”€β”€ πŸ“ public/                   # Original system + built React
β”‚   β”œβ”€β”€ πŸ“„ index.html            # Original flashcard creation
β”‚   β”œβ”€β”€ πŸ“„ search.html           # Original search system
β”‚   β”œβ”€β”€ πŸ“ card/                 # Shared card viewer  
β”‚   β”œβ”€β”€ πŸ“ profile/              # Shared profile pages
β”‚   └── πŸ“ new/                  # Built React application
β”œβ”€β”€ πŸ“ src/                      # React source code
β”‚   β”œβ”€β”€ βš›οΈ README.md             # React-specific docs
β”‚   β”œβ”€β”€ πŸ“ components/           # React components
β”‚   └── πŸ“ services/             # Business logic
β”œβ”€β”€ πŸ“ functions/                # Cloud Functions
β”œβ”€β”€ πŸ”’ firestore.rules          # Database security
└── βš™οΈ firebase.json            # Hosting configuration

🎯 System Philosophy

πŸ”„ Backwards Compatibility First

  • New features must work with old system
  • Old URLs must continue working
  • Same data schema across systems
  • Gradual migration, not replacement

πŸš€ Progressive Enhancement

  • Original system: Stable foundation
  • React system: Enhanced experience
  • Users choose based on preference
  • Both maintained and improved

πŸ€– AI-Powered Learning

  • DeepSeek integration for smart suggestions
  • Automated content generation
  • Enhanced learning experience
  • Fallback to manual when AI unavailable

πŸ†˜ Need Help?

πŸ“š Documentation

  1. System overview: This file
  2. Technical details: SYSTEM_ARCHITECTURE.md
  3. React development: src/README.md

πŸ› Common Issues

πŸ”§ Debug Steps

// Check profile exists
const userSlug = await db.collection('userToSlug').doc(userId).get();

// Check cards by user  
const userCards = await db.collection('publicCards').where('userId', '==', userId).get();

// Check card by slug
const card = await db.collection('publicCards').doc(slug).get();

🎯 Mission: Provide the best flashcard learning experience through dual-system architecture with seamless compatibility and AI enhancement.

πŸš€ Status: Production ready with both systems fully operational and compatible!

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors