{"id":48904570,"url":"https://github.com/mzivkovicdev/spring-crud-generator","last_synced_at":"2026-04-19T10:01:12.359Z","repository":{"id":334410612,"uuid":"1027703532","full_name":"mzivkovicdev/spring-crud-generator","owner":"mzivkovicdev","description":"Generate production-ready Spring Boot backend boilerplate from a single YAML or JSON spec.","archived":false,"fork":false,"pushed_at":"2026-04-07T13:53:45.000Z","size":2273,"stargazers_count":30,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-07T14:48:02.821Z","etag":null,"topics":["api","apis","crud","crud-generator","docker","generator","graphql","graphql-codegen","graphql-java","java","maven-plugin","nosql","rest","rest-api","spring","spring-boot","springboot","springboot3","springboot4","sql"],"latest_commit_sha":null,"homepage":"https://markozivkovic.dev/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mzivkovicdev.png","metadata":{"files":{"readme":"Readme.MD","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-28T12:06:11.000Z","updated_at":"2026-04-07T13:24:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mzivkovicdev/spring-crud-generator","commit_stats":null,"previous_names":["mzivkovicdev/spring-crud-generator"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/mzivkovicdev/spring-crud-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzivkovicdev%2Fspring-crud-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzivkovicdev%2Fspring-crud-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzivkovicdev%2Fspring-crud-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzivkovicdev%2Fspring-crud-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mzivkovicdev","download_url":"https://codeload.github.com/mzivkovicdev/spring-crud-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mzivkovicdev%2Fspring-crud-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32002361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","apis","crud","crud-generator","docker","generator","graphql","graphql-codegen","graphql-java","java","maven-plugin","nosql","rest","rest-api","spring","spring-boot","springboot","springboot3","springboot4","sql"],"created_at":"2026-04-16T19:00:43.472Z","updated_at":"2026-04-19T10:01:12.352Z","avatar_url":"https://github.com/mzivkovicdev.png","language":"Java","readme":"# Spring CRUD Generator\n\n[![CI](https://github.com/mzivkovicdev/spring-crud-generator/actions/workflows/ci.yml/badge.svg)](https://github.com/mzivkovicdev/spring-crud-generator/actions/workflows/ci.yml)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=flat)](https://opensource.org/licenses/Apache-2.0)\n![Open Source](https://img.shields.io/badge/Open%20Source-Yes-success?style=flat)\n[![Maven Central](https://img.shields.io/maven-central/v/dev.markozivkovic/spring-crud-generator.svg)](https://central.sonatype.com/artifact/dev.markozivkovic/spring-crud-generator)\n[![Docs](https://img.shields.io/badge/Docs-Available-blue?style=flat)](./docs/README.md)\n\n![Java](https://img.shields.io/badge/Java-17--25-blue?style=flat\u0026logo=openjdk\u0026logoColor=white)\n![Spring Boot 3](https://img.shields.io/badge/Spring%20Boot-3.x-6DB33F?style=flat\u0026logo=springboot\u0026logoColor=white)\n![Spring Boot 4](https://img.shields.io/badge/Spring%20Boot-4.x-6DB33F?style=flat\u0026logo=springboot\u0026logoColor=white)\n\n![PostgreSQL](https://img.shields.io/badge/PostgreSQL-4169E1?style=flat\u0026logo=postgresql\u0026logoColor=white)\n![MySQL](https://img.shields.io/badge/MySQL-4479A1?style=flat\u0026logo=mysql\u0026logoColor=white)\n![MariaDB](https://img.shields.io/badge/MariaDB-003545?style=flat\u0026logo=mariadb\u0026logoColor=white)\n![Microsoft SQL Server](https://img.shields.io/badge/Microsoft%20SQL%20Server-CC2927?style=flat\u0026logo=microsoftsqlserver\u0026logoColor=white)\n![MongoDB](https://img.shields.io/badge/MongoDB-47A248?style=flat\u0026logo=mongodb\u0026logoColor=white)\n![Redis](https://img.shields.io/badge/Redis-DD0031?style=flat\u0026logo=redis\u0026logoColor=white)\n![Hazelcast](https://img.shields.io/badge/Hazelcast-Real--time%20Data%20Platform-0A0A0A?style=flat\u0026logo=hazelcast\u0026logoColor=white)\n\nGenerate production-ready Spring Boot backend boilerplate from a single YAML or JSON spec.\n\nA Maven plugin for bootstrapping consistent, inspectable Spring Boot backends with generated CRUD layers, migrations, API docs, tests, and more.\n\n## Demo video\n\nWatch the demo on YouTube: [Spring CRUD Generator Demo](https://www.youtube.com/watch?v=jwVINP_YxSk)\n\n## Best for\n- Starting new Spring Boot backends faster\n- Teams that want a consistent backend baseline\n- Developers who want inspectable generated code, not a black box\n\n## Try a full generated example\nSee the demo project generated from a real spec: [Spring Crud Demo](https://github.com/mzivkovicdev/spring-crud-generator-demo)\n\n## Documentation\n\nFull documentation is available in [`/docs`](./docs/README.md).\n\n- [Getting started](./docs/getting-started.md)\n- [Configuration reference](./docs/configuration.md)\n- [Packages configuration](./docs/packages.md)\n- [Entities and fields](./docs/entities.md)\n- [Migrations](./docs/migrations.md)\n- [Incremental generation](./docs/incremental-generation.md)\n- [Spring CRUD Generator vs Bootify](./docs/comparison-with-bootify.md)\n- [Full SQL spec example](./docs/examples/crud-spec-full.yaml)\n- [Full MongoDB spec example](./docs/examples/mongo-crud-spec-full.yaml)\n- [JSON Schema](./docs/schema/crud-spec.schema.json)\n\n\u003e Maven Central: `dev.markozivkovic:spring-crud-generator:1.8.0`  \n\u003e Artifact page: https://central.sonatype.com/artifact/dev.markozivkovic/spring-crud-generator\n\n---\n\n## What you get\n\n### Core backend\n- Entities / Documents\n- Repositories\n- Services\n- DTOs and mappers\n- REST controllers\n\n### Optional platform features\n- Database migrations (Flyway for SQL, Mongock for MongoDB)\n- OpenAPI resources\n- GraphQL\n- Docker resources\n- Caching\n- Optimistic locking\n\n### Developer experience\n- Unit tests\n- JSON Schema validation\n- Incremental generation\n\n\u003e ⚠️ Table/collection deletion is **not** supported by the generator and must be handled manually.\n\n---\n\n## Documentation guide\n\nChoose what you need:\n\n- New user? → [Getting started](./docs/getting-started.md)\n- Need all available options? → [Configuration reference](./docs/configuration.md)\n- Working with entities and fields? → [Entities and fields](./docs/entities.md)\n- Need package customization? → [Packages configuration](./docs/packages.md)\n- Need a complete SQL example? → [Full SQL spec example](./docs/examples/crud-spec-full.yaml)\n- Need a complete MongoDB example? → [Full MongoDB spec example](./docs/examples/mongo-crud-spec-full.yaml)\n- Want autocomplete/validation? → [JSON Schema](./docs/schema/crud-spec.schema.json)\n\n---\n\n## Quick start\n\nGenerate a fully functional Spring Boot CRUD application in minutes using a single YAML or JSON configuration file.\n\n### Step 1: Add Maven Profile\n\nAdd the following `profile` section to your `pom.xml`:\n\n```xml\n\u003cprofiles\u003e\n    \u003cprofile\u003e\n        \u003cid\u003egenerate-resources\u003c/id\u003e\n        \u003cbuild\u003e\n            \u003cplugins\u003e\n                \u003cplugin\u003e\n                    \u003cgroupId\u003edev.markozivkovic\u003c/groupId\u003e\n                    \u003cartifactId\u003espring-crud-generator\u003c/artifactId\u003e\n                    \u003cversion\u003e1.8.0\u003c/version\u003e\n                    \u003cexecutions\u003e\n                        \u003cexecution\u003e\n                            \u003cid\u003egenerate-spring-crud\u003c/id\u003e\n                            \u003cgoals\u003e\n                                \u003cgoal\u003egenerate\u003c/goal\u003e\n                            \u003c/goals\u003e\n                            \u003cconfiguration\u003e\n                                \u003cinputSpecFile\u003e\n                                    ${project.basedir}/src/main/resources/crud-spec.yaml\n                                \u003c/inputSpecFile\u003e\n                                \u003coutputDir\u003e\n                                    ${project.basedir}/src/main/java/com/sql/demo/springboot_postgres_json_demo\n                                \u003c/outputDir\u003e\n                                \u003cforceRegeneration\u003etrue\u003c/forceRegeneration\u003e\n                            \u003c/configuration\u003e\n                        \u003c/execution\u003e\n                    \u003c/executions\u003e\n                \u003c/plugin\u003e\n            \u003c/plugins\u003e\n        \u003c/build\u003e\n    \u003c/profile\u003e\n\u003c/profiles\u003e\n```\n\n### Step 2: Create configuration file\n\nCreate the configuration file at the location defined by `inputSpecFile`.\nThe file name is arbitrary. Only the extension matters: `.yaml`, `.yml`, or `.json`.\n\n```text\nsrc/main/resources/crud-spec.yaml\n```\n\n**SQL example (PostgreSQL, MySQL, MariaDB, MSSQL)**\n\n```yaml\nconfiguration:\n  database: postgresql\n  openApi:\n    apiSpec: true\n    generateResources: true\n  errorResponse: simple\n  tests:\n    unit: true\n    dataGenerator: instancio\nentities:\n  - name: ProductModel\n    storageName: product_table\n    description: \"Represents a product\"\n    fields:\n      - name: id\n        type: Long\n        description: \"The unique identifier for the product\"\n        id:\n          strategy: IDENTITY\n      - name: name\n        description: \"The name of the product\"\n        type: String\n        column:\n          nullable: false\n          unique: true\n          length: 255\n```\n\n**MongoDB example**\n\n```yaml\nconfiguration:\n  database: mongodb\n  openApi:\n    apiSpec: true\n    generateResources: true\n  errorResponse: simple\n  tests:\n    unit: true\n    dataGenerator: instancio\nentities:\n  - name: ProductModel\n    storageName: products\n    description: \"Represents a product\"\n    fields:\n      - name: id\n        type: String\n        id: true\n        description: \"MongoDB document id\"\n      - name: name\n        description: \"The name of the product\"\n        type: String\n        validation:\n          required: true\n          notBlank: true\n          maxLength: 255\n```\n\nThis spec file can define:\n\n- global generator configuration (database, OpenAPI, Docker, tests, caching, migration scripts, etc.)\n- entities/documents, fields, constraints, and relationships\n- additional features like base path, soft delete, audit, and more\n\nNote: the examples above show only a minimal subset. See the full examples for all available options.\n\nBoth YAML (`.yaml/.yml`) and JSON (`.json`) formats are supported.\n\n### Copilot + autocomplete for spec files\n\nFor better completion in VS Code/Copilot, bind your spec to the schema.\n\nYAML (`*.yaml` / `*.yml`):\n\n```yaml\n# yaml-language-server: $schema=https://raw.githubusercontent.com/mzivkovicdev/spring-crud-generator/main/docs/schema/crud-spec.schema.json\nconfiguration:\n  database: postgresql\n```\n\nJSON (`*.json`):\n\n```json\n{\n  \"$schema\": \"https://raw.githubusercontent.com/mzivkovicdev/spring-crud-generator/main/docs/schema/crud-spec.schema.json\",\n  \"configuration\": {\n    \"database\": \"postgresql\"\n  }\n}\n```\n\n### Step 3: Validate spec (dry-run, optional)\n\nUse the `validate` goal to check whether the spec file is valid before generating code:\n\n```bash\nmvn spring-crud-generator:validate -DinputSpecFile=src/main/resources/crud-spec.yaml\n```\n\n### Step 4: Run the generator\n\nRun the generator using the Maven profile:\n\n```bash\nmvn clean install -Pgenerate-resources\n```\n\nAfter execution:\n\n- source code is generated into the directory defined by `outputDir`\n- Flyway migration scripts are generated (if enabled, SQL databases)\n- Mongock `@ChangeUnit` classes are generated (if enabled, MongoDB)\n- Swagger/OpenAPI resources are generated (if enabled)\n- Docker and Docker Compose files are generated (if enabled)\n\n### Step 5: Configuration parameters\n\n| Parameter | Description |\n| --- | --- |\n| `inputSpecFile` | Path to the YAML/JSON configuration file |\n| `outputDir` | Directory where generated source code is written |\n| `forceRegeneration` | Forces regeneration of all non-ignored entities, ignoring state files |\n\nFor the `validate` goal, only `inputSpecFile` is required.\n\n### Important notes\n\nIncremental generation is enabled by default:\n\n- Generator state is stored in: `generator-state.json` and `migration-state.json`\n- Setting `forceRegeneration=true` ignores these files\n- Database tables are never dropped automatically\n\n---\n\n## Supported Java versions\n\n- Java **17** – **25**\n\n---\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](./LICENSE.txt) file for details.\n\n---\n\n## Contact\n\nFor questions, feedback, collaboration, or support, feel free to reach out::\n\n- Email: **mzivkovic.dev@gmail.com**\n- LinkedIn: [Marko Zivkovic](https://www.linkedin.com/in/marko-zivkovic-84547017a/)\n","funding_links":[],"categories":["Projects"],"sub_categories":["Code Generators"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmzivkovicdev%2Fspring-crud-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmzivkovicdev%2Fspring-crud-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmzivkovicdev%2Fspring-crud-generator/lists"}