Skip to content
Empire Builder KitDocumentation
v1 Documentation

Find your next step.

Search the complete documentation, including code examples.

    Full-text search↑ ↓ navigate Enter open
    Browse documentation
    DocsGuides

    Add a Product Slice

    Add a Slice when you start a new product, or when a capability needs its own data and its own deployment.

    On this page
    1. Generate the Slice
    2. Make it yours
    3. Verify

    Generate the Slice

    bash
    pnpm nx g @empire-builder-kit/nx:slice billing

    The name becomes the package directory (packages/billing), the Nx project name and the path the Router serves the Slice at.

    Make it yours

    1. Replace the home page in web/src/app/page.tsx and update its test in page.spec.tsx.
    2. Replace the example records in data/records.ts with your product’s data.
    3. Add handlers beside api/health.ts and api/protected.ts. Use protected.ts as the pattern for anything that needs a signed-in user.
    4. Export the types other projects may rely on from contracts/index.ts.

    All four are seeded files, so they are yours to edit. Slice files shows which files are managed.

    Verify

    bash
    pnpm nx run billing:verify
    pnpm verify

    The first command checks the new Slice. The second checks the whole workspace before you commit.