From a6bc3e74ba67e5e64cd1ff19ffa0f18445872889 Mon Sep 17 00:00:00 2001 From: prplV Date: Mon, 23 Jun 2025 09:59:29 -0400 Subject: [PATCH] setup and go --- .env.example | 20 ++++++++++++++++++++ Cargo.toml | 10 ++++++++++ src/endpoints.rs | 5 +++++ src/main.rs | 6 +++++- src/schemas.rs | 0 5 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .env.example create mode 100644 src/endpoints.rs create mode 100644 src/schemas.rs diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3833473 --- /dev/null +++ b/.env.example @@ -0,0 +1,20 @@ +# `ML_API` mod's `.env` EXAMPLE + +# `URL` and `ENDPOINT` that are used by model's API to integrate with +# ------------------------------------------------------------------- +# i.e. using with `ollama` should set it to: +# http://{BASE_URL}:11434/api/generate +# ------------------------------------------------------------------- +ML_TARGET_URL="http://url.to/ml/api" + +# `ML_API` log level selecetion (default - `INFO`) +# ----------------------------------------------- +# Existing options: +# 1) TRACE - full log info +# 2) DEBUG +# 3) INFO - common log info +# 4) WARN +# 5) ERROR +# 6) OFF - disabled logs +# ----------------------------------------------- +ML_LOG_LEVEL="INFO" diff --git a/Cargo.toml b/Cargo.toml index 21fcd4f..fd305d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,3 +4,13 @@ version = "0.1.0" edition = "2024" [dependencies] +anyhow = "1.0.98" +axum = { version = "0.8.4", features = ["ws"] } +dotenv = "0.15.0" +lazy_static = "1.5.0" +reqwest = "0.12.20" +serde = { version = "1.0.219", features = ["derive"] } +serde_json = "1.0.140" +tokio = { version = "1.45.1", features = ["full"] } +tracing = "0.1.41" +tracing-subscriber = "0.3.19" diff --git a/src/endpoints.rs b/src/endpoints.rs new file mode 100644 index 0000000..2e84c49 --- /dev/null +++ b/src/endpoints.rs @@ -0,0 +1,5 @@ +pub mod openapi {} + +pub mod ws {} + +pub mod rest {} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index e7a11a9..a591904 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,7 @@ -fn main() { +mod endpoints; +mod schemas; + +#[tokio::main(flavor = "multi_thread")] +async fn main() { println!("Hello, world!"); } diff --git a/src/schemas.rs b/src/schemas.rs new file mode 100644 index 0000000..e69de29