Developing Modules
Overview
Open Game Backend is built from the ground up to enable as many game developers as possible to write backend code & modify existing modules.
Components
Modules have access to the following core components:
- Scripts Scripts are used to write TypeScript & Deno code that runs on the backend. Request & response types are automatically validated.
- Database Modules can write database schemas, query data from scripts with type safety, and automatically create + migrate databases.
- User-Provided Config Modules can allow projects to pass configuration options to the module.
- Errors Modules specify the types of errors that can occur in their scripts.
File structure
Required
module.json
Module configuration file. Documentationscripts/
*.ts
Script to run on the backend. Documentation
db/
(optional) Database-related files. Documentationschema.prisma
Database schema.migrations/
Database migrations auto-generated fromschema.prisma
. This directory should not be manually modified unless you know what you are doing.
config.ts
(optional) Defines user-provided config schema. Documentationpublic.ts
(optional) Exports shared functions & types across modules. Documentation