# monday-com-orca-backend

<p>
  <a href="https://www.python.org/">
    <img src="https://img.shields.io/badge/Python-3.12-3776AB?logo=python&logoColor=FFD43B" alt="Python 3.12">
  </a>
  <a href="https://mypy-lang.org/">
    <img src="https://img.shields.io/badge/Mypy-type%20checking-22223B?logo=mypy&logoColor=E2E2E2" alt="Mypy">
  </a>
  <a href="https://black.readthedocs.io/">
    <img src="https://img.shields.io/badge/Black-code%20formatting-000000?logo=black&logoColor=FFD43B" alt="Black">
  </a>
  <a href="https://flake8.pycqa.org/">
    <img src="https://img.shields.io/badge/Flake8-linting-FF5F00?logo=flake8&logoColor=FFFFFF" alt="Flake8">
  </a>
  <a href="https://pycqa.github.io/isort/">
    <img src="https://img.shields.io/badge/isort-formatting-00B4AB?logo=isort&logoColor=FFFFFF" alt="isort">
  </a>
  <a href="https://docs.pytest.org/">
    <img src="https://img.shields.io/badge/Pytest-testing-FFD600?logo=pytest&logoColor=22223B" alt="Pytest">
  </a>
  <a href="https://pre-commit.com/">
    <img src="https://img.shields.io/badge/Precommit-hook-6C3483?logo=pre-commit&logoColor=FFFFFF" alt="Precommit">
  </a>
</p>
This is the backend for the Monday.com ORCA project. It is an API acting as proxy between the Monday.com ORCA Frontend
and protected resources like Snowflake.

All API endpoints are protected and thus only accessible with a valid access token. This token
is generated by Monday.com and passed by the frontend to the backend.

Only Orchard users with
an active Monday.com account have such tokens, and therefore only they can make requests to the API.

## Requirements

Refer to the `pyproject.toml` file for the required packages (Poetry is used for dependency management. You can
install Poetry with `pip install poetry` and then run `poetry install` to install the dependencies).

Or just check the `Getting Started` section below for easy, automated setup of the development environment.

## Getting Started

To start developing, fork the repository and clone it to your local machine.

Then run the following script to set up the necessary stuff:

```bash
./scripts/new-developer-setup.sh
```

You will also need to provide certain environment variables. You can find the required variables in the
`environment_vars.py` file.

## Pre-commit Hook

This project uses a pre-commit hook to help pass CICD tests and keep the codebase clean and consistent.

The hook automatically runs tools like mypy (type checking), black (code formatting), flake8 (linting), and isort (import sorting) every time you make a commit. The configuration is in `.pre-commit-config.yaml`.

You **do not** need to manually set up the pre-commit hook manually if you run the `new-developer-setup.sh` script.

If you ever need to reinstall the hook manually, you can do so with:

```bash
pre-commit install
```
