Is your feature request related to a problem? Please describe.
In order to rapid development, A crud generator (front end) would be great.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
It can be documentation about generating basic crud.
Additional context
I'm not sure wether this is within the framework scope, but I just want to get flask behind.
This, and user/permission management are maybe the only 2 things lacking. IMHO.
I know TypeSystem can do form rendering
https://www.encode.io/typesystem/forms/
I wonder if this can be achieved with pydantic
Thanks, yes, I've been thinking about this (I think we discussed it on Linkedin). I plan on building a Vue.js CRUD admin for OpenAPI.
It would not be tightly coupled to FastAPI, as it would be compatible with OpenAPI in general, but would be made to be easily added/pluggable as the current docs pages.
I have to first build the pieces, Vue components that render correctly data to be viewed in a "details" section (for one item), in list (for multiple items), and edition mode. And then, automatic sections based on tags. And then, I have to see how to solve handling the relationships between different models/schemas. I also have to see how to integrate it with security. I already have OAuth2 with password scheme (that's already in the project generators), but maybe that can be generalizable to other schemes.
@tiangolo right now FastAPI is still not as productive as Django Rest Framework because of the lack of user-registration/management workflow. The generator is nice but it's too tightly coupled. Would be nice to have a proper CRUD generator/admin story. You mentioned not wanting to include a ORM but without one a lot of time is wasted on shipping CRUD code, fiddling with migrations etc. If nothing, at least include Django's ORM to make life easier.
ref: https://www.reddit.com/r/Python/comments/b0zxa9/introducing_fastapi/eikicdj/
Hey @tiangolo I'd be glad to start working on this. I might make a proof of concept in the following weeks, is there any specific functionality you'd be looking for?
The way I see it rendering the following input types would be enough for a POC:
What do you think? would that help? Also, I am planning to use vuetify for this if that is ok.
I am also interested at building a admin. I'd like to use fastapi, mongodb, vue and vuetify. And I want to have a RBAC authentication too. But I'am not an experienced programmer.
I need some advice / best practice about how to implement those. Especially:
automatic sections based on tags
@tiangolo Can you share your idea about how to implement it? Should I just read and parsehttp://127.0.0.1:8000/openapi.jsonby hand or is there any great npm package to do it?
How to implement RBAC for FastApi?
What represent the permission?
For example,
@app.put("/items/{item_id}", response_model=Item)
async def update_item(item_id: str, item: Item):
update_item_encoded = jsonable_encoder(item)
items[item_id] = update_item_encoded
return update_item_encoded
What will be the permission name? How to identify it with code?
Should I use FastAPI's dependency system to verify role and permission?
I use mongoengine to create model and create event handlers to connect and disconnect multiple connection from the mongodb(@app.on_event("startup"), @app.on_event("shutdown")) (refer the document)
I wish there a tutorial about how to use mongoengine with FastAPI.
@jlugao Can you share your work of crud with vue?
Edit: I make some progress to implement. Although I'm not very confident about the code I write, I just make it public here: https://github.com/shizidushu/simple-report-data-table-vuetify
Recommend my admin dashboard fastapi-admin,based on fastapi and tortoise-orm and rest-admin,hope a star~馃榿
I don't like the idea on an ORM being incorporated into a project like this, what makes fastapi great IMO is it's focus on doing what it does extremely well. Async python routing with strict typing, and openapi generation. The docs detail how to incorporate an ORM. It would totally be cool to see some kind of vue frontend rendered from the OpenAPI with knowledge of the Pydantic models they come from for sure.
Most helpful comment
Recommend my admin dashboard fastapi-admin,based on fastapi and tortoise-orm and rest-admin,hope a star~馃榿