s3rius / FastAPI-template

Feature rich robust FastAPI template.
MIT License
1.79k stars 161 forks source link

Adding an admin panel option when setting up the template #126

Open haffi96 opened 1 year ago

haffi96 commented 1 year ago

Hey 👋🏽

What are opinions on adding an option to add an admin panel/dashboard which just displays the db tables set up in the template?

The dashboard would be served separately

Thinking about options such as:

I'd be happy to pick this up if it's a wanted feature

s3rius commented 1 year ago

Hello, and thanks for raising an issue.

It's a cool idea, but I think it would be hard to implement. Since we can select different ORMs and Databases. Personally I haven't tried a fastapi-admin library, so I don't know if it will work for all possible configurations.

If you want to grab this issue, I'm happy to see your pull request.

haffi96 commented 1 year ago

hm, thats a really good point. I was thinking along the lines of, the template can have a 'default' option (will have to be an opinionated choice by yourself) for ORM/db. This doesn't mean remove support for others, keep them but have a default option

We can then chose to either:

  1. Have the option to use admin dashboard to be before the ORM/db selection with a note saying that selecting to use an admin dashboard locks them into using the default ORM/db choice. This is obviously a bigger change
  2. Have option to select use admin dashboard later in the selection process. However, when selection ORM/db. There could be a note saying 'Use the ORM/db option if you want to also use the admin dashboard'
  3. Or lastly, see if there is way to cater for all ORM/db choices. Probably can consider this first however, seems like the more complex and least maintainable option.

wdyt? It's fine if you think this is just not a feasible feature

Also the fastapi-admin has its own ORM implementation with TortoiseORM so that's a limitation. You kind of just need to provide it a db url. But obviously this means, the user may end up having two different ORMs in the project. One for the API and Tortoise for the dashboard

The more i think about it, I'm convincing myself out of doing this feature haha

s3rius commented 1 year ago

I had that question in mind. I don't want to restrict people choose ORMs. So we can add this option in features menu and mark it as unstable.

This feature will work just fine with tortoise ORM, but we cannot provide guarantees about how it's going to work with other ORMs. I guess it's ok to just warn people.

alldevic commented 1 year ago

May be Amis Admin? https://github.com/amisadmin/fastapi_amis_admin

s3rius commented 1 year ago

May be Amis Admin? https://github.com/amisadmin/fastapi_amis_admin

It looks nice. I'll be ready to add it next week. Or you can submit a PR. On screenshots I've seen only Chinese language. Does it support other languages?

alldevic commented 1 year ago

It support English and have l11n support. But I not found packs for others langs.

s3rius commented 1 year ago

@alldevic, thanks for researching it. English is enough.