Hey everyone! I'm currently developing a responsive web app using React, and I'm on the hunt for a FastAPI boilerplate that meets certain criteria or is easily adaptable to include them. Specifically, I need the following features:
1. User registration and authentication routes.
2. Integration with a MySQL database, including tables for users and access tokens (like UUID).
3. Request validation that allows me to specify required parameters and set limitations based on the database (like VARCHAR(30) for a user's first name).
4. The capability to mark routes as requiring authentication or not (possibly through decorators).
5. Support for different user levels, where some routes require users to have specific levels stored as integers in the users table.
6. Models that can be easily extended for the frontend.
I'd really appreciate any recommendations or insights! I've gone through tons of boilerplates, but none of them fit my needs perfectly.
4 Answers
I recommend just building this from scratch. With all the FastAPI extensions available and using Pydantic and SQLAlchemy, you can accomplish 90% of what you need by learning as you go. Using a boilerplate might complicate things more than it helps. Plus, the FastAPI docs are super helpful for customizing your app while you develop your understanding.
You can find what you need easily enough. Are you just coding for the vibe or actually digging deep into it?
"You can find this anywhere" doesn’t help; you didn’t even link to anything.
Have you looked into [FastAPI-users](https://fastapi-users.github.io/fastapi-users/latest/)? It might cover a lot of your requirements and save you some time.
I created a project that includes almost all the features you're looking for, though it's currently tailored for Postgres rather than MySQL. You might want to check it out: [fastapi-forge](https://github.com/mslaursen/fastapi-forge). You’ll need to tweak it a bit to fit your needs, though.
No need to come off like that... It’d help if you shared some useful resources instead.