# ows-campaigns [DEPRECATED]

This project is not in development anymore. The core functionality has been moved to [ows-dmp](https://github.com/theorchard/ows-dmp).

---

Orchard web service for managing Audience marketing campaigns

The Orchard Web Service for managing Audience marketing campaigns.

## Getting Started

### Installation

Before starting make sure you have `python3.11` installed.
An easy way to manage python versions is with `pyenv`:

```bash
$ pyenv install 3.11.2
$ pyenv global 3.11.2
```

Make sure you have `Poetry` installed (https://python-poetry.org/docs/#installation).

```bash
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
```

Prepare environment and install dependencies:

```bash
$ cd ows-campaigns
$ make env
```

### Running

Copy environment variables:

```bash
cp .env.shadow .env
```

When all dependencies have been installed, you can run the FastAPI application
on your local instance by running:

```bash
make dev
```

All make commands will automatically install all dependencies in a virtual environment folder called env.
You can activate a virtual environment by running `. env/bin/activate` or `source env/bin/activate`.

By using the development server, you will have access to specific features that
are not necessarily available in production, such as the exception tracer.

### Testing

To run the tests, all you have to do is to run:

```bash
(ows-campaigns-abcdefgh-py3.10) $ pytest tests/unit/
(ows-campaigns-abcdefgh-py3.10) $ pytest tests/integration/
```

or

To run unit tests: `make test`

To run unit tests with coverage reporting: `make test_unit`

To run integration tests: `make test_integration`

### Updating

To install new dependencies.

```bash
poetry install
```

### OpenAPI specification

OpenAPI specification available for dev environment only.

Go to http://localhost:5000/docs to view Swagger UI.

To generate `OpenAPI YAML`:

```bash
$ make openapi
```

### Linting

To lint: `make lint`

To format: `make fmt`

### Third-Party Integrations for Reporting

This boilerplate comes with support for Sentry, and Datadog.
