A modern Python project
Project description
Basehook
A modern webhook management system with thread-based updates and HMAC authentication.
Quick Deploy
🐳 Docker Compose (Recommended for Self-Hosting)
The easiest way to run Basehook with all dependencies:
# Clone the repository
git clone https://github.com/mehdigmira/basehook.git
cd basehook
# Start everything (app + PostgreSQL)
docker-compose up -d
# View logs
docker-compose logs -f
# Stop everything
docker-compose down
What you get:
- ✅ FastAPI application running on port 8000
- ✅ PostgreSQL database (automatically configured)
- ✅ Database tables created automatically
- ✅ Persistent data storage
Access your API at: http://localhost:8000
☁️ Railway (Cloud Hosting)
Deploy to Railway in 2 steps:
Steps:
-
Click the button above → Railway starts deploying your app
- ⚠️ Initial deployment will fail (no database yet - this is expected!)
- You'll see: "Database connection failed: ..."
-
Add database: In Railway dashboard, click "New" → "Database" → "Add PostgreSQL"
- Railway detects the new
DATABASE_URLenvironment variable - Railway automatically triggers a new deployment
- ✅ App starts successfully with database connection!
- Railway detects the new
Why this works: Railway's restart policy automatically redeploys your app when environment variables change.
Features:
- Free tier available
- Automatic HTTPS
- Environment variables auto-configured
- Built-in monitoring and logs
Project Structure
basehook/
├── src/
│ └── basehook/
│ ├── __init__.py
│ └── api.py
├── tests/
├── pyproject.toml
├── .gitignore
└── README.md
Installation
Development Setup
# Create a virtual environment
python3.10 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install the package in editable mode with dev dependencies
pip install -e ".[dev]"
Usage
from basehook import app
# Use the API
result = app.get("/example")
response = app.post("/example", {"key": "value"})
Development
Running Tests
pytest
Code Formatting
# Format code with black
black src/ tests/
# Lint with ruff
ruff check src/ tests/
Type Checking
mypy src/
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file basehook-0.1.0.tar.gz.
File metadata
- Download URL: basehook-0.1.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
764efd158cd0fefab8c44f86eb5888b0fcb6efed53295ee3192828d0c710ccdf
|
|
| MD5 |
09754189f670c2731d20096d7e94be5f
|
|
| BLAKE2b-256 |
d7336b49ffb21c4dd0e70c236a34bc975970677518648722c5b2b9445f4e907f
|
File details
Details for the file basehook-0.1.0-py3-none-any.whl.
File metadata
- Download URL: basehook-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2235fbf53dc62202cfa9e6020e7dd4efc698e23f0139860de391149c45aa9daf
|
|
| MD5 |
c075cd332d4c8f7e2f351b969f51985c
|
|
| BLAKE2b-256 |
7cb570abed89d34c4bd6d789ed5d71c647f836852e50897b93aacf6a5ee1dac9
|