Skip to main content

Adding a New Category Module

MTVL’s modular architecture makes adding custom tracking categories (e.g. Anime, Video Games, Podcasts, Board Games) fast and straightforward.
MTVL includes an automated code generator CLI:

What the Generator Creates

  1. PostgreSQL Migration: migrations/postgres/0000X_videogames.sql
  2. MySQL Migration: migrations/mysql/0000X_videogames.sql
  3. Module Package: internal/modules/videogames/
    • model.go (GORM models for catalog item & personal list entry)
    • repository.go (Database queries)
    • handler.go (HTTP handlers)
    • module.go (Implements core.CategoryModule)

Method B: Manual Module Implementation

If you are creating custom fields or unique business logic, follow these 4 steps:

Step 1: Create Goose DB Migrations

Create migrations/postgres/20261001000000_videogames.sql:

Step 2: Implement core.CategoryModule

Step 3: Register in main.go

In main.go, register your new module with the central registry:

Step 4: Register in Frontend (mtvl-frontend)

Add the frontend module config in src/modules/registry.ts: