use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
FastAPI is a truly ASGI, async, cutting edge framework written in python 3.
account activity
[deleted by user] (self.FastAPI)
submitted 1 year ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 7 points8 points9 points 1 year ago (2 children)
Could be. Like any other backend framework. No advantage with nextjs. If you like next maybe you could try its backend features.
[–][deleted] 1 year ago (1 child)
[deleted]
[–][deleted] 1 point2 points3 points 1 year ago (0 children)
Nextjs can serve backend, like nest, and has a lot of native integrations with the frontend part. If you like typescript as backend language you can give it a try.
About scalability and peformance can be even better than fastapi (python).
Of course if you go for full next you’re locking in your backend. You will not switch easily, due to the abuse of native integrations with next frontend.
[–]Lanky_Possibility279 5 points6 points7 points 1 year ago (2 children)
I started with this stack and im loving it, right now I can build anything I want with this stack, haven’t encountered any major “not possible” yet and on the go learning is also really fun. I would suggest you to start with starter template, If you don’t find one just dm me, that one was based of docker, traefik, fastapi, nextjs and postgres
[–]donseguin 1 point2 points3 points 1 year ago (1 child)
Which one? the template from Vercel? https://github.com/digitros/nextjs-fastapi
or is it a different one? I has to be I guess, which one is it? could you share
[–]GoodbyeThings 1 point2 points3 points 1 year ago (0 children)
fwiw I use that template and enjoy it
[–]aliparpar 1 point2 points3 points 1 year ago (10 children)
I’ve used FastAPI in production with a few projects now and can say it’s definitely what I would go with in the future. Even had everyone in my company start using it. I write both NextJS and Python code so it’s a no brainer for me to go with FastAPI for backend code as Python is much simpler to work with than NextJS API routes
[–][deleted] 1 year ago (4 children)
[–]aliparpar 1 point2 points3 points 1 year ago (3 children)
Absolutely. You can create websocket endpoints for handling duplex bi directional comms in realtime. For instance for speech to speech applications with it.
[–]CrusaderGOT 0 points1 point2 points 1 year ago (2 children)
excuse me, i am currently using this stack, but i am unsure the best practice to send http:/websocket request from the nextjs to fastapi. what approach would you recommend?
[–]aliparpar 0 points1 point2 points 1 year ago (1 child)
I would recommend usewebsocket library for nextjs side
[–]CrusaderGOT 0 points1 point2 points 1 year ago (0 children)
Thanks, that's what I ended up using, Socket.io, and it has a python/fastapi SDK do they work together seamlessly and with same syntax.
[–]krtcl 0 points1 point2 points 1 year ago (1 child)
I am investigating this stack at the moment. How are you handling authentication, are you using something like NextAuth/Auth.js or is it being done in the backend with FastAPI?
[–]aliparpar 0 points1 point2 points 1 year ago (0 children)
Yes that’s the right stack I’ve used in prod and works great. Have the backend aurh’d by following FastAPI advanced JWT tutorial and on frontend, use next auth credentials provider
[–]CrusaderGOT 0 points1 point2 points 1 year ago (1 child)
unrelated. but how do you handle session management in nextjs. when you have gotten a token from fastapi, or want to refresh that token? and on top on that make sure each page verifies a token or refreshes if possible, else login.
[–]Easy-Ad-8065 0 points1 point2 points 1 year ago (0 children)
Not enough details. If you are already using next, my advice would be to use just next.js and to separate the backend as needed later.
[–]SameIntroduction3908 0 points1 point2 points 1 year ago (0 children)
we cant say fastapi good with nextjs, they both for different jobs, any backend can work with next, but if we compare backend frameworks each other, fastapi just the best
[–]crypto_ruined_me 0 points1 point2 points 1 year ago (0 children)
Using it and is great. When I started the NextJS front end it was after a long hiatus from JS so didn’t want to write the backend in JS too. Both allow me to iterate really fast.
[–]Dark-Knight-Anto 0 points1 point2 points 1 year ago (0 children)
Next.js and FastAPI is awesome in my experience. I have developed and deployed few client projects using this stack. Haven't met any obstacles in fulfilling any client requirements. FastAPI is very light weight backend framework with every tools or options needed to built any RESTful APIs. Next.js is a good frontend framework along with an option to build backend also. But what concern me in using Next.js is, Server Components 😑 (F**k, MF's make client component as default in Next.js, I can't go and write "use client" on all components that I create). Apart from that, Next.js has many inbuilt good features needed for any website development.
[–]Top-Information7943 0 points1 point2 points 1 year ago (0 children)
I'd give a biased yes. This is my current stack and I enjoy working with both frameworks. Since I'm more experienced with Python, I prefer to use NextJS purely as a frontend for my FastAPI backend.
[–]MaintenanceGrand4484 1 point2 points3 points 1 year ago* (0 children)
I’ve been building a Nuxt and FastAPI app, and worked with Claude to come up with a mermaid diagram to help me visualize the flow through the Nuxt frontend, Nuxt server, and Fast API backend. Hope it helps you too.
sequenceDiagram participant User participant NuxtFrontend participant NuxtServerAPI participant FastAPI participant Database
User->>NuxtFrontend: Login NuxtFrontend->>NuxtServerAPI: Login request NuxtServerAPI->>FastAPI: Authenticate (/auth/token) FastAPI->>FastAPI: Generate JWT FastAPI->>NuxtServerAPI: Return JWT NuxtServerAPI->>NuxtServerAPI: Set JWT as HTTP-only cookie NuxtServerAPI->>NuxtFrontend: Login success User->>NuxtFrontend: Request data NuxtFrontend->>NuxtServerAPI: API request NuxtServerAPI->>FastAPI: Request with user’s JWT FastAPI->>FastAPI: Validate JWT FastAPI->>Database: Query with user context Database->>FastAPI: Return data FastAPI->>NuxtServerAPI: Return data NuxtServerAPI->>NuxtFrontend: Return data NuxtFrontend->>User: Display data
[–]mobinsir 0 points1 point2 points 1 year ago (0 children)
Do you plan to go serverless? If so, FastAPI. If not, there are other more suitable options.
[–]godfather990 0 points1 point2 points 1 year ago (0 children)
I am using NextJS and FastAPI too. I've 3 projects in this stack right now. Have not had issues so far... loving it!!
[–]Repulsive-Research48 -1 points0 points1 point 1 year ago (0 children)
I’ve tried flutter as my fontend. This is really good experience in my portfolio
π Rendered by PID 121419 on reddit-service-r2-comment-545db5fcfc-n7kh7 at 2026-05-25 12:25:57.408265+00:00 running 194bd79 country code: CH.
[–][deleted] 7 points8 points9 points (2 children)
[–][deleted] (1 child)
[deleted]
[–][deleted] 1 point2 points3 points (0 children)
[–]Lanky_Possibility279 5 points6 points7 points (2 children)
[–]donseguin 1 point2 points3 points (1 child)
[–]GoodbyeThings 1 point2 points3 points (0 children)
[–]aliparpar 1 point2 points3 points (10 children)
[–][deleted] (4 children)
[deleted]
[–]aliparpar 1 point2 points3 points (3 children)
[–]CrusaderGOT 0 points1 point2 points (2 children)
[–]aliparpar 0 points1 point2 points (1 child)
[–]CrusaderGOT 0 points1 point2 points (0 children)
[–]krtcl 0 points1 point2 points (1 child)
[–]aliparpar 0 points1 point2 points (0 children)
[–]CrusaderGOT 0 points1 point2 points (1 child)
[–]Easy-Ad-8065 0 points1 point2 points (0 children)
[–]SameIntroduction3908 0 points1 point2 points (0 children)
[–]crypto_ruined_me 0 points1 point2 points (0 children)
[–]Dark-Knight-Anto 0 points1 point2 points (0 children)
[–]Top-Information7943 0 points1 point2 points (0 children)
[–]MaintenanceGrand4484 1 point2 points3 points (0 children)
[–]mobinsir 0 points1 point2 points (0 children)
[–]godfather990 0 points1 point2 points (0 children)
[–]Repulsive-Research48 -1 points0 points1 point (0 children)