# Super simple API-based stock terminal

Run the backend with

```bash
DB_URI=postgresql+asyncpg://user:password@server/dbname uvicorn retailtwin.api.main:app
```

Use Caddy to reverse proxy and the following Caddyfile. Paths are static so you have to run caddy from the root of the package

```
:80 {
    handle_path /api/v1/* {
        reverse_proxy localhost:8000
    }
    file_server {
        root src/retailtwin/api/static
    }
}
```

If you execute

```bash
caddy run -c Caddyfile
```

You should be able to browse the application at http://127.0.0.1, and reach the api docs at http://127.0.0.1/api/v1/docs

Caddy can be installed in with Chocolatey on Windows, and with Homebrew on mac.