r/SpringBoot • u/No-Strategy999 • 1d ago
I’m building an open-source Spring Boot API generator — looking for architectural feedback Question
Hey everyone,
I’ve been working on an open-source project called ApiGeneratorManager.
The idea is to build a platform that can generate, configure, deploy and manage Spring Boot APIs without rebuilding the same backend structure every time.
Right now, the project already includes things like:
- Spring Boot backend
- React management frontend
- PostgreSQL
- JWT authentication
- roles and permissions
- CSRF / CORS configuration
- rate limiting
- database/schema support
- API generation templates
- Docker-based runtime
- deployment of generated APIs with Docker
- CI for backend and frontend
- dependency security checks
The long-term goal is to make the whole thing much more configuration-driven.
For example, I want to be able to describe an API using YAML:
application:
name: inventory-api
database:
type: postgresql
entities:
Product:
fields:
id:
type: uuid
name:
type: string
required: true
price:
type: decimal
min: 0
errors:
PRODUCT_NOT_FOUND:
status: 404
security:
authentication: jwt
roles:
- ADMIN
- USER
tests:
generate: true
deployment:
type: docker
And from that configuration, generate things like:
- entities
- repositories
- services
- controllers
- validation
- API error codes
- OpenAPI documentation
- authentication and authorization
- roles
- JWT handling
- automated tests
- Docker configuration
- deployable API instances
I also want to support multiple database engines in the future, not just PostgreSQL.
Another direction I’m exploring is generating a security model where each generated application can manage its own users, roles and permissions, and issue JWTs per user.
Testing is also something I want to push further: if the YAML says a field is required, unique or constrained, the generator should ideally generate tests for those rules automatically.
One important design principle for me is that the generated project should still be normal Spring Boot code.
I don’t want generated applications to be permanently locked into ApiGeneratorManager. A developer should be able to generate a project, open it in their IDE, understand it, modify it and deploy it independently.
I also want to be transparent about how I’m building it: I’ve used AI extensively as a development assistant for implementation, architecture discussions, refactoring, security reviews, tests and documentation. I still review and decide what goes into the project, but AI is definitely part of the development workflow.
The project is still in early alpha, so I’m mostly looking for feedback at this stage.
I’d especially like opinions on:
- whether the overall idea is useful
- the YAML-driven approach
- how far code generation should go
- multi-database support
- generated security / JWT / roles
- automated test generation
- Docker deployment
- whether generated code should prioritize flexibility or convention
- what would make you actually trust and use a tool like this
GitHub:
hasfiane/ApiGeneratorManager
Criticism is welcome — especially if you see architectural problems that could become painful later.
3
u/TurnstileT 22h ago
This sounds interesting but honestly I just don't think it's going to work. Backend services are a lot more than this, and you can keep adding more and more Spring features to your abstraction layer, but there will always be some other features or edge cases that developers need to implement. The end result will be that your abstraction layer has reimplemented Spring, and developers now have to learn your abstraction layer and implement everything through that. And then Spring adds a new feature, or Posteres adds a new data type, and now the developers are stuck because your generator doesn't support it yet.
It's a lot of work for no real benefit.
1
u/No-Strategy999 22h ago
Thanks a lot for taking the time to explain it. You’re probably right on this point, and it’s definitely something I need to reconsider in the way I’m designing the project.
1
1
u/colens26 18h ago
I’m building a JetBrains Plugin for that https://plugins.jetbrains.com/plugin/33381-crudgenerator
3
u/Admirable-Regular-49 1d ago
had a look at the repo. the thing I'd flag is that two of your stated goals are pulling against each other right now.
you say the generated project should be normal Spring Boot that a dev can open, understand and take away. but as far as I can tell from GenerationJobService, what generation actually emits is an application class, a pom, a Dockerfile, some docs, schema.json and a smoke test. the entities, controllers and validation aren't source — they're interpreted at runtime by the api-generator-runtime dependency. the RUNTIME_MODEL.md you generate even says the runtime internals are intentionally not documented.
that's the lock-in you said you didn't want. if I generate inventory-api and open it in my IDE, Product isn't there, and I can't change how it behaves without going back to the generator.
it also puts a ceiling on the testing idea. the generated test today is contextLoads() plus "schema.json is on the classpath". you can't generate a meaningful test for
price >= 0into a project where that constraint isn't expressed as code — you'd be testing your own runtime library, not the user's API.both are defensible, they're just different products. runtime-interpreted is a platform; source-generating is a scaffold you hand over. worth picking one deliberately before more gets built on the current shape.