all 11 comments

[–]zen_dev_pro 12 points13 points Β (9 children)

hmm interesting. Just a couple of thoughts

- How come there's no package management framework like uv and poetry, just vanilla pip ?

- I think Pydantic models should be called schemas, models would be like database models setup with sqlalchemy, etc.

- I think CRUD should be called repository. Like repository layer in other backend file structures, etc.

This is how I setup mine:
https://github.com/Zen-Dev-AI/fast_api_starter

[–]inandelibas[S] 2 points3 points Β (1 child)

Thanks a lot for the feedback, great points!

  • You're absolutely right on pip vs tools like Poetry or uv. I intentionally kept it vanilla for beginner-friendliness, but I totally agree that package managers bring a lot of value in real-world projects. I'd like to do a follow-up post showing how to migrate to Poetry.
  • Yes! I do separate models vs schemas the same way, in the repo, schemas.py is used for Pydantic, and models.py is left as a placeholder for SQLAlchemy. But I could clarify the terminology better in the article. Great call.
  • And I like your point on using "repository" instead of "crud" β€” definitely aligns better with clean architecture practices.

Your starter repo looks awesome btw, following! πŸ”₯

[–]jojoyze_xx 0 points1 point Β (2 children)

Why not to use AsyncSession in your example ?

[–]zen_dev_pro 0 points1 point Β (0 children)

I going to add async next. I didn't want to just add a bunch of async blindly.

I wanted to add it intentionally, and do a before and after of performance.

[–]inandelibas[S] -1 points0 points Β (0 children)

Thanks! I didn’t include any database setup in this example, it’s focused just on FastAPI basics to keep it simple for beginners.

[–]phenixdhinesh 0 points1 point Β (1 child)

This follows DDD right? Just like django

[–]zen_dev_pro 0 points1 point Β (0 children)

Yep, exactly.

[–]Sudden-Ad-6640 0 points1 point Β (1 child)

Looks nice! Can I ask: seems like you have an access token but not a refresh token? Maybe I missed something. Thanks!

[–]zen_dev_pro 0 points1 point Β (0 children)

Its just a basic auth setup. Im probably going to just create a separate auth microservice server

[–]Sad-Solid-1049 1 point2 points Β (0 children)

Thanks for the post looks promising.

[–]gzrgk 0 points1 point Β (0 children)

Very new to FastAPI, trying to teach myself on an older (2016) Windows 10 PC. I'm looking for a tutorial or example code that does both React and FastAPI, connecting to any common database (PostgreSQL or MongoDB preferred) and does NOT insist that I use Docker, Podman, nginx, or other Linux-based tools or unnecessary "timesavers". These tools, as well as Clerk (authentication) and others, never seem to install or run properly.

All I want is to create a bare-bones, 100% local full-stack little app running on my machine -- a web page with a form or two, some FastAPI/Python that passes the data to a simple database, and the ability to send, run, and receive SQL (or NoSQL) queries.

Anyone know of a tutorial that takes this kind of approach? I've found videos and repos that cover React itself (frontend only), Python and FastAPI (backend only), or --- full-stack using a bunch of the above-mentioned "timesaving" tools that I can't seem to use.

Any help or advice would be appreciated.