How kubernetes-bad/metachar works
Project Type & Purpose
• MetaChar is a full-stack application: It has both a backend (written in NestJS) and a frontend (React with TypeScript).
• It scrapes character data from supported sites (Chub and Janitor) and manages related assets (images, tags) while leveraging external services like MySQL (database), Minio (S3-like storage), and FlareSolverr (a request proxy).
File Structure
• The project is clearly divided into at least two major top-level directories: “backend” and “frontend.”
• The backend contains several modules (e.g., chars, chub, janitor, images, tags, s3) and a “lib” directory for shared API abstractions.
• The existence of Dockerfiles in both “backend” and “frontend,” along with a “docker-compose.yml” at the root, indicates containerization and orchestration.
• Configuration files (YAML files, environment examples) suggest that external dependencies (database, storage, proxy) are configurable and possibly replaceable.
README Insights
• The README describes the use of MySQL as the database, Minio for image storage, and FlareSolverr as a request proxy.
• It shows that the system is meant to be deployed in a Docker environment, echoing the modular containerized design.
• The instructions detail how to set up environment files for both backend and optionally separate the API backend from the frontend service.
a. Main Components:
• Frontend Service: A React application running in its container handling the user interface.
• Backend Service: A NestJS-based API server organized into separate modules:
• Chub Module (handles scraping and API endpoints for Chub-related character data)
• Janitor Module (handles scraping for Janitor content)
• Frontend Module (possibly for server-rendered endpoints or data for the frontend)
• Tags, Images, and S3 Modules (for managing associated data/assets)
• Core Shared Libraries in “lib” (contain integrations with external APIs like FlareSolverr).
• Database: MySQL, used by the backend for persistent storage.
• Storage: Minio (or S3 alternative) for image storage.
• External Service: FlareSolverr as the request proxy (enables the scraping mechanism).
b. Relationships & Interactions:
• The Frontend Service interacts with the Backend Service through defined API endpoints.
• The Backend Service, made up of various modules, fetches/saves data into the MySQL database.
• For image handling, backend components communicate with the S3/Minio storage.
• Scraping operations in the Chub and Janitor modules are facilitated by calls to external APIs, such as FlareSolverr.
• The Docker Compose file shows these services are orchestrated together, so data flow between containers (e.g., backend calling database/storage/proxy) must be represented.
c. Architectural Patterns & Principles:
• Modular Design: Each backend module (e.g., chub, janitor, tags) encapsulates its own responsibilities.
• Separation of Concerns: Frontend and backend are separated, with clear API contracts.
• Containerization: Use of Docker for isolated services and clear dependency boundaries.
• Configuration Flexibility: External configuration via environment files and YAML files allows for pluggable components.
d. Key Technologies/Frameworks:
• NodeJS and NestJS for the backend.
• React with TypeScript for the frontend.
• MySQL for the database.
• Minio for object storage.
• Docker and Docker Compose for container orchestration.
• FlareSolverr to bypass request challenges (used by scraper modules).