README.md

[![Build](https://github.com/MaxDac/cosmox/actions/workflows/compilation.yml/badge.svg?branch=main)](https://github.com/MaxDac/cosmox/actions/workflows/compilation.yml)

# Cosmox

This project is for internal use only, and it was heavily inspired by [this project](https://github.com/jeramyRR/cosmos_db_ex), 
that should be followed instead.

## Installation

To use Cosmox client, install it from [hex.pm](https://hex.pm) by adding it to the project dependencies.

It will be necessary to start the Cosmox application as well. Include it amog the application supervisor children array 
by adding this line:

```elixir
children = [
  %{
    id: Cosmox.Application,
    start: {Cosmox.Application, :start, [nil, nil]}
  }
]
```

Cosmox uses [Nestru](https://hex.pm/packages/nestru) to automatically converts maps to structs. To use this 
functionality in the `Document` module functions, it could be necessary to include it among the dependencies of 
the project.

## Installation Guide

### Configuring WSL2 to work with local CosmosDB

In order to work with a local instance of CosmosDB, it's necessary to allow a firewall rule between WSL2 and Windows.
In order to do that, input the following commands in a PowerShell administrator shell:

`New-NetFirewallRule -DisplayName "WSL" -Direction Outbound -InterfaceAlias "vEthernet (WSL)" -Action Allow`

`New-NetFirewallRule -DisplayName "WSL-Inbound" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow`