Looking for a FastAPI Boilerplate for User Management and Validation

0
2
Asked By SillyTurtle99 On

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

Answered By CraftyCoder23 On

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.

Answered By GrumpyCoder17 On

You can find what you need easily enough. Are you just coding for the vibe or actually digging deep into it?

ChillCoder99 -

No need to come off like that... It’d help if you shared some useful resources instead.

HelpfulDev12 -

"You can find this anywhere" doesn’t help; you didn’t even link to anything.

Answered By TechyExplorer88 On

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.

Answered By FastAPIFanatic42 On

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.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.