r/FastAPI • u/Lucapo01 • Jul 06 '24
Question I'm a Python Backend Developer, How to Create a Modern and Fast Frontend?
Hi everyone,
I'm a backend developer working with Python and I'm looking for a simple and quick way to create a modern and clean frontend (web app) for my Python APIs.
I've been learning Next.js, but I find it a bit difficult and perhaps overkill for what I need.
Are there any tools or platforms for creating simple and modern web apps?
Has anyone else been in the same situation? How did you resolve it?
Do you know of any resources or websites for designing Next.js components without having to build them from scratch?
Thanks in advance for your opinions and recommendations!
4
u/jsabater76 Jul 06 '24
What about Bootstrap 5? I am still stuck at version 4, but it seems it has a soft learning curve.
3
u/MadReasonable Jul 06 '24
Not overkill. NextJS has a lot of server-side rendering capabilities that you can just ignore. NextJs can be compiled to static files and served directly from FastAPI using static mapping in middleware. You'll lose some performance optimizations and the ability to do dynamic routing, but you won't need to set up another service and port. And I've been using the MUI (Material UI) component library for the basics.
1
3
2
u/thegainsfairy Jul 06 '24
HTMX? if you just want to add a bit more interactivity. it lets you focus more on python code than js code.
and if you ever need a more complex interface, you can always just throw in some other js in it.
still need to style it with something like tailwind.
2
2
1
u/Impressive-Treacle58 Jul 06 '24
Try gradio Quick work with python.
Will be great for PoC project development
1
u/Disastrous-Berry1003 Jul 06 '24
If you want something fast, then look into astro.build. It has a learning curve though. Otherwise indeed some combination of Jinja2, tailwind, and htmx would do.
1
u/-brianh- Jul 06 '24
You can use divmagic to get components without having to build them from scratch. Thinking about UI components and coding them takes a lot of time. You can find something with a good design and get its code easily instead of building it from scratch.
1
1
u/idkwhatimdoing069 Jul 07 '24
If you want to go the super simple route, look into the self hosted edition of retool.
I use this all the time to proof of concept my backend. I don’t like doing front end so having a clear cut idea of what I’m making is awesome for me. Retool makes creating quick POCs super simple
1
1
u/Ok_Animator_1770 Dec 10 '25
Dont reinvent the wheel, Next.js is dominant frontend solution on web, dont fight the windmills, its not your job.
To save time you can reuse my Next.js FastAPI template, its very up to date:
https://github.com/nemanjam/full-stack-fastapi-template-nextjs
1
-1
0
Jul 06 '24
[deleted]
2
1
u/IAmCesarMarinhoRJ Jul 07 '24
wow!!! I dont read this in fastapi.
thanks to post that!!!is amazing!!!
25
13
u/anonymousgorillla Jul 06 '24
I use sveltekit. Very easy to set up and has a very low learning curve.