johndoe6345789 8844c84259 test: Phase 2 complete - improve to 29.9% coverage
Settings components and feature workflows testing:
- Add OpenAISettingsCard.test.tsx: 24 tests for API key management
  - Test localStorage integration and persistence
  - Test visibility toggle for sensitive data
  - Test save/clear functionality with proper state management
  - Comprehensive accessibility coverage (aria-labels, aria-pressed, screen reader hints)

Database facade pattern (db.ts):
- Add 35 comprehensive unit tests covering:
  - Snippet operations (CRUD) with IndexedDB and Flask routing
  - Namespace operations and default namespace management
  - Template filtering and creation
  - Database operations (export, import, stats, validation)
  - Critical business logic: moveSnippetToNamespace, bulkMoveSnippets
  - Error handling and edge cases

Feature workflows (namespace manager):
- Add NamespaceSelector.test.tsx: 14 tests for namespace management
  - Loading and displaying namespace list
  - Creating namespaces with validation
  - Deleting namespaces and default fallback behavior
  - Toast notifications for user feedback
  - Error handling for database operations

Overall progress:
- Coverage: 21.88% → 29.9% (+8.02 percentage points)
- New test files: 6 (providers, PageLayout, page, db, OpenAISettings, NamespaceSelector)
- Total tests: 542 → 610+ passing

Key testing patterns established:
- Mock storage layer implementations for testing facade pattern
- Component state management testing with localStorage
- User interaction flows with userEvent.setup()
- Accessibility assertions (aria-labels, roles, semantic HTML)
- Error boundary and provider composition testing

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-20 20:51:19 +00:00
2026-01-17 14:23:21 +00:00
2026-01-17 14:23:21 +00:00
2026-01-17 14:23:21 +00:00
2026-01-17 14:23:21 +00:00
2026-01-17 14:23:21 +00:00

CodeSnippet - Code Snippet Manager

A powerful code snippet management application with flexible storage backends and an integrated component library showcase.

🚀 Quick Start

Choose the setup that works best for you:

docker-compose up -d

Access at: http://localhost:3000 (auto-configured with Flask backend)

Option 2: Local Development

# Start backend
docker-compose -f docker-compose.backend-only.yml up -d

# Configure frontend
echo "VITE_FLASK_BACKEND_URL=http://localhost:5000" > .env

# Start frontend
npm install
npm run dev

Access at: http://localhost:5173

Option 3: Frontend Only (No Backend)

npm install
npm run dev

Access at: http://localhost:5173 (uses local IndexedDB storage)

📖 See detailed setup instructions →

🔑 Key Features

  • 📝 Snippet Management - Create, edit, and organize code snippets with syntax highlighting
  • 🔍 Smart Search - Real-time search across title, description, language, and code
  • 👁️ Live Preview - Split-screen editor with live React component preview
  • 💾 Flexible Storage - Choose between local IndexedDB or Flask backend
  • 🔄 Auto-Configuration - Automatically use Flask backend via environment variable
  • 🗂️ Component Library - Showcase organized by atomic design principles
  • 📤 Export/Import - Backup and restore your entire database
  • 🎨 Beautiful UI - Modern dark theme with purple and cyan accents

🎯 Storage Backends

CodeSnippet supports two storage backends:

IndexedDB (Default)

  • Local browser storage
  • No server required
  • Perfect for personal use

Flask Backend (Optional)

  • Remote server storage
  • Multi-device sync
  • Requires Flask backend

🔧 Auto-Configuration:
Set VITE_FLASK_BACKEND_URL environment variable to automatically use Flask backend:

# .env file
VITE_FLASK_BACKEND_URL=http://localhost:5000

When set, the app automatically connects to Flask backend and disables manual configuration.

📖 Complete backend configuration guide →

📚 Documentation

Getting Started

Backend & Storage

Production Deployment

🛠️ Technology Stack

  • React 19 + TypeScript
  • SQL.js (SQLite in WebAssembly)
  • Flask (Python backend)
  • Monaco Editor (VS Code editor)
  • Framer Motion (animations)
  • Shadcn UI (component library)
  • Tailwind CSS (styling)

📄 License

The Spark Template files and resources from GitHub are licensed under the terms of the MIT license, Copyright GitHub, Inc.

Description
No description provided
Readme MIT 38 MiB
Languages
HTML 56%
TypeScript 32.2%
SCSS 9%
JavaScript 1.7%
CSS 0.8%
Other 0.3%