Translation between Spring Boot and FastAPI

TaskSpring BootFastAPI
Generate project structurehttps://start.spring.io/https://fastapi.tiangolo.com/project-generation/
Define API routes@RequestMappingAPIRouter
Deal with database (ORM & Querying)HibernateSQLAlchemy
Entity to Data Transfer Object (DTO)ModelMapperPydantic.BaseModel
(with orm_mode = True)
Database MigrationLiquibase, FlywayAlembic
Dependency ManagementMaven / GraddlePip
HTTP Request InterceptorAspectJ, ServletFilterDepends, Middleware
Built-in AuthenticationSpring SecurityFastAPI.security
Read Environment file @Value(“${key}”)
Files .properties
Pydantic.BaseSetting
File .env
OpenAPIspringdoc-openapiIt has a built-in module. Access at localhost:8000/docs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s