This project is a showcase of a prompt library powered by Rust and Poem. It offers an interface compatible with OpenAI to store, retrieve and delete your prompts form MongoDB.
You can run this package as a standalone using either cargo or Docker. The project can be configured using a file or environment variables. Make sure to check the configuration section before running the application.
Running in docker is a breeze with the provided compose file, yuo just need to run:
docker compose up app
Running directly with cargo requires you to previously setup a mongodb to use. Check the configuration section on the variables need for the mongo connection.
Once you have setup a MongoDB database you can run the command:
cargo run --release
Current variables can be seen in the file example.env. It provides the following variables:
# Application port
PORT=8080
# Application log level
LOG_LEVEL="debug"
# URI to which mongoDB will connect
DB_URI="mongodb://mongo:27017"
# Name of the database to be used as root database
DB_NAME="promptier"
Modify them per your needs and rename to .env
. The application will only read variables from a file named .env
.