Skip to content

Database

The backend uses MySQL as its primary data store, accessed through the mysql2 driver.

Connection

Database configuration lives in config/ and is loaded from environment variables.

Models

Database models are located in the models/ directory. They encapsulate query logic and provide an abstraction layer over raw SQL.

Schema Reference

TODO

Document the main database tables, their relationships, and key fields. Consider linking to the schema definition in ai-specs/db-schema.d.ts.

Redis

Redis is used for:

  • Session/cache storage — via hapi-redis2
  • Job queues — via Bull

Envia Admin