Skip to main content

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:

Deploy on Railway

Steps:

  1. 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: ..."
  2. Add database: In Railway dashboard, click "New" → "Database" → "Add PostgreSQL"

    • Railway detects the new DATABASE_URL environment variable
    • Railway automatically triggers a new deployment
    • ✅ App starts successfully with database connection!

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

basehook-0.1.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

basehook-0.1.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

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

Hashes for basehook-0.1.0.tar.gz
Algorithm Hash digest
SHA256 764efd158cd0fefab8c44f86eb5888b0fcb6efed53295ee3192828d0c710ccdf
MD5 09754189f670c2731d20096d7e94be5f
BLAKE2b-256 d7336b49ffb21c4dd0e70c236a34bc975970677518648722c5b2b9445f4e907f

See more details on using hashes here.

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

Hashes for basehook-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2235fbf53dc62202cfa9e6020e7dd4efc698e23f0139860de391149c45aa9daf
MD5 c075cd332d4c8f7e2f351b969f51985c
BLAKE2b-256 7cb570abed89d34c4bd6d789ed5d71c647f836852e50897b93aacf6a5ee1dac9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page