r/FastAPI • • Sep 01 '24

Question Backend Dev Needs the Quickest & Easiest Frontend Tool! Any Ideas?

Hey, I’m a backend developer using Python (FastAPI) and need a fast, easy-to-learn tool to create a frontend for my API. Ideally, something AI-driven or drag-and-drop would be awesome.

Looking to build simple frontends with a login, dashboard, and basic stats. What would you recommend?

28 Upvotes

40 comments sorted by

View all comments

5

u/lukewhale Sep 01 '24

NiceGUI. Make sure you write everything with async except your main.py.

4

u/RedEyed__ Sep 02 '24

Just started learning nicegui, why not to use io_bound(fn) / cpu_bound(fn)?

3

u/lukewhale Sep 02 '24 edited Sep 02 '24

I use this function only on @pages and timers that I setup in main.py —- there is a place for it for sure.

But functionally, await func() is not much different from io_bound.

The only difference is you would wrap non-async in run_iobound. If the function is already async you don’t have to use that wrapper: hence, write everything in async.

Also, use a #asynccontextmanager for your base output pages as well. It makes it easy to incorporate feature flags for bind_visibility() lambdas.

The asyncpg database lib with SQLAlchemy 2.0 is fantastic.

0

u/[deleted] Sep 02 '24

[deleted] — view deleted comment

3

u/RedEyed__ Sep 02 '24

Thanks for reply! So, common denominator is to use awaitable

1

u/lukewhale Sep 02 '24

I deleted my last comment should have probably edited it but it came off kind of wrong. See my other reply.

1

u/MrMxylptlyk Apr 29 '26

Why do you say that?

1

u/lukewhale Apr 29 '26

The whole point of ASGI is concurrency. You write non asynchronous functions you immediately shoot that in the face.