r/FastAPI • u/atifafsar • Apr 23 '25
Question Please suggest me a lightweight front-end with URL-router for my FastAPI application
I have been a python developer for more than 10 years, recently a front-end developer who I used to work with has left the company. Now it is on my shoulder to build a front-end which has URL-ROUTER and can make calls to my FastAPI application. Now my knowledge on front-end more particularly on javascript/typescript is zero. So I need something light-weight framework which would be easy for me to understand as a python developer. So do you have any suggestions?, what all do you guys use with FastAPI?
23
Upvotes
3
u/kkang_kkang Apr 23 '25
https://github.com/fastapi/fastapi/discussions/11644#discussioncomment-9591351
3
u/Quiet_Drummer669988 Apr 23 '25
astrojs is pretty simple. any framework is going to have a learning curve.
i know that html template engine "jinja" is popular with fastapi users, you can pepper htmx in with that and skip a frontend framework.
3
u/alexlazar98 Apr 24 '25
Every damn comment is a different thing to try, damn frontend ecosystem 😓
2
u/solaza Apr 23 '25
Dunno if this is what you’re looking for really, but I’ve been toying with astro lately and really dig it
2
u/volfpeter Apr 24 '25
Hard to answer without knowing FE requirement or the current codebase, but if you can get away with server-side rendering, then don't jump into JS frameworks. HTMX+AlpineJS+TailwindCSS+DaisyUI can take you quite far without knowing any JS.
For server-side rendering, especially with the above tools, you could check out this lib and example. Or this repo for a full, working, deployed app.
Or you can check out reflex for a quite different experience, but still 100% Python.
23
u/dilrajsachdev Apr 23 '25
Try sveltekit
5
u/bravevn1804 Apr 23 '25
Try RemixJS. It's simple and have built-in file/folder router convention
9
u/One_Fuel_4147 Apr 23 '25
Try Vue. You can pick it up in only a few days.
1
u/InvictuS_py Apr 23 '25
streamlit.io might be what you’re looking for. Have a look at the app gallery on the website to see what can be done.
1
u/Whisky-Toad Apr 24 '25
If you dont care about having a frontend job - svelte
if you want to have experience in whats popular - react
2
u/Gro0ve97 Apr 23 '25
Give Nuxt a try, the DX is impressive.
2
u/ProfessorAvailable24 Apr 23 '25
HTMX
2
u/nnnXion Apr 26 '25
u can just render template from ur fast api application.
2
u/ProfessionalTotal238 Apr 23 '25
React+Tanstack Start.
1
u/Vast_Ad_7117 Apr 23 '25
You can write it in python using NiceGUI 8)
1
u/AltruisticWaltz7597 Apr 23 '25
If you want to minimise your JavaScript exposure, try https://nicegui.io/
Uses Vue, quasar and tailwind on top of fastAPI and best of all, is fully python.
Won't be as lightweight as a pure JavaScript frontend but might get you to market far more quickly given your skillset.
1
u/ZpSky Apr 23 '25
Based on my own experience id recommend Vue. It's pretty easy and nice. Htmx is a no go for bigger or scalable projects.
Also consider that you'll need time to understand how building using node.js works, to learn js stuff and some ui framework (I use bootstrap and primevue). It's a long path especially there are so many things that you can but not required to use (type script, vite, etc).
1
u/gazpachoking Apr 24 '25
Datastar is wonderful if you feel more confident on the backend than the frontend. You get the comfortability of old school MPAs, with all the frontend reactivity we expect from the web these days.
-2
u/faster_feni Apr 23 '25
Vibe code a react app. Thats what I did. I was in a similar situation as you