Skip to content

Latest commit

 

History

History
90 lines (74 loc) · 4.23 KB

File metadata and controls

90 lines (74 loc) · 4.23 KB

Comic Collection Manager

Overview

A Flask-based web application for managing personal comic collections with barcode scanning capabilities. Users can scan comic book barcodes to automatically retrieve metadata, manually add comics, track collection statistics, and manage their personal libraries. The application provides a modern Bootstrap-based interface with user authentication and comprehensive collection management features.

User Preferences

Preferred communication style: Simple, everyday language.

System Architecture

Backend Architecture

  • Framework: Flask web framework with modular structure
  • Database: SQLAlchemy ORM with SQLite default (configurable via environment variables)
  • Authentication: Flask-Login for session management with password hashing
  • File Structure: Separated concerns with dedicated modules:
    • app.py: Application factory and configuration
    • models.py: Database models and relationships
    • routes.py: Route handlers and business logic
    • main.py: Application entry point

Frontend Architecture

  • Template Engine: Jinja2 templates with Bootstrap 5 dark theme
  • CSS Framework: Bootstrap with Replit dark theme integration
  • JavaScript: Vanilla JavaScript with Bootstrap components
  • Icons: Font Awesome for consistent iconography
  • Responsive Design: Mobile-first approach with responsive grid layout

Database Schema

  • User Model: Authentication and collection ownership
    • Primary key, username, hashed password, creation timestamp
    • One-to-many relationship with comics (cascade delete)
    • Collection statistics calculation methods
  • Comic Model: Comprehensive comic metadata storage
    • Title, series, issue number, publisher, publication date
    • Writer, artist, cover URL, description, ISBN
    • Foreign key relationship to User model

Authentication System

  • Session-based authentication using Flask-Login
  • Werkzeug password hashing for security
  • Login required decorators for protected routes
  • User loader function for session management
  • Redirect handling for unauthenticated access

Key Features Implementation

  • Barcode Scanning: Image upload and processing using pyzbar library (graceful fallback when unavailable)
  • ComicVine API Integration: Automatic metadata retrieval using ComicVine database for accurate comic information
  • Automatic Metadata Retrieval: Fallback APIs (OpenLibrary, Google Books) for additional comic information
  • Pricing and Value Tracking: User-input cost and value fields for collection management and investment tracking
  • Collection Statistics: Dynamic calculation of collection metrics
  • Export Functionality: Data export capabilities for collection backup including pricing data
  • Search and Filtering: Client-side and server-side search capabilities

External Dependencies

Python Libraries

  • Flask: Core web framework
  • Flask-SQLAlchemy: Database ORM and integration
  • Flask-Login: User session management
  • pyzbar: Barcode detection and decoding
  • PIL (Pillow): Image processing for barcode scanning
  • requests: HTTP client for external API calls
  • werkzeug: Security utilities and middleware

Frontend Dependencies

  • Bootstrap 5: CSS framework with dark theme
  • Font Awesome: Icon library
  • Bootstrap JavaScript: Interactive components

Database

  • SQLite: Default database (development)
  • PostgreSQL: Production database option via environment variables
  • Connection pooling and health checks configured

External APIs

  • ComicVine API: Primary source for comprehensive comic metadata using ComicVine's volume/issue structure
    • Search by Series Title and Issue Number with optional Volume Number
    • Volume Number specification for distinguishing multiple volumes of same series (e.g., Vol 1, Vol 2)
    • Retrieves writers, artists, publishers, descriptions, and cover images
    • Follows ComicVine API structure: Volume → Issues → Person Credits
  • Comic metadata APIs for barcode lookup and information retrieval (OpenLibrary, Google Books)
  • Image hosting services for cover art storage

Environment Configuration

  • Database URL configuration
  • Session secret management
  • Debug mode settings
  • Proxy fix middleware for deployment environments