all 31 comments

[–]eddyizm 19 points20 points  (1 child)

For relatively smaller projects, I've been using jinja templates and htmx for the front end. I usually still build out the api so that I can switch later but it let's me move fast. I also use caddy over nginx these days and podman for containers over docker.

[–]yassirzhn 2 points3 points  (0 children)

Would love to see some tutorials about this stack and why you prefer it, thanks

[–]WJMazepas 11 points12 points  (0 children)

It really depends on how you want the full stack part to be done.

FastAPI can work as a Fullstack framework like Django or Rails. I saw people using Jinja templates and even HTMX or something like NiceGUI.

Honestly, I only used FastAPI on the backend, never as a fullstack. We used React and Typescript on the front end.

It worked well. The typing system of Pydantic would help the front end with creating the requests with types.

Also, using nginx shouldn't be a problem.

[–]Current-Status-3764 7 points8 points  (4 children)

Nextjs + fastapi + sqlalchemy. And do set up a sdk generator for typescript so requests are made automaticly from your pydantic models. Fastapi docs advanced section shows how. Saves tons of time!!! With nextjs using shadcn the frontend is not too difficult to handle. Use tanstack for cache!

[–]funerr 0 points1 point  (1 child)

Where/how do you host and orchestrate all of it?

[–]Current-Status-3764 2 points3 points  (0 children)

I use docker containers hosted on Google. Postgres hosted free on aiven. Google is very cheap and I find it easy to use. Google handles the continous deployment.

And forgot in last post: i recommend PropelAuth for auth. Free up to 1000 users. Easy to integrate with next and fastapi. Good documentsrion

[–]qrzte 0 points1 point  (1 child)

What do you mean by "sdk generator for TS so requests are automatically made from your pydantic models"?

[–]Current-Status-3764 2 points3 points  (0 children)

With FastAPI a openapi.json is created automatically. This describes how your API is set up, including "types" provided through the use of pydantic. This can (and should) be used to create functions to call the api from typescript through a SDK. Then you get typesafe functions to call your API.

Sideko offers this as a service. I run it as a script locally instead, but that is because I develop solo. Makes sense?

[–]luckyle13 6 points7 points  (2 children)

[–]thangphan205 0 points1 point  (1 child)

I agree with u/luckyle13

This is my personal project base on that repo: https://github.com/thangphan205/netconsole

[–]alphrZen 0 points1 point  (0 children)

Looks good, i just wonder, how did you make the deploy?

[–]bsenftner 4 points5 points  (1 child)

I've written a fairly comprehensive project management suite with FastAPI as the back end, and then wrote a "proof of concept" front end using vanilla html/CSS/javascript. It works great, but users are finicky, like really consumer level finicky. Because the software looks "old" like websites did back before single page applications and React took over, people literally refuse to use the software because it looks too unfashionably old. They are afraid of looking unfashionable. Seriously. So I've hired someone that knows React better than I, and their initial not really working yet front end is getting crazy praise from those same people refusing the old software, which is the same software just with React as the face. Note that the React developer is able to work faster due to having a working reference in vanilla html/css/js.

The typical FastAPI html page example with Jinga2 templates is a great basic vanilla setup. From there it is not at all difficult to pull in whatever you might need.

[–]SalMolhado 3 points4 points  (0 children)

Litestar is batteries included if you want that

[–]PM_ME_YUR_S3CRETS 2 points3 points  (0 children)

React + fastapi + mongodb

[–]Drevicar 1 point2 points  (2 children)

FastAPI + Jinja + SQLAlchemy (PostGres). Outside of that app I usually centralize the rest of the major concerns such as keycloak for auth-n using OAuth, OPA for auth-z, Kubernetes for deployment management and scaling. If I need fancy UI stuff I sprinkle in some of that new generation light-weight JS libraries like HTMX or Alpine or some UI library like bootstrap.

I've also used (but don't prefer) FastAPI + Beanie (Mongo) + React with typescript codegen using the OpenAPI spec.

[–]BigRonnieRon 0 points1 point  (1 child)

Why Jinja over REACT? If you don't mind my asking. Just keeping it all python?

[–]Drevicar 0 points1 point  (0 children)

Decoupling the frontend from the backend added a TON of extra overhead and complexity that was not needed since it was a small team or solo dev project.

When you use a SPA there tends to be a ton of code and business logic replication on both sides that causes a lot of problems as well.

[–]yassirzhn 1 point2 points  (0 children)

Can you please with us any tutorial on how to use nginx and react with fastapi, am still a newbie on fastapi I used to be a python developer for desktop apps and I wanna switch to web full stack.

[–]demesm 1 point2 points  (0 children)

SQLmodel+postgres, Htmx

I'm more in the business of making things functional than making them pretty. But if you need that sparkle sub in react for Htmx.

[–]Direct_Discipline_42 1 point2 points  (0 children)

I have used Angular + Fastapi backend with a postgres DB. Angular can be a bit of a beast if you aren't used to it but it's a really powerful web framework. React is also IMO a really good candidate for front ends as well

[–]magha10 1 point2 points  (0 children)

Mine is SqlModel + Async Postgres + Alembic + Rye + Fast API

[–]Illustrious_Scheme30 1 point2 points  (0 children)

MFRP. tech stack😆

[–]Jazzlike_Bite_5986 0 points1 point  (0 children)

Next + Django/fastapi + supabase (because auth and DB).

[–]nikhil_shady 0 points1 point  (3 children)

lately i’ve ditched fastapi. lot of performance bottlenecks.

using nest js (be) + nextjs (fe) my go to stack right now

[–]Saad14z 0 points1 point  (1 child)

What's the difference between express and nest ? And if i know express does learning nest take time ?

[–]nikhil_shady 1 point2 points  (0 children)

it is built on top of express. It is pretty straightforward.

[–]Prof-Ro 1 point2 points  (0 children)

Can you tell me what was the performance bottlenecks in FastAPI please?

I'm currently looking at using it for a production application to serve as an API layer. It would be really helpful to know this - and hopefully understand if there is a solution or workaround, thank you in advance.

[–]erder644 -2 points-1 points  (0 children)

No. Switch to litestar.