Metadata-Version: 2.4
Name: basehook
Version: 0.1.0
Summary: A modern Python project
Author-email: Your Name <your.email@example.com>
License: MIT
Project-URL: Homepage, https://github.com/yourusername/basehook
Project-URL: Repository, https://github.com/yourusername/basehook
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: sqlalchemy[asyncio]>=2.0
Requires-Dist: fastapi>=0.115.0
Requires-Dist: uvicorn>=0.40.0
Requires-Dist: asyncpg>=0.29.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: httpx>=0.24.0; extra == "dev"
Requires-Dist: asyncpg>=0.29.0; extra == "dev"
Requires-Dist: asgi-lifespan>=2.1.0; extra == "dev"
Requires-Dist: pytest-asyncio>=1.3.0; extra == "dev"

# 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:

```bash
# 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](https://railway.app/button.svg)](https://railway.app/new/template?template=https://github.com/mehdigmira/basehook)

**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

```bash
# 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

```python
from basehook import app

# Use the API
result = app.get("/example")
response = app.post("/example", {"key": "value"})
```

## Development

### Running Tests

```bash
pytest
```

### Code Formatting

```bash
# Format code with black
black src/ tests/

# Lint with ruff
ruff check src/ tests/
```

### Type Checking

```bash
mypy src/
```

## License

MIT
