A Python application designed to serve as a feature rich personal blogging framework.
It parses Markdown files organized into numbered folders to generate an easy
navigable list of articles.
Thanks to the power of FastAPI and various Markdown addons,
it simplifies the process of building and managing blogs.
This app also provides optional database integration for storing article views, Prometheus metrics for monitoring, hot reloading for efficient development and an interactive article listing thanks to the use of the HTMX JavaScript framework.
This project is far from perfect, it has some flaws and caveats. I advise you to not run
it in production untill a major stable release is pushed (v1.x.x or higher)
For more information on what is and is not implemented, please refer to the documentation or
the roadmap section of this readme.
-
Markdown-Based Articles: Easily manage articles in Markdown format, making backup and migration a breeze.
-
Frontmatter Metadata: Categorize articles, display informative titles, and sort content by date, author, and more.
-
Seamless Article Navigation: HTMX-powered list of articles on the homepage for smooth reader navigation.
-
(Optional) Database Integration: Store and retrieve article view metrics securely using cookie sessions, ensuring user privacy.
-
Prometheus Metrics: Monitor server performance, request/response stats, and website health for valuable insights.
-
Hot Reloading: Swiftly iterate with real-time updates to Markdown files and the codebase, streamlining writing and development.
-
This project was started in order to "test my skills in the field" and also serve as a personal blogging platform for myself, later i decided to make app accessable to anyone.
Maybe this meme will describe the situation the best:
-
Popular != Good
. HTMX is fast and lightweight. There is abosulutely no reason to spin up a whole node server to serve simple interactivity (in this case just a postlist and cookie banner), htmx has all the nescessary tools to ship a feature rich app.
To get started with the blog app, see the Getting started section of the app documentation or follow the steps below or :
-
Make sure you have
docker
,docker-compose
andgit
installed (optionallypython
andpoetry
) -
Clone this repository
-
Copy the
.env.example
file to.env
and edit nescessary settings -
Edit some Markdown files in the designated
posts
folder. Utilize the frontend metadata to enhance the user experience. -
If you want to configure the database settings to store article view metrics. Refer to the provided documentation for instructions on how to set up and connect to your database.
-
Build and run the app
-
If you prefer
poetry
:poetry install poetry run python main.py
-
If you prefer
docker
:docker compose up
(Note: add the
-d
flag to start in the background)
-
-
Access the platform in your browser at
https://localhost:port
, the port being:- If docker: The port specified in the
docker-compose.yml
file (default external is 8080) - If poetry: The
APP_PORT
variable in the.env
file
- If docker: The port specified in the
- General
- Documentation
- Use npm for dependencies
- Makefile for simplicity
- Rate limiting (toggled with ENV variable)
- Better article folder structure instead of numbered folders
- Example setups with reverse proxies (Traefik, Nginx)
- Custom logger both for uvicorn and regular logs
- Use a TOML config to configure internal app settings
- Code optimizations and improvements
- Tests
- Proper unit tests
- Code coverage integration
- Dont a mock database, better split the logic
- Improve the Database logic
- Make the app fully asynchronous
- Use a SSG solution for generating articles instead of parsing markdown on request
- Tests
- Frontend
- Darkmode
- Proper style guide & a sane theme
Contributions are welcome! If you encounter any issues, have suggestions for improvements, or would like to add new features to the app, please open an issue or submit a pull request.
The app is open-source and released under the MIT License.