twilio-webhooks-inbound
==================

## Overview
An AWS Lambda handler (invoked via an AWS Application Load Balancer - ALB) that processes and validates Twilio inbound webhook requests and then forwards incoming message to ows-text-campaigns service. Always returns empty TwiML response, actual sms response will be generated by ows-text-campaigns service.

## Getting Started

### Requirements
Minimum requirements and recommended tooling:

- Python: 3.13
- UV (astral `uv` tool) for environment and task running (see `pyproject.toml` `tool.uv` configuration)
- Docker and Docker Compose (used for CI targets)
- Make (for provided Makefile targets)

Developer tooling (used in CI / recommended):

- `pytest` (unit tests)
- `ruff` and `pyright` (linting / type checks)

Quick version checks:

### Installation
```bash
# Install uv (if not installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install project dependencies
make env
```
### Configuration
For local development copy the provided example environment file to `.env`:

```bash
cp .env.example .env
```

After copying, edit `.env` and fill in any required values (for example Postgres credentials or AWS settings) before running the service or tests.

## Testing

### Unit tests
Run the project's unit tests with:

```bash
make test
```
## Linting and formatting
Run the linter with:

```bash
make lint
```

Run the code formatter with:

```bash
make fmt
```

## Running locally
This AWS Lambda is not intended to be run locally — it is designed to handle real requests based on SMS messages from sender. For local checks use the unit tests (`make test`) and the linter/formatter (`make lint`, `make fmt`).
