r0x0r /
pywebview-react-boilerplate
Build GUI applications with Python and React. A simple boilerplate based on pywebview.
69/100 healthLoading repository data…
hethon / repository
A simple boilerplate for building web-powered Telegram bots with python-telegram-bot and Starlette.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
I often use this structure when building web-powered Telegram bots. After reusing it so many times, I decided to organize it nicely and share it here. Hope it helps you get started faster!
ERROR_LOG_CHAT_ID.SECRET_TOKEN and WEBHOOK_URL to enable webhook modeUSE_TEST_SERVER=yes and TEST_SERVER_BOT_TOKEN to use the test serverUSE_TEST_SERVER is not set, the bot uses the production serverTEST_SERVER_BOT_TOKEN is required if USE_TEST_SERVER=yesptb-starlette-starter
├── config/ # Configuration and localization
│ ├── config.py # Main configuration file
│ └── locale/ # Locale files
├── persistence/ # persistence files
├── ptb/ # Telegram bot logic
│ ├── handlers.py # Command and message handlers
│ ├── custom_context.py # Custom context implementation
│ ├── custom_updates.py # Custom update definitions
│ ├── error_handler.py # Error handling logic
│ ├── helpers.py # Helper functions
│ ├── post_init.py # Post-initialization logic
│ └── tg_app.py # Main bot application
├── stl/ # Starlette application logic
│ ├── routes.py # Starlette routes
│ └── starlette_app.py # Starlette app configuration
├── scripts/ # Utility scripts
│ └── set_webhook.py # Script to set webhooks
├── .env.example # Example environment file
├── requirements.txt # Python dependencies
└── main.py # Main entry point
This project uses UV for dependency managment.
create your project directory and cd into it:
mkdir my-project
cd my-project
Clone this repository:
git clone https://github.com/hethon/ptb-starlette-starter.git .
Set up the .env file by copying .env.example and filling in the necessary variables:
cp .env.example .env
Run the Alembic migration script
uv run -- alembic upgrade head
alembic upgrade head will set up the demo database schema (create the demo table) so the bot can start working right away.Run the webserver with uvicorn or any ASGI server of your choice:
uv run -- uvicorn main:app
The project runs in webhook mode if WEBHOOK_URL is set and not commented out in .env; otherwise, it defaults to polling mode.
If you are building a Telegram miniapp, this setup lets you handle both your bot and miniapp with a single backend, making communication between them fast and easy.
If your bot uses Telegram's game platform, running your bot and web server together simplifies the whole process of keeping them in sync.
If you think about monitoring/controlling your bot's state via a website, this setup makes it easy as you can simply create endpoints to do that.
Contributions are welcome! Feel free to fork the repository, create a branch, and submit a pull request.
Selected from shared topics, language and repository description—not editorial ratings.
r0x0r /
Build GUI applications with Python and React. A simple boilerplate based on pywebview.
69/100 healthtomasemilio /
FastAPI Starter: A simple and intuitive example repository showcasing basic functionality and best practices for building web APIs with FastAPI. Use this as a template or reference for accelerating your FastAPI projects
80/100 healthvvatelot /
This is a simple boilerplate MVC like project to create quickly application with great components (Fastapi, Prisma, HTMX...)
safijari /
A Python package that makes building pybind11 modules with cmake dead simple by using headers from pybind11 python package and supplying all the cmake boilerplate
27/100 healthwwwtyro /
A dead simple web terminal that gets all of the boilerplate out of the way and lets you do 100% of your work on the server side and in python.
13/100 healthlaurindoisaac /
Craft complex trading strategies with remarkably simple Python. Access 300+ indicators, multi-symbol/timeframe support, spot/futures trading, partial fills, and risk management tools. Focus on logic, not boilerplate.
62/100 health