Skip to content

feat(generator): add NestJS project bootstrap layer (production-ready output) #6

Description

@dev-queiroz

Summary

Enhance the NestJS generator to produce a fully runnable backend project out-of-the-box.

Currently, the generator produces valid NestJS source code, but the output still requires manual setup (missing dependencies resolution, incomplete runtime configuration, and non-executable structure).

This issue introduces a project bootstrap layer, transforming Forge from a code generator into a fully operational backend project compiler.


Motivation

A modern backend generator must not only produce correct code, but also ensure the output is immediately usable.

The current limitation is:

  • Generated projects require manual npm install
  • Missing or incomplete dependency declarations
  • TypeScript configuration inconsistencies
  • No guarantee of runnable state

This reduces Forge's value as a production-grade system generator.


Goals

Transform NestJS generation into a fully bootstrapped project output:

forge generate nest

Should produce a ready-to-run NestJS project.


Requirements

1. Complete package.json generation

Must include all required dependencies:

  • @nestjs/common
  • @nestjs/core
  • @nestjs/platform-express
  • rxjs
  • reflect-metadata
  • typescript
  • ts-node-dev (dev)

2. Valid TypeScript configuration

Ensure:

  • correct rootDir
  • correct outDir
  • decorators enabled
  • strict mode compatibility
  • moduleResolution set correctly

3. Executable entrypoint

Ensure:

  • main.ts is valid and bootstrapped
  • app.module is correctly wired
  • NestFactory initialization is correct

4. Clean project structure

Output must be:

dist/backend/
  src/
  package.json
  tsconfig.json

5. Post-generation usability

The generated project must:

  • compile without manual fixes
  • be runnable with npm install && npm run start
  • not require external setup steps

Constraints

  • Do not introduce runtime features
  • Do not modify OpenAPI generator
  • Do not alter semantic model
  • Keep generator deterministic

Acceptance Criteria

  • Generated NestJS project runs without manual edits
  • package.json is complete and valid
  • TypeScript compiles without configuration errors
  • NestJS app boots successfully
  • Multiple contracts still generate correctly

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions