Skip to main content

Module responsibilities and dependencies

Use this diagram to decide where an API change belongs. VideoQ combines functions and modules by feature. The boxes below represent responsibilities; they do not imply that a class with each name exists.

What belongs where

LayerResponsibilityExample
Shared contractOperation names, inputs, outputs, and authentication requirementsName and color required to create a tag
HandlerConnects the Hono request to a servicePassing the authenticated user ID
ServiceCoordinates business operationsRegistering a video and requesting processing
RepositoryReads and writes data within the permitted scopeFetching the owner's tags
SchemaDefines tables, types, constraints, and indexesPreventing duplicate relationships

Keep Hono-specific values and DB connections out of shared contracts. Connect implementations through the API context. See tRPC API design.

Authentication and business data

Authentication accounts, sessions, and verification tokens use the Better Auth schema. Video, course, and tag owners are associated with users. This setup does not add a custom AuthSession class or legacy auth_sessions table.

See the data dictionary and ER diagrams for current tables and relationships.

Practice reading the implementation

The tag list walkthrough follows actual files in this order. When adding functionality, choose a similar existing feature and follow its division of responsibilities.