- This is the repository of the APIs that my TechLog blog will use in order to do the CRUD operations on the article data
- Initially this project was planned to be implemented as an Express.js backend service.
- However, having decided to be a Python/ML expert, I have decided to use FastAPI.
- Hence this project has been migrated from the previous TS codebase into the Python codebase using FastAPI, which you currently see as of now.
-
This project uses the following list of technologies
-
Backend Framework: FastAPI with Python version 3.11
-
Database: we use PostgreSQL with SQLAlchemy 2.0
- for the driver adapter, I use asyncpg; this is because I wanted to implement the I/O operations as asynchrous ones as much as possible
- for database migration, I use alembic 1.10.3
- why choose alembic over other ORM-agonostic tools such as flyway or liquibase?: see this link on how we usually organize a microservice and its DB
-
Python related tools
- package managing tool: poetry
- code formatter: black
- linter: ruff
- unit testing: pytest
- I wrote an article on these tools
-
CI/CD tools
- Github Actions(cloud vendor specific deployment workflows are to be added in the production code)
- Terraform is used for managing the overall infrastructure
-
-
These are the tools that I will adopt in the near future
This project tries to adopt what is called Hexagonal pattern. This may be a little bit of overkill for this small project. However, this pattern allows us to follow the SOLID principle easier, and the code becomes more readable and testable.
Above of all, I am very happy with this pattern since it forces the developer to think the business logic(the "domain" layer) first, so that we can quickly adjust to any frequent changes in the codebase.
This project is based on the serverless technologies, such as AWS Lambda and serverless database services.