Skip to main content
Fusioncat is currently in its alpha stage. The main API server is located at: https://api.staging.fusioncatalyst.io/Please note that breaking changes and bugs are to be expected, as the product is still under active development.

Code Generation Commands

The paw codegen commands allow you to generate code in multiple programming languages from your FusionCatalyst project definitions.

Commands

codegen app

Generate code for a specific application.

Options

Currently only Golang codegeneration is properly implemented and tested.
  • --app-id (required): The ID of the application to generate code for
  • --language: Target programming language (overrides settings file)
    • typescript
    • python
    • java
    • go

Examples

Supported Languages

TypeScript

  • Use cases: Node.js backends, React/Angular/Vue frontends
  • Features: Full type safety, interfaces, async/await
  • Output: TypeScript definitions and helper functions

Python

  • Use cases: Django/FastAPI backends, data processing
  • Features: Type hints, dataclasses, async support
  • Output: Python classes and type definitions

Java

  • Use cases: Spring Boot, enterprise applications
  • Features: POJOs, builders, validation annotations
  • Output: Java classes with getters/setters

Go

  • Use cases: Microservices, high-performance backends
  • Features: Structs, interfaces, channels
  • Output: Go structs and interfaces

Generated Code Structure

TypeScript Example

For a User schema:

Python Example

Configuration

Language Settings

Set default language in settings file:
Or in fcsettings.json:

Output Directory

Generated code is placed in:
  • ./fusioncant/ - Default output directory

Code Generation Workflow

1. Initial Generation

2. Development

  1. Generated code provides the foundation
  2. Add business logic on top
  3. Don’t modify generated files directly

3. Schema Updates

Integration Patterns

Separate Generated Code

Keep generated code separate from business logic:

Extend Generated Classes

Best Practices

Version Control

  1. Commit generated code: Include in version control
  2. Mark as generated: Add headers indicating files are generated
  3. Regenerate in CI: Ensure consistency

Continuous Generation

Multiple Apps

Generate different code for different apps:

Examples

Full Stack Application

Microservices

Event-Driven System

Troubleshooting

Missing Dependencies

Generated code may require additional packages:

Schema Compatibility

When updating schemas:
  1. Consider backward compatibility
  2. Use schema versioning
  3. Update dependent apps gradually

Code Conflicts

If regeneration causes conflicts:
  1. Review schema changes
  2. Check for breaking changes
  3. Update business logic accordingly
  • Apps - Create applications to generate code for
  • Schemas - Define schemas for code generation
  • Projects - Manage projects containing apps