Skip to content

dot add service command #59

@mathieusouflis

Description

@mathieusouflis

Problem statement

After creating a microservices project, there is no way to add a new service and have it automatically linked to the gateway. Developers have to manually create the service directory and update the gateway config.

Proposed solution

Implement dot add service <name> in cmd/dot/cmd_add.go.

dot add service user-service --lang go --type rest-api
dot add service payment-service --lang typescript --framework nestjs
  1. Resolves the generator for the specified language + framework
  2. Runs generator.Apply(spec) scoped to <root>/services/<name>/
  3. Patches the gateway config to add the new service route (using AnchorGatewayRoute)
  4. Updates .dot/config.json with the new app entry

Alternatives considered

Re-use dot add module. Rejected — a service is a full app with its own spec and directory, not a module added to an existing app.

Area

Core

Additional context

Depends on: Microservices gateway generator, Multi-app engine support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions