# SRTS200 Radome Measurement Pedestal Control Software

## Development Platform
- Windows 10

## Requirements
- Python 3.12

## Initialization (One-Time Setup)
```bash
sudo apt install python3-pdm  # system-wide briefcase
pdm init                      # create project
pdm config python.use_venv true
pdm venv create
pdm use .venv/Scripts/python
pdm add <package>             # add dependencies  
```

## Building
``` bash
pdm config python.use_venv true
pdm use .venv/bin/python
source .venv/Scripts/activate
pdm install
```

## Development

Obtain truested certifcates for HTTPS
```bash
sudo apt install mkcert                 # trusted certifier
mkcert -install                         # obtain ssl certificates
mkcert localhost 127.0.0.1 ::1
sudo apt install libnss3-tools          # install for browsers
mkcert -install
```

### Run with quart
```bash
source .venv/bin/activate
cd src/dash_api
quart run --reload --key ../../localhost+2-key.pem --cert ../../localhost+2.pem --port 7339

```

## Production

### Run with pm2
```bash
source .venv/bin/activate
cd src
export PRODUCTION=1 && pm2 start src/dash_api/app.py --name "dash-api"

```