diff --git a/README.md b/README.md index f47737d..fdf3744 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # Save it -A telegram bot who save what you love in internet. +A telegram bot can Save photos and Search photos + +- [x] Save photos via a link +- [x] Search photos using semantic search +- [x] Find similar photos by photo ## supported services @@ -11,10 +15,30 @@ A telegram bot who save what you love in internet. ## Usage +### Save Photos + Just send the link to the bot. https://github.com/user-attachments/assets/4a375cab-7124-44f3-994e-0cb026476d39 +### Search Photos + +messages: + +``` +/search cat + +/search dog + +/search girl + +/similar photo + +/similar photo +``` + +https://github.com/user-attachments/assets/b0dedcc0-3305-42b2-8101-6b0b5d32f17a + ## Playground https://t.me/save_it_playground @@ -24,6 +48,7 @@ https://t.me/save_it_playground - [Elixir](https://elixir-lang.org/) - [ex_gram](https://github.com/rockneurotiko/ex_gram) - [cobalt api](https://github.com/imputnet/cobalt/blob/current/docs/api.md) +- [Typesense](https://typesense.org/) ## Development @@ -35,8 +60,8 @@ mix deps.get ```sh # run export TELEGRAM_BOT_TOKEN= -# export GOOGLE_OAUTH_CLIENT_ID= -# export GOOGLE_OAUTH_CLIENT_SECRET= +export TYPESENSE_URL= +export TYPESENSE_API_KEY= iex -S mix run --no-halt ``` diff --git a/config/runtime.exs b/config/runtime.exs index 8057887..047283f 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -3,10 +3,11 @@ import Config config :save_it, :telegram_bot_token, System.get_env("TELEGRAM_BOT_TOKEN") config :ex_gram, token: System.get_env("TELEGRAM_BOT_TOKEN") -config :save_it, :google_oauth_client_id, System.get_env("GOOGLE_OAUTH_CLIENT_ID") -config :save_it, :google_oauth_client_secret, System.get_env("GOOGLE_OAUTH_CLIENT_SECRET") - config :save_it, :typesense_url, System.get_env("TYPESENSE_URL", "http://localhost:8100") config :save_it, :typesense_api_key, System.get_env("TYPESENSE_API_KEY", "xyz") + # optional +config :save_it, :google_oauth_client_id, System.get_env("GOOGLE_OAUTH_CLIENT_ID") +config :save_it, :google_oauth_client_secret, System.get_env("GOOGLE_OAUTH_CLIENT_SECRET") + config :save_it, :web_url, System.get_env("WEB_URL", "http://localhost:4000") diff --git a/lib/save_it.ex b/lib/save_it.ex index 90db469..8ef228d 100644 --- a/lib/save_it.ex +++ b/lib/save_it.ex @@ -1,4 +1,7 @@ defmodule SaveIt do + @moduledoc false + + @doc false def hello do :world end diff --git a/lib/save_it/bot.ex b/lib/save_it/bot.ex index 884c2b7..3390101 100644 --- a/lib/save_it/bot.ex +++ b/lib/save_it/bot.ex @@ -23,8 +23,8 @@ defmodule SaveIt.Bot do setup_commands: true command("start") - command("similar", description: "Find similar photos") command("search", description: "Search photos") + command("similar", description: "Find similar photos") command("about", description: "About the bot") command("login", description: "Login") diff --git a/mix.exs b/mix.exs index 721ab7d..ae1ef06 100644 --- a/mix.exs +++ b/mix.exs @@ -4,16 +4,17 @@ defmodule SaveIt.MixProject do def project do [ app: :save_it, - version: "0.1.0", - deps: deps(), - start_permanent: Mix.env() == :prod + version: "0.2.0-rc.1", + elixir: "~> 1.17", + start_permanent: Mix.env() == :prod, + deps: deps() ] end # Run "mix help compile.app" to learn about applications. def application do [ - extra_applications: [:logger], + extra_applications: [:logger, :crypto, ex_unit: :optional], mod: {SaveIt.Application, []} ] end