Customization
Before adding a feature, find the two places that decide what appears in the back office. The application chooses its modules, and each module supplies the routes and pages that operators can open.
Open the application shell and find the routes and module registrations that determine what an operator sees. You will use those locations to add a feature of your own.
Info
This tutorial covers the monorepo layout (apps/mercato/src/). If you scaffolded a standalone app with create-mercato-app, see Create a standalone app – the concepts are the same but paths differ (src/ instead of apps/mercato/src/).
The starter project ships with a working admin experience under apps/mercato/src/. It renders a dashboard, login screens, and the auto-discovered modules that come from the packages you enable.

apps/mercato/src/app/page.tsx – public landing page shown before authentication.apps/mercato/src/app/(auth) – authentication routes, including the login screen.apps/mercato/src/app/(backend)/backend/layout.tsx – wraps every admin page with navigation, RBAC checks, and locale providers.apps/mercato/src/app/(backend)/backend/[[...slug]]/page.tsx – catch-all backend router. It resolves requests to auto-discovered module pages, then falls back to files you place under apps/mercato/src/modules/<module>/backend.apps/mercato/src/app/(frontend)/[[...slug]]/page.tsx – same mechanism for customer-facing pages. Frontend routes come from apps/mercato/src/modules/<module>/frontend.apps/mercato/src/modules – local overrides. Drop a folder matching a module id (for example, auth or inventory) to replace pages, APIs, or entities from packaged modules.The app boots with the core modules listed in apps/mercato/src/modules.ts. Each entry points to a package and can be overridden by placing files under apps/mercato/src/modules/<module>. When the CLI runs yarn generate, it scans enabled modules, merges overrides, and produces generated registries used by the runtime and admin UI.
packages/<pkg>/src/modules/<module>/frontend|backend.apps/mercato/src/modules/<module>/<area>/<path> overrides the packaged version.apps/mercato/src/app/(backend) and apps/mercato/src/app/(frontend) read the generated registry and dispatch to the resolved React component.Because everything flows through generated metadata, you can safely introduce new modules without touching the Next.js routers. For example, adding packages/inventory to modules.ts automatically exposes its backend pages at /backend/inventory/....
Every module – core or custom – uses a consistent set of files:
index.ts exports metadata (name, title, description, version).acl.ts exports a features array used by RBAC.di.ts registers services with the Awilix container.data/entities.ts defines MikroORM entities. Optional extensions live beside them in data/extensions.ts.data/validators.ts stores zod schemas for create/update operations.backend/* and frontend/* contain Next.js server components with optional *.meta.ts files.api/<method>/<path>.ts exposes API handlers. Each handler can include metadata for guards.This tutorial will build on the stock app by adding an Inventory module. Before diving into module authoring, make sure you can run the shell commands below and see the admin dashboard running locally:
yarn install
yarn generate
yarn db:migrate
yarn dev
With the dev server running, log in using the seeded admin credentials. You are ready to customise the app.
In a standalone app, open src/modules.ts. In the platform repository, start at apps/mercato/src/modules.ts. Pick an enabled module and follow one route into its source before creating a second route for the same job.