PodGen is a podcast episodes generator service. Users can create podcast episodes, fetch a list of episodes, auto-generate alternative titles or descriptions via LLM, integrate external episodes via RSS.
- High-performace Python web framework for building APIs.
- Fully asynchronous using
async defpath operation, enabling non-blocking oprations. - Fast and Robust data validation using SQLModel (which is based on Pydantic) and Pydantic library.
- Integrated with PostgreSQL using Docker image and SQLModel library.
- Seamless containerzation using Docker / Docker compose.
- Environment configuration.
- Project documentation with MkDocs material
Using the asynchronous programming paradigm significantly improves the performance and responsiveness of an application.
- Improved Performance: FastAPI can handle a higher volume of requests with minimal resource consumption.
- Enhanced Responsiveness: Users experience faster response time.
- Better suited with databases: Significantly improves database interaction.
I had never used SQL databases before, so I challenged myself to learn by using PostgreSQL for this project.
PostgreSQL setup options:
- Local setup: Recommend to use Docker container for development stages due to simplicity, isolation and portability across environments.
- Producation setup: Use PostgreSQL hosting platforms for a managed experience and easier deployment. (e.g., Supabase)
If you want to use Supabase, you must connect via the session pooler.
Because, It offers a free tier with good speed and perfomance, making it good choice for development or even producation.
For the GroqClient, I use LangChain framework. LangChain is a framework that makes it easy to build application with LLMs.
Combined with Groq API to achieve fast inference speed and maintain simplicity.
aiogram is built on Python`s asyncio, which makes it highly efficient and scalable. It also comes with a rich set of features, including:
- Type Hints: Comprehensive type hinting support for better code assistance in IDEs.
- Middleware: Flexible middleware system for request processing.
- Routers: Advanced routing system for organizing commands and message handlers.
- FSM: Built-in Finite State Machine for complex conversation flows.
- Filters: Extensible filters system for handling specific messages and callbacks.
I used the Beatiful Soap 4 and lxml libraries. Beatiful Soap 4 is a Python library that makes it easy to parse information from HTML and XML documents. The lxml is the most feature-rich, easy-to-use and fastest library for processing XML and HTML in the Python language. Together, they allow efficient parsing of RSS feeds, which are XML-based.
In the .env file.
FastAPI has asynchronous features make it one of the best web frameworks. However, because of its use of asynchronous code, testing a FastAPI API can be more complex than a standard synchronous API.
I've attemted to write tests for FastAPI endpoints multiples times, but often run into obstacles like:
- Confusion around how to mock dependencies.
- Difficulty in integrating
pytestwith async functions. - Getting a lot of errors related to the implementation of
conftest.py. - Switching to a test database.
If you want to experiment with pytests and run your test suite, simply execute the following command in the project root: pytest