UNPKG

@autobe/compiler

Version:

AI backend server code generator

7 lines 12.5 kB
export const AutoBeCompilerCommonTemplate: Record<string, string> = { ".eslintrc.cjs": "module.exports = {\n root: true,\n plugins: [\"@typescript-eslint\", \"deprecation\"],\n extends: [\"plugin:@typescript-eslint/recommended\"],\n parser: \"@typescript-eslint/parser\",\n parserOptions: {\n project: [\"tsconfig.json\", \"test/tsconfig.json\"],\n },\n overrides: [\n {\n files: [\"src/**/*.ts\", \"test/**/*.ts\"],\n rules: {\n \"@typescript-eslint/consistent-type-definitions\": \"off\",\n \"@typescript-eslint/no-empty-function\": \"off\",\n \"@typescript-eslint/no-empty-interface\": \"off\",\n \"@typescript-eslint/no-explicit-any\": \"off\",\n \"@typescript-eslint/no-inferrable-types\": \"off\",\n \"@typescript-eslint/no-namespace\": \"off\",\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\n \"@typescript-eslint/no-unused-expressions\": \"off\",\n \"@typescript-eslint/no-unused-vars\": \"off\",\n \"@typescript-eslint/no-var-requires\": \"off\",\n \"@typescript-eslint/no-floating-promises\": \"error\",\n \"@typescript-eslint/no-require-imports\": \"off\",\n \"@typescript-eslint/no-empty-object-type\": \"off\",\n \"@typescript-eslint/prefer-as-const\": \"off\",\n \"prefer-as-const\": \"off\",\n },\n },\n ],\n};\n", ".gitignore": "./autobe/\nbin/\ndist/\nlib/\nnode_modules/\n\nprisma/migrations\nprisma/schema/migrations\nprisma/bbs.db\n\n*.DS_Store\n.env\n.npmrc\npackage-lock.json\npnpm-lock.yaml", "LICENSE": "MIT License\n\nCopyright (c) 2025 Wrtn Technologies\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.", "README.md": "# AutoBE Generated Backend Server\n\n![AutoBE Logo](https://github.com/user-attachments/assets/a90d14be-fd50-4dc7-ae9d-ca66c2124f31)\n\nA backend repository generated by [`@autobe`](https://github.com/wrtnlabs/autobe).\n\nThis backend program was automatically generated using [`@autobe`](https://github.com/wrtnlabs/autobe), the AI vibe coding agent for backend servers of below stack.\n\n- TypeScript\n- NestJS / Nestia\n- Prisma\n- Postgres\n\n```mermaid\nflowchart\nsubgraph \"Backend Coding Agent\"\n coder(\"Facade Controller\")\nend\nsubgraph \"Functional Agents\"\n coder --\"Requirements Analysis\"--> analyze(\"{{ANALYSIS_EMOJI}} Analyze\")\n coder --\"ERD\"--> prisma(\"{{PRISMA_EMOJI}} Prisma\")\n coder --\"API Design\"--> interface(\"{{INTERFACE_EMOJI}} Interface\")\n coder --\"Test Codes\" --> test(\"{{TEST_EMOJI}} Test\")\n coder --\"Main Program\" --> realize(\"{{REALIZE_EMOJI}} Realize\")\nend\nsubgraph \"Compiler Feedback\"\n prisma --\"validates\" --> prismaCompiler(\"Prisma Compiler\")\n interface --\"validates\" --> openapiValidator(\"OpenAPI Validator\")\n interface --\"generates\" --> tsCompiler(\"TypeScript Compiler\")\n test --\"validates\" --> tsCompiler(\"TypeScript Compiler\")\n realize --\"validates\" --> tsCompiler(\"TypeScript Compiler\")\nend\n```\n\nAlso, this backend application was built following [`@autobe`](https://github.com/wrtnlabs/autobe)'s waterfall development model, where each specialized AI agent handles a specific phase of development. The process ensures 100% working code through continuous compiler feedback and validation at every stage.\n\nEach agent receives input from previous phases and produces validated output that becomes the foundation for the next development stage. The **Facade Controller** orchestrates the entire process, while **Functional Agents** handle specialized tasks with built-in **Compiler Feedback** ensuring code quality and correctness.\n\nBelow table shows the mapping between waterfall phases, corresponding [`@autobe`](https://github.com/wrtnlabs/autobe) agents, and the actual deliverables you can find in this repository:\n\nWaterfall Model | AutoBe Agent | Result\n----------------|--------------|----------------------------------------------\nRequirements | ✅ Facade | Conversation History\nAnalysis | {{ANALYSIS_EMOJI}} Analyze | [Requirement Analysis Report](docs/analysis)\nDesign | {{PRISMA_EMOJI}} Prisma | [Entity Relationship Diagram](docs/ERD.md) / [Prisma Schema](prisma/schema)\nDesign | {{INTERFACE_EMOJI}} Interface | [API Controllers](src/controllers) / [DTO Structures](src/api/structures)\nDevelopment | {{REALIZE_EMOJI}} Realize | [API Provider Functions](src/providers)\nTesting | {{TEST_EMOJI}} Test | [E2E Test Functions](test/features/api)\nMaintenance | - | Use Claude Code like AI coding tool please\n\n## Project Structure\n\nThis template project has categorized directories like below.\n\nAs you can see from the below, all of the Backend source files are placed into the [src](src/) directory. When you build the TypeScript source files, compiled files would be placed into the `lib` directory following the [`tsconfig.json`](tsconfig.json) configuration. Otherwise you build client [SDK library](https://nestia.io/docs/sdk/) for npm publishing and their compiled files would be placed into the [`packages`](packages) directory.\n\n - [`packages/api/`](packages/api): SDK module built by `npm run build:api`\n - [`docs/`](docs/): Documentation directory\n - [`docs/analysis`](docs/analysis/): Requirement Analysis report\n - [`docs/ERD.md`](docs/ERD.md): Entity Relationship Diagram and detailed descriptions\n - [`prisma/schema`](prisma/schema): Prisma ORM schema files\n - [`src/`](src): Backend source directory\n - [`src/api/`](src/api/): Client SDK that would be published to the `@ORGANIZATION/PROJECT-api`\n - [`src/api/functional/`](src/api/functional/): API functions generated by the [`nestia`](https://github.com/samchon/nestia)\n - [`src/api/structures/`](src/api/structures/): DTO structures\n - [`src/controllers/`](src/controllers/): Controller classes of the Main Program\n - [`src/providers/`](src/providers/): Implementations of the API functions\n - [`test/`](test): Test Automation Program\n - [`test/features`](test/features): List of test functions\n - [`nestia.config.ts`](nestia.config.ts): Configuration file of [`nestia`](https://github.com/samchon/nestia)\n - [`package.json`](package.json): NPM configuration\n - [`tsconfig.json`](tsconfig.json): TypeScript configuration for the main program\n\n## NPM Run Commands\n\nList of the run commands defined in the [package.json](package.json) are like below:\n\n - Test\n - **`test`**: Run test automation program\n - `benchmark`: Run performance benchmark program\n - Build\n - `build`: Build everything\n - `build:main`: Build main program (`src` directory)\n - `build:test` Build test automation program (`test` directory)\n - `build:sdk`: Build SDK into main program only\n - `build:swagger`: Build Swagger Documents\n - **`dev`**: Incremental build for development (test program)\n - Deploy\n - `package:api`: Build and deploy the SDK library to the NPM\n - `start`: Start the backend server\n - `start:dev`: Start the backend server with incremental build and reload\n - Webpack\n - `webpack`: Run webpack bundler\n - `webpack:start`: Start the backend server built by webpack\n - `webpack:test`: Run test program to the webpack built\n\n## Specialization\n\nTransform this template project to be yours.\n\nWhen you've created a new backend project through this template project, you can specialize it to be suitable for you by changing some words. Replace below words through IDE specific function like `Edit > Replace in Files` (*Ctrl + Shift + H*), who've been supported by the VSCode.\n\n| Before | After\n|--------------|----------------------------------------\n| ORGANIZATION | Your account or corporation name\n| PROJECT | Your own project name\n| AUTHOR | Author name\n| https://github.com/samchon/nestia-start | Your repository URL\n\n## Benchmark\n\n### Aggregate\n\nPhase | Generated | FCSR | Token Consumption | Elapsed Time\n------|-----------|------|-------------------|--------------\n{{BENCHMARK_AGGREGATE}}\n\nThis table shows the comprehensive metrics for each phase of the AutoBE generation pipeline. For each phase (Analyze, Prisma, Interface, Test, Realize), it tracks:\n\n- **Phase**: The pipeline phase with success (✅) or failure (❌) indicator\n- **Generated**: Count of artifacts produced (e.g., actors, documents, namespaces, models, operations, schemas, functions)\n- **FCSR**: Function calling success rate\n- **Token Consumption**: Total number of LLM tokens consumed during the phase\n- **Elapsed Time**: Wall-clock time taken to complete the phase, including all AI agent operations and compiler feedback loops\n\nThese aggregate metrics provide visibility into the computational cost and time requirements of the entire generation process, helping identify resource-intensive phases and overall pipeline efficiency.\n\n### Function Calling\n\nType | Trial | Validation Failure | JSON Parse Error | Success | Success Rate\n:----|------:|-------------------:|-----------------:|---------:|-------------:\n{{BENCHMARK_FUNCTION_CALLING}}\n\nThis table shows the reliability and quality metrics for AI agent function calling operations across all phases. Each row represents a specific operation type (e.g., `analyzeScenario`, `prismaSchema`, `realizeWrite`), tracking:\n\n- **Type**: The AI agent operation name\n- **Trial**: Total number of function calling attempts made by the agent\n- **Validation Failure**: Calls that produced valid JSON but failed type validation\n- **JSON Parse Error**: Calls that produced malformed JSON that couldn't be parsed\n- **Success**: Calls that completed successfully with valid, validated responses\n- **Success Rate**: Percentage of successful calls out of total attempts\n\nThese metrics reveal the effectiveness of AutoBE's validation feedback strategy powered by [`typia.llm.application<Class, Model>()`](https://typia.io/docs/llm/application/). When function calls fail type validation, detailed error messages are fed back to the AI agent, enabling iterative correction through self-healing spiral loops.\n\nSuccess rates vary based on model size and capability - smaller models may have lower initial success rates. However, validation feedback enables even weaker models to achieve high success rates through automatic correction cycles, demonstrating the power of compiler-driven development.\n\n## License\n\nAutoBE is licensed under the [GNU Affero General Public License v3.0 (AGPL-3.0)](https://github.com/wrtnlabs/autobe/?tab=AGPL-3.0-1-ov-file#readme). If you modify AutoBE itself or offer it as a network service, you must make your source code available under the same license.\n\nHowever, backend applications generated by AutoBE can be relicensed under any license you choose, such as MIT. This means you can freely use AutoBE-generated code in commercial projects without open source obligations, similar to how other code generation tools work.\n", "typos.toml": "[default]\nlocale = 'en-us'\nextend-ignore-re = [\n \"(?Rm)^.*(<!--|#|//)\\\\s*spellchecker:disable-line(-->|\\n)?$\",\n \".*(?:spellchecker|typos):\\\\s?ignore-next-line[^\\\\n]*\\\\n[^\\\\n]*\",\n \"(?s)(<!--|#|//)\\\\s*spellchecker:off\\\\s*(-->|\\n).*?(<!--|#|//)\\\\s*spellchecker:on\",\n]\n\n[default.extend-words]\nJeongho = \"Jeongho\"\nNam = \"Nam\"\ntypia = \"typia\"\n\n[files]\nextend-exclude = [\"*.json\"]" };