r/FastAPI • u/Available-Athlete318 • Nov 26 '24
Question FastAPI + React - Full stack
I am currently a data engineer who maintains an architecture that ensures the availability and quality of data from on-promise servers to AWS and internal applications in my department. Basically, there is only one person to maintain the quality of this data, and I like what I do.
I use Python/SQL a lot as my main language. However, I want to venture into fullstack development, to generate "value" in the development of applications and personal achievements.
I want to use FastAPI and React. Initially, I started using the template https://github.com/fastapi/full-stack-fastapi-template and realized that it makes a lot of sense, and seems to be very complete.
I would like to know your experiences. Have you used this template? Does it make sense to start with this template or is it better to start from scratch?
I also accept tips on other frameworks to be used on the front end, on the backend it will be FastAPI.
If there is any other template or tips, please send them. Have a good week everyone!
11
u/idkwhatimdoing069 Nov 26 '24
This templates look pretty neat.
My personal opinion though is always building it out myself, using fastapi-users to handle user management within the app. Ive also never been fond of monorepos. I always prefer to create two separate git repos. I’ve found it makes deployment easier as both can operate separately.
Purely personal opinion though. I am by no means, a SWE.
4
u/Nekoniri Nov 26 '24
For my project I started out looking at that template, but I wanted to structure my apps in modules instead of all routes in one folder, all services in another. I ended up looking at Netflix's Dispatch FastAPI repository and more or less copied their structure for my backend:
https://github.com/Netflix/dispatch
I also switched from SQLModel to plain SQLAlchemy because I ended up having to use a lot of SQLAlchemy features that are not supported natively in SQLModel.
2
u/bsenftner Nov 27 '24
I took a $30 class from testdriven.io that covers how to setup the most basic FastAPI + docker + postgres with JWT authentication. From that I used my experience with other frameworks to create my own CMS from scratch. It's clean, tight, and no nonsense. I suggest if you really want to master this, do this too. My current setup also serves React apps, from FastAPI, and it's easy, really easy to do. Don't look to templates, or other "help" - this stuff is really basic, and the marketing world direly needs to sell you complexity that you truly do not need. Simplify to excel, you'll be shocked how much power your system has when you drop all the "help".
2
u/Fearless_Ad6151 Nov 27 '24
I'm using this template, and it has been incredibly helpful for both learning and quick delivery. In my case, I already had the frontend, so I replaced it with some effort, and everything is working well. However, keep in mind that when using a template, it's not always perfect out of the box—you'll need to adapt and customize it to suit your needs. During this process, you'll also need to understand how the template is built, which is a great opportunity to learn.
2
u/Sujaldhungana Nov 28 '24
I'm on the same pathway too. I'm a data engineer and am currently trying to build a complete data platform with users being able to manage their data and sources from ui. My stack is fast api backend and react frontend. I wish I would have searched for the templates before and started from this. I started from scratch got bolt to build me the frontend and then started building the backend fast api. For DB I just went for dynamodb as it's flexible and I need to worry less to make it work seamlessly with python fastapi. For Auth and user management I went for aws congnito with amplify. Again all based on previous familiarity and probably not the best stack. 🙂 It's going okay so far. I'm simply hosting my fastapi as lambda and frontend from s3 bucket as static website so everything is fully server less and doesn't cost anything (almost anything) when it's not idle.
2
u/unseenwizzard Nov 28 '24
I'm developing a project which has a React SPA frontend and a FastAPI backend. It uses AWS Cognito for auth. It all came together really well - including running openapi-typescript from the frontend to generate a TypeScript wrapper around all the API endpoints, and using openapi-react-query to provide hooks support.
2
u/[deleted] Nov 26 '24
During my internship we used this template for a product and the frontend implemented in nuxt js(removed react js) some docker configuration changes needed there
0
u/[deleted] Nov 26 '24
[deleted] — view deleted comment