This repository shows how to easily integrate optimization into a frontend application via Opvious.
The code in this repository is divided into two folders:
/app
, containing frontend application code. This example uses Next.js but many other frameworks would work equally well./specification
, containing the model's definition. Here we use the Sudoku assistant model as illustration.
For most use-cases, we recommend using separate repositories for each of the above folders when moving beyond the prototyping stage. If you already have an existing frontend application, simply extend it correspondingly.
-
Create an Opvious API token and store it as
OPVIOUS_TOKEN
environment variable -
Build the model and register it
cd specification
poetry install --all-extras
poetry run poe register
- Run the frontend application
cd app
npm i
npm run dev
That's it - open the link printed by the last command to start optimizing!