Testing phaseThis environment is in pre-launch testing — all data will be reset at launch.
Skip to content

Export ​

Export turns your Mockomat model into files you own. There are two formats:

FormatWhat you getAvailable on
OpenAPI specificationAn OpenAPI 3.0.3 YAML file with one schema per tableEvery plan with an account
Code packageA ZIP with a generated NestJS backend for your tablesProfessional and above

Code packages need the Editor role or higher and edit access to the project. Export never changes your project, and the generated code has no runtime dependency on Mockomat.

Screenshot ex-01-export-configScreenshot ex-01-export-config
ex-01-export-configMissing

Export wizard with the format and options steps.

Starting an Export ​

Open Export in the app. The export wizard walks you through four steps:

  1. Project — pick the project to export.
  2. Export format — OpenAPI specification or code package.
  3. Configure — the code package step shows the package your plan includes.
  4. Review & export — confirm. An OpenAPI file downloads at once; a code package is generated in the background and appears with a download link when it is ready.

If your app does not offer code packages yet, export the OpenAPI specification in the meantime.

Screenshot ex-01b-input-sourcesScreenshot ex-01b-input-sources
ex-01b-input-sourcesMissing

Export format selection: OpenAPI specification or code package.

OpenAPI Specification ​

The OpenAPI export writes your model as components.schemas: one schema per table, with its attributes as properties, required attributes, enum values and relations. It contains no paths. Use it to share the data model with other tools, or as the starting point of a contract your backend team implements.

Code Package ​

The code package is a generated project you can run, change and deploy yourself.

PackagePlansContents
ProProfessional, BusinessNestJS backend
EnterpriseEnterpriseNestJS backend + Angular frontend

What the Backend Contains ​

  • A NestJS application with a GraphQL API (code-first), one module per table: entity, resolver, service and input/output types.
  • Per table: a paginated list query with search, a query by ID, and mutations to create, update, delete and restore records.
  • TypeORM entities for MySQL / MariaDB.
  • Authentication: sign-in with JWT and a user module. On the first start, the backend creates an admin user and prints its password once in the console.
  • A Docker Compose file that starts MySQL and Redis, and a README with setup steps.

Today's generator has limits worth knowing before you plan with the code:

  • It targets MySQL / MariaDB and always includes authentication and the Docker Compose file. The database and option switches in the wizard do not change the package yet.
  • Relations between your tables are not generated. Add them to the generated entities and services yourself.
  • Generated columns accept empty values: the Required flag of an attribute is not applied yet.

Run It Locally ​

The README in the package lists the steps. In short, in the backend folder:

bash
npm install
cp .env.example .env    # then enter your database credentials
npm run migration:run
npm run start:dev

The backend expects a MySQL or MariaDB database and Redis.

Screenshot ex-02-generated-structureScreenshot ex-02-generated-structure
ex-02-generated-structureMissing

Generated backend project structure overview.

Before You Export ​

Run through the runtime validation checklist first. A clean model produces cleaner code:

  • Names follow your conventions — table and attribute names become class, type and field names.
  • Attribute types are right — they become column and GraphQL field types.
  • Searchable attributes become the search fields of the generated list query, and Sortable attributes are marked as sortable list columns.

Operations and parameters you designed in API Design shape your mock API; the generated backend comes with its own standard queries and mutations per table.

What to Review After Export ​

Module Boundaries and Naming ​

  • Does each module correspond to a table of your model?
  • Are module, service and resolver names consistent and meaningful?

Inputs and Validation ​

  • Do the create and update inputs contain the fields you expect?
  • Add validation for the fields your application requires — generated fields are optional.

Relations ​

  • Add the relations of your model to the generated entities, with the direction and cardinality you designed.
  • Load related records in the services the way your application needs.
Screenshot ex-02b-code-reviewScreenshot ex-02b-code-review
ex-02b-code-reviewMissing

Post-export code review checklist view.

Post-Export Handoff Checklist ​

  • Assign ownership by module — each module should have an owner responsible for extending it.
  • Mark what is generated — note which files are generated scaffolding and which need custom business logic.
  • Capture known gaps — business rules, external integrations and background jobs are not generated.
  • Commit a baseline — commit the generated code as your initial version and branch from there.
  • Configure environments — database connections, environment variables and deployment pipelines.
  • Test early — generated code compiles, but verify behavior with integration tests.
Screenshot ex-03-post-export-runScreenshot ex-03-post-export-run
ex-03-post-export-runMissing

First local run and verification checklist.

Code Ownership ​

The generated code is yours: no runtime dependency on Mockomat, no license fees on the output, no restriction on commercial use. Modify it, run it on your own servers or with any hosting provider, and share it with clients or partners.