How breaksmodded/mi_catalogo works
Project Type and Purpose
• This is a full-stack, single-page application for personal movie/series cataloging.
• Frontend: React + Vite, deployed on Vercel.
• Backend: FastAPI + SQLite, deployed on Render.
• Purpose: Let users browse, search, filter, annotate, rate, and get stats on their watched content, enriched via TMDb.
File Structure Analysis
• Top level:
• package.json & public/: React/Vite frontend
• db.sqlite3: local development database (backend)
• src/: React application code
• src/components/: UI pieces (Navbar, SectionRow, DetailModal, Filters, Resumen, etc.)
• src/context/: React contexts for language & notifications
• src/hooks/: custom hooks for translations, dynamic posters, caching
• src/i18n/: internationalization setup & language files
• src/utils/: helper functions (e.g., contentTranslation)
• README references an unshown backend/ directory with FastAPI entry point (main.py, routers, models)
README Insights
• Backend exposes REST endpoints for CRUD on movies, series, lists, tags
• Automatic TMDb integration for metadata
• Frontend consumes backend via environment-configured API URL
Main Components
a. Frontend SPA (React + Vite)
• UI Components (Navbar, Carousels, Modals, Filters, Charts)
• Context Providers (LanguageContext, NotificationContext)
• Custom Hooks (useTranslations, useDynamicPoster, cacheFetch)
• i18n Module (languages/en.js, languages/es.js)
b. Backend API (FastAPI)
• HTTP Server (uvicorn + FastAPI)
• Routers/Endpoints (movies, series, lists, tags, stats)
• Database Layer (SQLite via SQLModel/SQLAlchemy)
• External Service Client (TMDb API)
c. Data Store
• SQLite database
d. External Services
• TMDb REST API (metadata provider)
e. Users & Deployment
• User Browser
• Vercel (frontend hosting)
• Render (backend hosting)
Relationships & Data Flows
• User Browser → (HTTP/HTTPS) → Frontend SPA
• Frontend → (REST calls) → FastAPI Backend
• Backend → (SQL queries) → SQLite DB
• Backend → (HTTP calls) → TMDb API
• Backend → processes & returns JSON → Frontend
• Frontend → renders UI, updates Context, invokes Custom Hooks
Architectural Patterns & Principles
• SPA with client-side routing (React Router)
• Component-based UI (separation into reusable pieces)
• Context API for cross-cutting concerns (i18n, notifications)
• Custom hooks for encapsulating logic (data fetching, caching, translation)
• RESTful API backend with clear resource routers
• Layered separation: Presentation (React), Business Logic (FastAPI), Persistence (SQLite)
Final Advice
• Start broad: outline user → frontend → backend → database/external API.
• Drill down backend: routers, service layer, DB connector, TMDb client.