From 625730eab32398a161c32596815bacfb087af17c Mon Sep 17 00:00:00 2001 From: Tom Konidas Date: Tue, 20 May 2025 22:27:27 -0400 Subject: [PATCH 1/3] Redesign header/footer --- .../components/layouts/app.html.heex | 67 ++++++++++++++++--- .../components/layouts/root.html.heex | 4 +- lib/plexus_web/live/app_live/index.ex | 2 +- lib/plexus_web/live/home_live.ex | 3 + lib/plexus_web/live/home_live.html.heex | 0 lib/plexus_web/router.ex | 3 +- 6 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 lib/plexus_web/live/home_live.ex create mode 100644 lib/plexus_web/live/home_live.html.heex diff --git a/lib/plexus_web/components/layouts/app.html.heex b/lib/plexus_web/components/layouts/app.html.heex index d28dfb4b..f4d63c3d 100644 --- a/lib/plexus_web/components/layouts/app.html.heex +++ b/lib/plexus_web/components/layouts/app.html.heex @@ -1,29 +1,80 @@ -
-
+
+
-
+
<.flash_group flash={@flash} /> {@inner_content}
+ diff --git a/lib/plexus_web/components/layouts/root.html.heex b/lib/plexus_web/components/layouts/root.html.heex index ce138d6c..b35d8b3e 100644 --- a/lib/plexus_web/components/layouts/root.html.heex +++ b/lib/plexus_web/components/layouts/root.html.heex @@ -4,7 +4,7 @@ - <.live_title suffix=" · Plexus"> + <.live_title suffix=" | Plexus"> {assigns[:page_title] || "Plexus"} @@ -43,7 +43,7 @@ - + {@inner_content} diff --git a/lib/plexus_web/live/app_live/index.ex b/lib/plexus_web/live/app_live/index.ex index cf25ec52..b8b70dc7 100644 --- a/lib/plexus_web/live/app_live/index.ex +++ b/lib/plexus_web/live/app_live/index.ex @@ -73,7 +73,7 @@ defmodule PlexusWeb.AppLive.Index do term -> %{q: term} end - {:noreply, push_patch(socket, to: ~p"/?#{params}")} + {:noreply, push_patch(socket, to: ~p"/apps?#{params}")} end def handle_event("next-page", _, socket) do diff --git a/lib/plexus_web/live/home_live.ex b/lib/plexus_web/live/home_live.ex new file mode 100644 index 00000000..3fcf1813 --- /dev/null +++ b/lib/plexus_web/live/home_live.ex @@ -0,0 +1,3 @@ +defmodule PlexusWeb.HomeLive do + use PlexusWeb, :live_view +end diff --git a/lib/plexus_web/live/home_live.html.heex b/lib/plexus_web/live/home_live.html.heex new file mode 100644 index 00000000..e69de29b diff --git a/lib/plexus_web/router.ex b/lib/plexus_web/router.ex index 063df407..e506e136 100644 --- a/lib/plexus_web/router.ex +++ b/lib/plexus_web/router.ex @@ -28,7 +28,8 @@ defmodule PlexusWeb.Router do scope "/" do pipe_through :browser - live "/", PlexusWeb.AppLive.Index, :index + live "/", PlexusWeb.HomeLive, :index + live "/apps", PlexusWeb.AppLive.Index, :index get "/swaggerui", OpenApiSpex.Plug.SwaggerUI, path: "/api/openapi" end From 081ea203420cb2e61ee8a433f56730104de3aa97 Mon Sep 17 00:00:00 2001 From: Tom Konidas Date: Wed, 21 May 2025 19:01:47 -0400 Subject: [PATCH 2/3] Homepage redesign --- assets/css/app.css | 42 ++++ lib/plexus/apps.ex | 12 + lib/plexus/ratings.ex | 68 ++++++ .../components/layouts/app.html.heex | 4 +- .../controllers/sitemap_controller.ex | 2 +- lib/plexus_web/live/home_live.ex | 30 +++ lib/plexus_web/live/home_live.html.heex | 205 ++++++++++++++++++ priv/static/images/de_googled.svg | 38 ++++ priv/static/images/micro_g.svg | 125 +++++++++++ 9 files changed, 523 insertions(+), 3 deletions(-) create mode 100644 priv/static/images/de_googled.svg create mode 100644 priv/static/images/micro_g.svg diff --git a/assets/css/app.css b/assets/css/app.css index 7e9e2e36..fceb1ce0 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -1,2 +1,44 @@ @import "tailwindcss"; /* This file is for your main application CSS */ + +@theme { + --color-gold-100: #fff8e1; + --color-gold-200: #ffecb3; + --color-gold-300: #ffe082; + --color-gold-400: #ffd54f; + --color-gold-500: #ffca28; + --color-gold-600: #ffc107; + --color-gold-700: #ffb300; + --color-gold-800: #ffa000; + --color-gold-900: #ff8f00; + + --color-silver-100: #f4f4f5; + --color-silver-200: #e4e4e7; + --color-silver-300: #d4d4d8; + --color-silver-400: #a1a1aa; + --color-silver-500: #9ca3af; + --color-silver-600: #71717a; + --color-silver-700: #52525b; + --color-silver-800: #3f3f46; + --color-silver-900: #27272a; + + --color-bronze-100: #fef1e8; + --color-bronze-200: #f9dbc5; + --color-bronze-300: #f4c4a2; + --color-bronze-400: #efae80; + --color-bronze-500: #cd7f32; + --color-bronze-600: #b87333; + --color-bronze-700: #a65e2e; + --color-bronze-800: #8c4c25; + --color-bronze-900: #703b1c; + + --color-broken-100: #fee2e2; + --color-broken-200: #fecaca; + --color-broken-300: #fca5a5; + --color-broken-400: #f87171; + --color-broken-500: #ef4444; + --color-broken-600: #dc2626; + --color-broken-700: #b91c1c; + --color-broken-800: #991b1b; + --color-broken-900: #7f1d1d; +} diff --git a/lib/plexus/apps.ex b/lib/plexus/apps.ex index fc60d1f6..611593c2 100644 --- a/lib/plexus/apps.ex +++ b/lib/plexus/apps.ex @@ -165,6 +165,18 @@ defmodule Plexus.Apps do end) end + @spec apps_available_count :: pos_integer() + def apps_available_count do + Repo.aggregate(App, :count) + end + + @spec apps_count_since(DateTime.t()) :: pos_integer() + def apps_count_since(datetime) do + App + |> where([app], app.inserted_at >= ^datetime) + |> Repo.aggregate(:count) + end + @spec subscribe :: :ok def subscribe do Phoenix.PubSub.subscribe(Plexus.PubSub, "apps") diff --git a/lib/plexus/ratings.ex b/lib/plexus/ratings.ex index 31fb0a99..62c4eb28 100644 --- a/lib/plexus/ratings.ex +++ b/lib/plexus/ratings.ex @@ -74,6 +74,74 @@ defmodule Plexus.Ratings do |> broadcast(:rating_deleted) end + @spec ratings_submitted_count :: pos_integer() + def ratings_submitted_count do + Repo.aggregate(Rating, :count) + end + + @spec ratings_count_since(DateTime.t()) :: pos_integer() + def ratings_count_since(datetime) do + Rating + |> where([rating], rating.inserted_at >= ^datetime) + |> Repo.aggregate(:count) + end + + def gold_de_googled_count do + Rating + |> where([rating], rating.score >= 4) + |> where([rating], rating.rating_type == :native) + |> Repo.aggregate(:count) + end + + def gold_micro_g_count do + Rating + |> where([rating], rating.score >= 4) + |> where([rating], rating.rating_type == :micro_g) + |> Repo.aggregate(:count) + end + + def silver_de_googled_count do + Rating + |> where([rating], rating.score >= 3 and rating.score < 4) + |> where([rating], rating.rating_type == :native) + |> Repo.aggregate(:count) + end + + def silver_micro_g_count do + Rating + |> where([rating], rating.score >= 3 and rating.score < 4) + |> where([rating], rating.rating_type == :micro_g) + |> Repo.aggregate(:count) + end + + def bronze_de_googled_count do + Rating + |> where([rating], rating.score >= 2 and rating.score < 3) + |> where([rating], rating.rating_type == :native) + |> Repo.aggregate(:count) + end + + def bronze_micro_g_count do + Rating + |> where([rating], rating.score >= 2 and rating.score < 3) + |> where([rating], rating.rating_type == :micro_g) + |> Repo.aggregate(:count) + end + + def broken_de_googled_count do + Rating + |> where([rating], rating.score < 2) + |> where([rating], rating.rating_type == :native) + |> Repo.aggregate(:count) + end + + def broken_micro_g_count do + Rating + |> where([rating], rating.score < 2) + |> where([rating], rating.rating_type == :micro_g) + |> Repo.aggregate(:count) + end + defp broadcast({:error, _reason} = error, _event), do: error defp broadcast({:ok, rating}, event) do diff --git a/lib/plexus_web/components/layouts/app.html.heex b/lib/plexus_web/components/layouts/app.html.heex index f4d63c3d..3a0245b4 100644 --- a/lib/plexus_web/components/layouts/app.html.heex +++ b/lib/plexus_web/components/layouts/app.html.heex @@ -16,7 +16,7 @@ href="https://github.com/techlore/Plexus-app?tab=readme-ov-file#download" class="text-gray-100 bg-gray-900 rounded-md p-2 hover:bg-gray-900/90" > - Download App + Download
@@ -74,7 +74,7 @@

- {Date.utc_today().year()} © Techlore + {Date.utc_today().year} © Techlore

diff --git a/lib/plexus_web/controllers/sitemap_controller.ex b/lib/plexus_web/controllers/sitemap_controller.ex index 75a95ef1..4703fc4f 100644 --- a/lib/plexus_web/controllers/sitemap_controller.ex +++ b/lib/plexus_web/controllers/sitemap_controller.ex @@ -57,7 +57,7 @@ defmodule PlexusWeb.SitemapController do defp change_freq("/swaggerui"), do: "yearly" defp change_freq(_), do: "weekly" - defp last_mod("/") do + defp last_mod(path) when path in ["/", "/apps"] do Plexus.Apps.fetch_most_recently_added_app!() |> Map.fetch!(:inserted_at) |> DateTime.to_date() diff --git a/lib/plexus_web/live/home_live.ex b/lib/plexus_web/live/home_live.ex index 3fcf1813..30f0254f 100644 --- a/lib/plexus_web/live/home_live.ex +++ b/lib/plexus_web/live/home_live.ex @@ -1,3 +1,33 @@ defmodule PlexusWeb.HomeLive do use PlexusWeb, :live_view + + alias Plexus.Apps + alias Plexus.Ratings + + @impl Phoenix.LiveView + def mount(_params, _session, socket) do + {:ok, + socket + |> assign(:page_title, "Crowdsourced de-Googled Android apps status ratings") + |> assign(:metrics, metrics())} + end + + defp metrics do + one_week_ago = DateTime.add(DateTime.utc_now(), -7, :day) + + %{ + apps_available: Apps.apps_available_count(), + new_apps: Apps.apps_count_since(one_week_ago), + ratings_submitted: Ratings.ratings_submitted_count(), + new_ratings: Ratings.ratings_count_since(one_week_ago), + gold_de_googled: Ratings.gold_de_googled_count(), + gold_micro_g: Ratings.gold_micro_g_count(), + silver_de_googled: Ratings.silver_de_googled_count(), + silver_micro_g: Ratings.silver_micro_g_count(), + bronze_de_googled: Ratings.bronze_de_googled_count(), + bronze_micro_g: Ratings.bronze_micro_g_count(), + broken_de_googled: Ratings.broken_de_googled_count(), + broken_micro_g: Ratings.broken_micro_g_count() + } + end end diff --git a/lib/plexus_web/live/home_live.html.heex b/lib/plexus_web/live/home_live.html.heex index e69de29b..96a06359 100644 --- a/lib/plexus_web/live/home_live.html.heex +++ b/lib/plexus_web/live/home_live.html.heex @@ -0,0 +1,205 @@ +
+
+
+
+

+ App compatibility on de-Googled devices +

+

+ Crowdsourced by the community, for the community. +

+
+
+
+
+ + + + + +
+ +
+
+
+
+
Apps available
+
+ {@metrics.apps_available} +
+
+
+
New apps this week
+
+ {@metrics.new_apps} +
+
+
+
Ratings submitted
+
+ {@metrics.ratings_submitted} +
+
+
+
New ratings this week
+
+ {@metrics.new_ratings} +
+
+
+
+

Understanding Plexus Scores

+

+ Each app in Plexus is rated based on how well it functions without + relying on Google. A Gold rating means the app works flawlessly with + no missing features. Silver indicates it mostly works, with only + minor issues. Bronze means the app has limited functionality or + notable problems. Broken is used for apps that crash or fail to work + at all. Additionally, Plexus includes a separate status for microG, + which is an open-source implementation of Google Play Services and + related software. It allows users to run apps that depend on Google + services without using proprietary Google code. +

+
    +
  • +
    + G +
    +
    +
    +
    Gold
    +

    {@metrics.gold_de_googled} de-Googled

    +

    {@metrics.gold_micro_g} microG

    +
    +
    +
  • +
  • +
    + S +
    +
    +
    +
    Silver
    +

    {@metrics.silver_de_googled} de-Googled

    +

    {@metrics.silver_micro_g} microG

    +
    +
    +
  • +
  • +
    + B +
    +
    +
    +
    Bronze
    +

    {@metrics.bronze_de_googled} de-Googled

    +

    {@metrics.bronze_micro_g} microG

    +
    +
    +
  • +
  • +
    + X +
    +
    +
    +
    Broken
    +

    {@metrics.broken_de_googled} de-Googled

    +

    {@metrics.broken_micro_g} microG

    +
    +
    +
  • +
  • +
    + Ø +
    +
    +
    +
    Not Rated
    +
    +
    +
  • +
+
+
    +
  • +
    + de-Googled +
    de-Googled
    +
    +
    +
    +
    + A device that runs without any proprietary Google apps or services. +
    +
    +
    +
  • +
  • +
    + microG +
    microG
    +
    +
    +
    +
    + A device that runs an open-source replacement for Google Play Services. +
    +
    +
    +
  • +
+
+
+
+
+
diff --git a/priv/static/images/de_googled.svg b/priv/static/images/de_googled.svg new file mode 100644 index 00000000..dd7fef58 --- /dev/null +++ b/priv/static/images/de_googled.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/priv/static/images/micro_g.svg b/priv/static/images/micro_g.svg new file mode 100644 index 00000000..ff89dbf3 --- /dev/null +++ b/priv/static/images/micro_g.svg @@ -0,0 +1,125 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + From b9b65d0d3f6c8daa9625779c15c58140d8d03104 Mon Sep 17 00:00:00 2001 From: Tom Konidas Date: Wed, 21 May 2025 20:53:50 -0400 Subject: [PATCH 3/3] Fix app search page --- lib/plexus_web/components/core_components.ex | 39 +++++++----- lib/plexus_web/live/app_live/index.html.heex | 62 +++++++++++++++++--- 2 files changed, 76 insertions(+), 25 deletions(-) diff --git a/lib/plexus_web/components/core_components.ex b/lib/plexus_web/components/core_components.ex index a8e188ac..f706a4ec 100644 --- a/lib/plexus_web/components/core_components.ex +++ b/lib/plexus_web/components/core_components.ex @@ -15,6 +15,12 @@ defmodule PlexusWeb.CoreComponents do Icons are provided by [heroicons](https://heroicons.com). See `icon/1` for usage. """ use Phoenix.Component + + use Phoenix.VerifiedRoutes, + endpoint: PlexusWeb.Endpoint, + router: PlexusWeb.Router, + statics: PlexusWeb.static_paths() + use Gettext, backend: PlexusWeb.Gettext alias Phoenix.LiveView.JS @@ -642,15 +648,16 @@ defmodule PlexusWeb.CoreComponents do ) ~H""" -
-
+
+
{@app.name " Icon"} + loading="lazy" class="h-full w-full object-cover object-center" />
-
+
{@app.name} @@ -663,32 +670,32 @@ defmodule PlexusWeb.CoreComponents do

-
+
- {@app.scores.native.numerator} +
- μ{@app.scores.micro_g.numerator} +
diff --git a/lib/plexus_web/live/app_live/index.html.heex b/lib/plexus_web/live/app_live/index.html.heex index 3f4e57c9..d3481df2 100644 --- a/lib/plexus_web/live/app_live/index.html.heex +++ b/lib/plexus_web/live/app_live/index.html.heex @@ -10,11 +10,59 @@ phx-submit="search" > <.focus_wrap id="focus-first-search"> - <.input field={@form[:search]} label="Search" phx-debounce="300" /> +
+
+ + + + +
+ +
-
    1 && "prev-page"} @@ -26,15 +74,11 @@ if(@page == 1, do: "pt-10", else: "pt-[calc(200vh)]") ]} > -
  • +
    <.card app={app} navigate={~p"/"} /> -
  • -
+
+
No Results
- -
- End of List -