├── lib
├── app_web
│ ├── views
│ │ ├── app_view.ex
│ │ ├── layout_view.ex
│ │ ├── error_view.ex
│ │ └── error_helpers.ex
│ ├── templates
│ │ └── layout
│ │ │ ├── app.html.heex
│ │ │ ├── live.html.heex
│ │ │ ├── icons.html.heex
│ │ │ └── root.html.heex
│ ├── router.ex
│ ├── endpoint.ex
│ ├── telemetry.ex
│ └── live
│ │ ├── app_live.ex
│ │ └── app_live.html.heex
├── app
│ ├── repo.ex
│ ├── application.ex
│ ├── contrib.ex
│ ├── star.ex
│ ├── image.ex
│ ├── reqlog.ex
│ ├── api_manager.ex
│ ├── follow.ex
│ ├── orgmember.ex
│ ├── repository.ex
│ ├── github.ex
│ ├── org.ex
│ └── user.ex
├── app.ex
└── app_web.ex
├── priv
├── static
│ ├── favicon.ico
│ ├── images
│ │ └── phoenix.png
│ └── robots.txt
└── repo
│ ├── migrations
│ ├── .formatter.exs
│ ├── 20250127180724_create_reqlogs.exs
│ ├── 20240608143836_create_stars.exs
│ ├── 20250203140127_create_contribs.exs
│ ├── 20250131111017_create_orgmembers.exs
│ ├── 20240608144843_create_follows.exs
│ ├── 20221005213326_create_repositories.exs
│ ├── 20240608112859_create_orgs.exs
│ └── 20221005213110_create_users.exs
│ └── seeds.exs
├── test
├── test_helper.exs
├── app_web
│ ├── views
│ │ ├── page_view_test.exs
│ │ ├── layout_view_test.exs
│ │ └── error_view_test.exs
│ └── live
│ │ └── app_live_test.exs
├── app
│ ├── api_manager_test.exs
│ ├── star_test.exs
│ ├── contrib_test.exs
│ ├── reqlog_test.exs
│ ├── orgmember_test.exs
│ ├── repository_test.exs
│ ├── follow_test.exs
│ ├── image_test.exs
│ ├── github_test.exs
│ ├── org_test.exs
│ └── user_test.exs
└── support
│ ├── conn_case.ex
│ └── data_case.ex
├── .formatter.exs
├── .github
├── dependabot.yml
└── workflows
│ └── ci.yml
├── people
└── jeremy
├── coveralls.json
├── .env_sample
├── assets
├── tailwind.config.js
├── js
│ └── app.js
├── css
│ ├── app.css
│ └── phoenix.css
└── vendor
│ └── topbar.js
├── .gitignore
├── config
├── test.exs
├── prod.exs
├── config.exs
├── runtime.exs
└── dev.exs
├── mix.exs
├── index.html
├── README.md
└── mix.lock
/lib/app_web/views/app_view.ex:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.AppView do
2 | use AppWeb, :view
3 | end
--------------------------------------------------------------------------------
/priv/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwyl/who/HEAD/priv/static/favicon.ico
--------------------------------------------------------------------------------
/test/test_helper.exs:
--------------------------------------------------------------------------------
1 | ExUnit.start()
2 | Ecto.Adapters.SQL.Sandbox.mode(App.Repo, :manual)
3 |
--------------------------------------------------------------------------------
/priv/repo/migrations/.formatter.exs:
--------------------------------------------------------------------------------
1 | [
2 | import_deps: [:ecto_sql],
3 | inputs: ["*.exs"]
4 | ]
5 |
--------------------------------------------------------------------------------
/priv/static/images/phoenix.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwyl/who/HEAD/priv/static/images/phoenix.png
--------------------------------------------------------------------------------
/lib/app_web/templates/layout/app.html.heex:
--------------------------------------------------------------------------------
1 |
2 | <%= @inner_content %>
3 |
4 |
--------------------------------------------------------------------------------
/lib/app_web/templates/layout/live.html.heex:
--------------------------------------------------------------------------------
1 |
2 | <%= @inner_content %>
3 |
4 |
--------------------------------------------------------------------------------
/test/app_web/views/page_view_test.exs:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.PageViewTest do
2 | use AppWeb.ConnCase, async: true
3 | end
4 |
--------------------------------------------------------------------------------
/lib/app/repo.ex:
--------------------------------------------------------------------------------
1 | defmodule App.Repo do
2 | use Ecto.Repo,
3 | otp_app: :app,
4 | adapter: Ecto.Adapters.Postgres
5 | end
6 |
--------------------------------------------------------------------------------
/.formatter.exs:
--------------------------------------------------------------------------------
1 | [
2 | import_deps: [:ecto, :phoenix],
3 | inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"],
4 | subdirectories: ["priv/*/migrations"]
5 | ]
6 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: mix
4 | directory: "/"
5 | schedule:
6 | interval: weekly
7 | time: "17:00"
8 | timezone: Europe/London
9 |
--------------------------------------------------------------------------------
/people/jeremy:
--------------------------------------------------------------------------------
1 | {
2 | fullname: 'Jeremy Lamit',
3 | avatar: 'https://avatars.githubusercontent.com/u/25215507?v=4',
4 | github: 'JeremyRms',
5 | linkedin: 'https://www.linkedin.com/in/ecommerce-technology-manager',
6 | }
7 |
--------------------------------------------------------------------------------
/priv/static/robots.txt:
--------------------------------------------------------------------------------
1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 | #
3 | # To ban all spiders from the entire site uncomment the next two lines:
4 | # User-agent: *
5 | # Disallow: /
6 |
--------------------------------------------------------------------------------
/lib/app.ex:
--------------------------------------------------------------------------------
1 | defmodule App do
2 | @moduledoc """
3 | App keeps the contexts that define your domain
4 | and business logic.
5 |
6 | Contexts are also responsible for managing your data, regardless
7 | if it comes from the database, an external API or others.
8 | """
9 | end
10 |
--------------------------------------------------------------------------------
/priv/repo/migrations/20250127180724_create_reqlogs.exs:
--------------------------------------------------------------------------------
1 | defmodule App.Repo.Migrations.CreateReqlogs do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:reqlogs) do
6 | add :req, :string
7 | add :param, :string
8 |
9 | timestamps()
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/test/app_web/views/layout_view_test.exs:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.LayoutViewTest do
2 | use AppWeb.ConnCase, async: true
3 |
4 | # When testing helpers, you may want to import Phoenix.HTML and
5 | # use functions such as safe_to_string() to convert the helper
6 | # result into an HTML string.
7 | # import Phoenix.HTML
8 | end
9 |
--------------------------------------------------------------------------------
/lib/app_web/views/layout_view.ex:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.LayoutView do
2 | use AppWeb, :view
3 | use Phoenix.Component
4 |
5 | # Phoenix LiveDashboard is available only in development by default,
6 | # so we instruct Elixir to not warn if the dashboard route is missing.
7 | @compile {:no_warn_undefined, {Routes, :live_dashboard_path, 2}}
8 | end
9 |
--------------------------------------------------------------------------------
/priv/repo/migrations/20240608143836_create_stars.exs:
--------------------------------------------------------------------------------
1 | defmodule App.Repo.Migrations.CreateStars do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:stars) do
6 | add :repo_id, :integer
7 | add :user_id, :integer
8 | add :stop, :utc_datetime, default: nil
9 |
10 | timestamps()
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/priv/repo/seeds.exs:
--------------------------------------------------------------------------------
1 | # Script for populating the database. You can run it as:
2 | #
3 | # mix run priv/repo/seeds.exs
4 | #
5 | # Inside the script, you can read and write to any of your
6 | # repositories directly:
7 | #
8 | # App.Repo.insert!(%App.SomeSchema{})
9 | #
10 | # We recommend using the bang functions (`insert!`, `update!`
11 | # and so on) as they will fail if something goes wrong.
12 |
--------------------------------------------------------------------------------
/coveralls.json:
--------------------------------------------------------------------------------
1 | {
2 | "skip_files": [
3 | "test/",
4 | "lib/app.ex",
5 | "lib/app/application.ex",
6 | "lib/app_web.ex",
7 | "lib/app/repo.ex",
8 | "lib/app/release.ex",
9 | "lib/app_web/views/app_view.ex",
10 | "lib/app_web/views/init_view.ex",
11 | "lib/app_web/views/layout_view.ex",
12 | "lib/app_web/views/error_helpers.ex",
13 | "lib/app_web/endpoint.ex",
14 | "lib/app_web/telemetry.ex"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/.env_sample:
--------------------------------------------------------------------------------
1 | export ENCRYPTION_KEYS='nMdayQpR0aoasLaq1g94FLba+A+wB44JLko47sVQXMg=,L+ZVX8iheoqgqb22mUpATmMDsvVGtafoAeb0KN5uWf0='
2 | export SECRET_KEY_BASE=2PzB7PPnpuLsbWmWtXpGyI+kfSQSQ1zUW2Atz/+8PdZuSEJzHgzGnJWV35nTKRwx
3 | export AUTH_API_KEY=YTsV7fG5mZ2KRWmvE3u431sZYsaZhhC8oqvQSDg85VnqMQXSDEBjh/YTsV7TBnHp1yxy2LLxBZYyVBrTYPtiKjLbApKiFkva3YQ8rrGgYeV/authdemo.fly.dev
4 |
5 | # https://github.com/settings/tokens/new
6 | export GH_PERSONAL_ACCESS_TOKEN=YourTokenHere
7 |
8 | export ORG_NAME=dwyl
--------------------------------------------------------------------------------
/test/app_web/views/error_view_test.exs:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.ErrorViewTest do
2 | use AppWeb.ConnCase, async: true
3 |
4 | # Bring render/3 and render_to_string/3 for testing custom views
5 | import Phoenix.View
6 |
7 | test "renders 404.html" do
8 | assert render_to_string(AppWeb.ErrorView, "404.html", []) == "Not Found"
9 | end
10 |
11 | test "renders 500.html" do
12 | assert render_to_string(AppWeb.ErrorView, "500.html", []) == "Internal Server Error"
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/priv/repo/migrations/20250203140127_create_contribs.exs:
--------------------------------------------------------------------------------
1 | defmodule App.Repo.Migrations.CreateContribs do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:contribs) do
6 | add :repo_id, :integer, primary_key: true
7 | add :user_id, :integer, primary_key: true
8 | add :count, :integer
9 |
10 | timestamps()
11 | end
12 |
13 | # https://stackoverflow.com/questions/36418223/unique-constraint-two-columns
14 | create unique_index(:contribs, [:repo_id, :user_id], name: :contribs_unique)
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/priv/repo/migrations/20250131111017_create_orgmembers.exs:
--------------------------------------------------------------------------------
1 | defmodule App.Repo.Migrations.CreateOrgmembers do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:orgmembers) do
6 | add :org_id, :integer, primary_key: true
7 | add :user_id, :integer, primary_key: true
8 | add :stop, :utc_datetime
9 |
10 | timestamps()
11 | end
12 |
13 | # https://stackoverflow.com/questions/36418223/unique-constraint-two-columns
14 | create unique_index(:orgmembers, [:org_id, :user_id], name: :orgmembers_unique)
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/lib/app_web/views/error_view.ex:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.ErrorView do
2 | use AppWeb, :view
3 |
4 | # If you want to customize a particular status code
5 | # for a certain format, you may uncomment below.
6 | # def render("500.html", _assigns) do
7 | # "Internal Server Error"
8 | # end
9 |
10 | # By default, Phoenix returns the status message from
11 | # the template name. For example, "404.html" becomes
12 | # "Not Found".
13 | def template_not_found(template, _assigns) do
14 | Phoenix.Controller.status_message_from_template(template)
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/priv/repo/migrations/20240608144843_create_follows.exs:
--------------------------------------------------------------------------------
1 | defmodule App.Repo.Migrations.CreateFollows do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:follows) do
6 | add :follower_id, :integer, primary_key: true
7 | add :following_id, :integer, primary_key: true
8 | add :stop, :utc_datetime
9 | add :is_org, :boolean, default: false
10 |
11 | timestamps()
12 | end
13 |
14 | # https://stackoverflow.com/questions/36418223/unique-constraint-two-columns
15 | create unique_index(:follows, [:follower_id, :following_id],
16 | name: :follows_unique)
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/lib/app_web/router.ex:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.Router do
2 | use AppWeb, :router
3 |
4 | pipeline :browser do
5 | plug :accepts, ["html"]
6 | plug :fetch_session
7 | plug :fetch_live_flash
8 | plug :put_root_layout, {AppWeb.LayoutView, :root}
9 | plug :protect_from_forgery
10 | plug :put_secure_browser_headers
11 | end
12 |
13 | # pipeline :api do
14 | # plug :accepts, ["json"]
15 | # end
16 |
17 | scope "/", AppWeb do
18 | pipe_through :browser
19 |
20 | live "/", AppLive
21 | end
22 |
23 | # Other scopes may use custom stacks.
24 | # scope "/api", AppWeb do
25 | # pipe_through :api
26 | # end
27 | end
28 |
--------------------------------------------------------------------------------
/test/app/api_manager_test.exs:
--------------------------------------------------------------------------------
1 | defmodule App.ApiManagerTest do
2 | use ExUnit.Case, async: true
3 | use App.DataCase
4 |
5 | test "App.ApiManager start_link/1 init/1 and handle_info/2" do
6 | assert App.ApiManager.start_link(nil)
7 | assert App.ApiManager.init(nil)
8 | assert App.ApiManager.handle_info(:work, nil)
9 | end
10 |
11 | test "App.ApiManager.get_users/0" do
12 | App.GitHub.user("charlie")
13 | |> Map.delete(:created_at)
14 | |> App.User.create_incomplete_user_no_overwrite()
15 |
16 | list = App.User.list_incomplete_users()
17 | assert length(list) > 0
18 |
19 | App.ApiManager.get_users()
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/test/app/star_test.exs:
--------------------------------------------------------------------------------
1 | defmodule App.StarTest do
2 | use App.DataCase
3 |
4 | test "App.Star.create/1" do
5 | star = %{
6 | repo_id: 42,
7 | user_id: 73
8 | }
9 | assert {:ok, inserted_star} = App.Star.create(star)
10 | assert inserted_star.repo_id == star.repo_id
11 | end
12 |
13 | test "App.Star.get_stargazers_for_repo/2 " do
14 | owner = "ideaq"
15 | App.Repository.get_org_repos(owner)
16 | repo = "image-uploads"
17 | list = App.Star.get_stargazers_for_repo("#{owner}/#{repo}")
18 | [star | _] = Enum.filter(list, fn(s) -> s.user_id == 194_400 end)
19 |
20 | assert star.user_id == 194_400
21 | assert star.repo_id == 35_713_694
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/priv/repo/migrations/20221005213326_create_repositories.exs:
--------------------------------------------------------------------------------
1 | defmodule App.Repo.Migrations.CreateRepositories do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:repositories) do
6 | add :created_at, :string
7 | add :description, :string
8 | add :fork, :boolean, default: false, null: false
9 | add :forks_count, :integer
10 | add :full_name, :string
11 | add :language, :string
12 | add :name, :string
13 | add :open_issues_count, :integer
14 | add :owner_id, :integer
15 | add :pushed_at, :string
16 | add :stargazers_count, :integer
17 | add :topics, :string
18 | add :watchers_count, :integer
19 |
20 | timestamps()
21 | end
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/test/app/contrib_test.exs:
--------------------------------------------------------------------------------
1 | defmodule App.ContribTest do
2 | use ExUnit.Case, async: true
3 | use App.DataCase
4 |
5 | test "App.Contrib.create/1" do
6 | contrib = %{
7 | repo_id: 42,
8 | user_id: 73,
9 | count: 420
10 | }
11 | assert {:ok, inserted_contrib} = App.Contrib.create(contrib)
12 | assert inserted_contrib.user_id == contrib.user_id
13 |
14 | # Upsert with new count:
15 | new_contrib = %{contrib | count: 765}
16 | assert {:ok, updated_contrib} = App.Contrib.create(new_contrib)
17 | assert updated_contrib.count == 765
18 | end
19 |
20 | test "get_contribs_from_api(fullname)" do
21 | assert length(App.Contrib.get_contribs_from_api("dwyl/start-here")) > 10
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/priv/repo/migrations/20240608112859_create_orgs.exs:
--------------------------------------------------------------------------------
1 | defmodule App.Repo.Migrations.CreateOrgs do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:orgs) do
6 | add :avatar_url, :string
7 | add :blog, :string
8 | add :company, :string
9 | add :created_at, :string
10 | add :description, :string
11 | add :followers, :integer
12 | add :hex, :string
13 | add :location, :string
14 | add :login, :string #, primary_key: true
15 | add :name, :string
16 | add :public_repos, :integer
17 | add :show, :boolean, default: false
18 |
19 | timestamps()
20 | end
21 |
22 | # drop_if_exists index(:orgs, [:login])
23 | # create unique_index(:orgs, :login, name: :org_login_unique)
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/priv/repo/migrations/20221005213110_create_users.exs:
--------------------------------------------------------------------------------
1 | defmodule App.Repo.Migrations.CreateUsers do
2 | use Ecto.Migration
3 |
4 | def change do
5 | create table(:users) do
6 | add :avatar_url, :string
7 | add :bio, :string
8 | add :blog, :string
9 | add :company, :string
10 | add :created_at, :string
11 | add :email, :string
12 | add :followers, :integer
13 | add :following, :integer
14 | add :hireable, :boolean, default: false
15 | add :hex, :string
16 | add :location, :string
17 | add :login, :string #, primary_key: true
18 | add :name, :string
19 | add :public_repos, :integer
20 | add :two_factor_authentication, :boolean, default: false
21 |
22 | timestamps()
23 | end
24 |
25 | # create unique_index(:users, :login, name: :login_unique)
26 | end
27 | end
28 |
--------------------------------------------------------------------------------
/assets/tailwind.config.js:
--------------------------------------------------------------------------------
1 | // See the Tailwind configuration guide for advanced usage
2 | // https://tailwindcss.com/docs/configuration
3 |
4 | let plugin = require('tailwindcss/plugin')
5 |
6 | module.exports = {
7 | content: [
8 | './js/**/*.js',
9 | '../lib/*_web.ex',
10 | '../lib/*_web/**/*.*ex'
11 | ],
12 | theme: {
13 | extend: {},
14 | },
15 | plugins: [
16 | require('@tailwindcss/forms'),
17 | plugin(({addVariant}) => addVariant('phx-no-feedback', ['&.phx-no-feedback', '.phx-no-feedback &'])),
18 | plugin(({addVariant}) => addVariant('phx-click-loading', ['&.phx-click-loading', '.phx-click-loading &'])),
19 | plugin(({addVariant}) => addVariant('phx-submit-loading', ['&.phx-submit-loading', '.phx-submit-loading &'])),
20 | plugin(({addVariant}) => addVariant('phx-change-loading', ['&.phx-change-loading', '.phx-change-loading &']))
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/test/app/reqlog_test.exs:
--------------------------------------------------------------------------------
1 | defmodule App.ReqlogTest do
2 | use App.DataCase
3 |
4 | test "App.Reqlog.create/1" do
5 | owner = "dwyl"
6 | reponame = "mvp"
7 | record = %{
8 | created_at: "2014-03-02T13:20:04Z",
9 | req: "repository",
10 | param: "#{owner}/#{reponame}"
11 | }
12 | assert {:ok, inserted} = App.Reqlog.create(record)
13 | assert inserted.req == record.req
14 | end
15 |
16 | test "App.Reqlog.log/2" do
17 | owner = "dwyl"
18 | reponame = "mvp"
19 |
20 | assert {:ok, inserted} = App.Reqlog.log("repo", "#{owner}/#{reponame}")
21 | assert inserted.req == "repo"
22 | assert inserted.param == "#{owner}/#{reponame}"
23 | end
24 |
25 | test "App.Reqlog.req_count_last_hour/0" do
26 | assert {:ok, _} = App.Reqlog.log("repo", "dwyl/any")
27 | count = App.Reqlog.req_count_last_hour()
28 | assert count > 0
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # The directory Mix will write compiled artifacts to.
2 | /_build/
3 |
4 | # If you run "mix test --cover", coverage assets end up here.
5 | /cover/
6 |
7 | # The directory Mix downloads your dependencies sources to.
8 | /deps/
9 |
10 | # Where 3rd-party dependencies like ExDoc output generated docs.
11 | /doc/
12 |
13 | # Ignore .fetch files in case you like to edit your project deps locally.
14 | /.fetch
15 |
16 | # If the VM crashes, it generates a dump, let's ignore it too.
17 | erl_crash.dump
18 |
19 | # Also ignore archive artifacts (built via "mix archive.build").
20 | *.ez
21 |
22 | # Ignore package tarball (built via "mix hex.build").
23 | app-*.tar
24 |
25 | # Ignore assets that are produced by build tools.
26 | /priv/static/assets/
27 |
28 | # Ignore digested assets cache.
29 | /priv/static/cache_manifest.json
30 |
31 | # In case you use Node.js/npm, you want to ignore these.
32 | npm-debug.log
33 | /assets/node_modules/
34 |
35 | .env
36 | .DS_Store
--------------------------------------------------------------------------------
/config/test.exs:
--------------------------------------------------------------------------------
1 | import Config
2 |
3 | # Configure your database
4 | #
5 | # The MIX_TEST_PARTITION environment variable can be used
6 | # to provide built-in test partitioning in CI environment.
7 | # Run `mix help test` for more information.
8 | config :app, App.Repo,
9 | username: "postgres",
10 | password: "postgres",
11 | hostname: "localhost",
12 | database: "app_test#{System.get_env("MIX_TEST_PARTITION")}",
13 | pool: Ecto.Adapters.SQL.Sandbox,
14 | pool_size: 10
15 |
16 | # We don't run a server during test. If one is required,
17 | # you can enable the server option below.
18 | config :app, AppWeb.Endpoint,
19 | http: [ip: {127, 0, 0, 1}, port: 4002],
20 | secret_key_base: "SFQh7t6tUogsoEGmARoiUJviKuWvpffJMjk/6hAmEA3pDKgqP+EnTnIAtzQdrtu9",
21 | server: false
22 |
23 | # Print only warnings and errors during test
24 | config :logger, level: :warning
25 |
26 | # Initialize plugs at runtime for faster test compilation
27 | config :phoenix, :plug_init_mode, :runtime
28 |
--------------------------------------------------------------------------------
/lib/app_web/views/error_helpers.ex:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.ErrorHelpers do
2 | @moduledoc """
3 | Conveniences for translating and building error messages.
4 | """
5 |
6 | # import Phoenix.HTML
7 | import Phoenix.HTML.Form
8 | use PhoenixHTMLHelpers
9 |
10 | @doc """
11 | Generates tag for inlined form input errors.
12 | """
13 | def error_tag(form, field) do
14 | Enum.map(Keyword.get_values(form.errors, field), fn error ->
15 | content_tag(:span, translate_error(error),
16 | class: "invalid-feedback",
17 | phx_feedback_for: input_name(form, field)
18 | )
19 | end)
20 | end
21 |
22 | @doc """
23 | Translates an error message.
24 | """
25 | def translate_error({msg, opts}) do
26 | # Because the error messages we show in our forms and APIs
27 | # are defined inside Ecto, we need to translate them dynamically.
28 | Enum.reduce(opts, msg, fn {key, value}, acc ->
29 | String.replace(acc, "%{#{key}}", fn _ -> to_string(value) end)
30 | end)
31 | end
32 | end
33 |
--------------------------------------------------------------------------------
/lib/app/application.ex:
--------------------------------------------------------------------------------
1 | defmodule App.Application do
2 | # See https://hexdocs.pm/elixir/Application.html
3 | # for more information on OTP Applications
4 | @moduledoc false
5 |
6 | use Application
7 |
8 | @impl true
9 | def start(_type, _args) do
10 | children = [
11 | # Start the Ecto repository
12 | App.Repo,
13 | # Start the Telemetry supervisor
14 | AppWeb.Telemetry,
15 | # Start the PubSub system
16 | {Phoenix.PubSub, name: App.PubSub},
17 | # Start the Endpoint (http/https)
18 | AppWeb.Endpoint,
19 | # Start a worker by calling: App.Worker.start_link(arg)
20 | # {App.Worker, arg}
21 | App.ApiManager
22 | ]
23 |
24 | # See https://hexdocs.pm/elixir/Supervisor.html
25 | # for other strategies and supported options
26 | opts = [strategy: :one_for_one, name: App.Supervisor]
27 | Supervisor.start_link(children, opts)
28 | end
29 |
30 | # Tell Phoenix to update the endpoint configuration
31 | # whenever the application is updated.
32 | @impl true
33 | def config_change(changed, _new, removed) do
34 | AppWeb.Endpoint.config_change(changed, removed)
35 | :ok
36 | end
37 | end
38 |
--------------------------------------------------------------------------------
/test/support/conn_case.ex:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.ConnCase do
2 | @moduledoc """
3 | This module defines the test case to be used by
4 | tests that require setting up a connection.
5 |
6 | Such tests rely on `Phoenix.ConnTest` and also
7 | import other functionality to make it easier
8 | to build common data structures and query the data layer.
9 |
10 | Finally, if the test case interacts with the database,
11 | we enable the SQL sandbox, so changes done to the database
12 | are reverted at the end of every test. If you are using
13 | PostgreSQL, you can even run database tests asynchronously
14 | by setting `use AppWeb.ConnCase, async: true`, although
15 | this option is not recommended for other databases.
16 | """
17 |
18 | use ExUnit.CaseTemplate
19 |
20 | using do
21 | quote do
22 | # Import conveniences for testing with connections
23 | import Plug.Conn
24 | import Phoenix.ConnTest
25 | import AppWeb.ConnCase
26 |
27 | alias AppWeb.Router.Helpers, as: Routes
28 |
29 | # The default endpoint for testing
30 | @endpoint AppWeb.Endpoint
31 | end
32 | end
33 |
34 | setup tags do
35 | App.DataCase.setup_sandbox(tags)
36 | {:ok, conn: Phoenix.ConnTest.build_conn()}
37 | end
38 | end
39 |
--------------------------------------------------------------------------------
/test/app/orgmember_test.exs:
--------------------------------------------------------------------------------
1 | defmodule App.OrgMemberTest do
2 | use App.DataCase
3 |
4 | test "App.Orgmember.create/1" do
5 | org_id = 11_708_465
6 | user_id = 4_185_328
7 | assert {:ok, orgmember} =
8 | App.Orgmember.create(%{org_id: org_id, user_id: user_id})
9 | assert orgmember.user_id == user_id
10 | assert orgmember.org_id == org_id
11 | end
12 |
13 | test "Chain Github.user_orgs/1 |> Orgmember.create" do
14 | username = "iteles"
15 | user = App.GitHub.user(username)
16 | orgs = App.GitHub.user_orgs(username)
17 | list = Enum.map(orgs, fn org ->
18 | {:ok, orgmemb} = App.Orgmember.create(%{org_id: org.id, user_id: user.id})
19 |
20 | orgmemb
21 | end)
22 | assert length(list) == length(orgs)
23 | end
24 |
25 | test "Orgmember.get_orgs_for_user/1" do
26 | user = %{id: 4_185_328, login: "iteles"}
27 | orgs = App.Orgmember.get_orgs_for_user(user)
28 | [org | _ ] = Enum.filter(orgs, fn org ->
29 | org.login == "dwyl"
30 | end)
31 |
32 | assert org.id == 11_708_465
33 | end
34 |
35 | test "Orgmember.get_users_for_org/1" do
36 | org = %{id: 6_831_072, login: "ideaq"}
37 | users = App.Orgmember.get_users_for_org(org)
38 | assert length(users) > 3
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/test/app_web/live/app_live_test.exs:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.AppLiveTest do
2 | use AppWeb.ConnCase
3 | import Phoenix.LiveViewTest
4 | alias AppWeb.AppLive
5 |
6 | test "GET /", %{conn: conn} do
7 | conn = get(conn, "/")
8 | assert html_response(conn, 200) =~ "sync"
9 | end
10 |
11 | test "default profile", %{conn: conn} do
12 | {:ok, _view, html} = live(conn, "/")
13 | assert html =~ "Alexander the Greatest"
14 | end
15 |
16 | test "trigger sync", %{conn: conn} do
17 | {:ok, view, _html} = live(conn, "/")
18 | assert render_hook(view, :sync, %{org: "ideaq"})
19 | =~ "Love learning how to code"
20 | end
21 |
22 | describe "template helper functions" do
23 | test "short_date/1 shortens the date received from GitHub" do
24 | assert AppLive.short_date("2010-02-02T08:44:49Z") == "2010-02-02"
25 | end
26 |
27 | test "truncate_bio/1 truncates the bio to 29 chars" do
28 | bio = "It was a bright cold day in April, and the clocks were striking 13"
29 | assert AppLive.truncate_bio(bio) == "It was a bright cold day in ..."
30 | end
31 |
32 | test "avatar/1 prepares the avatar_url for displaying face wall" do
33 | assert AppLive.avatar(1) ==
34 | "https://avatars.githubusercontent.com/u/1?s=30"
35 | end
36 | end
37 | end
38 |
--------------------------------------------------------------------------------
/test/app/repository_test.exs:
--------------------------------------------------------------------------------
1 | defmodule App.RepositoryTest do
2 | use App.DataCase
3 |
4 | test "App.Repository.create/1" do
5 | repo = %{
6 | created_at: "2014-03-02T13:20:04Z",
7 | description: "This your first repo!",
8 | fork: false,
9 | forks_count: 110,
10 | full_name: "dwyl/start-here",
11 | id: 17338019,
12 | owner_id: 123,
13 | owner_name: "dwyl",
14 | name: "start-here",
15 | open_issues_count: 98,
16 | pushed_at: "2022-08-10T07:41:05Z",
17 | stargazers_count: 1604,
18 | topics: ["beginner", "beginner-friendly", "how-to", "learn"],
19 | watchers_count: 1604
20 | }
21 | assert {:ok, inserted_repo} = App.Repository.create(repo)
22 | assert inserted_repo.name == repo.name
23 | end
24 |
25 | test "App.Repository.get_org_repos/1" do
26 | App.Repository.get_org_repos("ideaq") # |> dbg
27 | # assert inserted_repo.name == repo.name
28 | end
29 |
30 | test "App.Repository.get_repo_id_by_full_name/1" do
31 | # Get all repos for ideaQ org:
32 | list = App.Repository.get_org_repos("ideaq")
33 | full_name = "ideaq/image-uploads"
34 | repo = Enum.filter(list, fn(r) ->
35 | r.full_name == full_name
36 | end)
37 | |> List.first()
38 |
39 | assert repo.id == App.Repository.get_repo_id_by_full_name(full_name)
40 | end
41 |
42 | end
43 |
--------------------------------------------------------------------------------
/lib/app/contrib.ex:
--------------------------------------------------------------------------------
1 | defmodule App.Contrib do
2 | use Ecto.Schema
3 | import Ecto.Changeset
4 | alias App.{Repo}
5 | alias __MODULE__
6 |
7 | schema "contribs" do
8 | field :count, :integer
9 | field :repo_id, :integer, primary_key: true
10 | field :user_id, :integer, primary_key: true
11 |
12 | timestamps()
13 | end
14 |
15 | @doc false
16 | def changeset(contrib, attrs) do
17 | contrib
18 | |> cast(attrs, [:repo_id, :user_id, :count])
19 | |> unique_constraint(:contribs_unique_constraint, name: :contribs_unique)
20 | |> validate_required([:repo_id, :user_id, :count])
21 | end
22 |
23 | @doc """
24 | Creates a `contribs` record.
25 | """
26 | def create(attrs) do
27 | %Contrib{}
28 | |> changeset(attrs)
29 | |> Repo.insert(on_conflict: {:replace, [:count]},
30 | conflict_target: [:repo_id, :user_id])
31 | end
32 |
33 | def get_contribs_from_api(fullname) do
34 | [owner, reponame] = String.split(fullname, "/")
35 | repo_id = App.Repository.get_repo_id_by_full_name(fullname)
36 | App.GitHub.repo_contribs(owner, reponame) # |> dbg()
37 | |> Enum.map(fn user ->
38 | App.User.create_incomplete_user_no_overwrite(user)
39 | {:ok, contrib} = create(%{
40 | repo_id: repo_id,
41 | user_id: user.id,
42 | count: user.contributions
43 | })
44 |
45 | contrib
46 | end)
47 | end
48 |
49 | end
50 |
--------------------------------------------------------------------------------
/lib/app/star.ex:
--------------------------------------------------------------------------------
1 | defmodule App.Star do
2 | alias App.{Repo}
3 | use Ecto.Schema
4 | import Ecto.Changeset
5 | require Logger
6 | alias __MODULE__
7 |
8 | schema "stars" do
9 | field :stop, :utc_datetime
10 | field :repo_id, :integer
11 | field :user_id, :integer
12 |
13 | timestamps()
14 | end
15 |
16 | @doc false
17 | def changeset(stars, attrs) do
18 | stars
19 | |> cast(attrs, [:repo_id, :user_id, :stop])
20 | |> validate_required([:repo_id, :user_id])
21 | end
22 |
23 | @doc """
24 | Creates a `star` record.
25 | """
26 | def create(attrs) do
27 | %Star{}
28 | |> changeset(attrs)
29 | |> Repo.insert()
30 | end
31 |
32 | @doc """
33 | `get_stargazers_for_repo/2`
34 | gets the starts for a given `owner` and `repo` inserts any new `users`.
35 | """
36 | def get_stargazers_for_repo(fullname) do
37 | repo_id = App.Repository.get_repo_id_by_full_name(fullname)
38 | # dbg("#{fullname} -> #{repo_id}")
39 | App.GitHub.repo_stargazers(fullname)
40 | |> Enum.map(fn user ->
41 | # We have multiple repos over 1k stars
42 | # Therefore issuing all these requests at once
43 | # would instantly hit the 5k/h GitHub API Request Limit
44 | App.User.create_incomplete_user_no_overwrite(user)
45 |
46 | {:ok, star} = create(%{ user_id: user.id, repo_id: repo_id })
47 |
48 | star
49 | end)
50 | end
51 | end
52 |
--------------------------------------------------------------------------------
/test/app/follow_test.exs:
--------------------------------------------------------------------------------
1 | defmodule App.FollowTest do
2 | use App.DataCase
3 |
4 | test "App.Follow.create/1" do
5 | follow = %{
6 | follower_id: 42,
7 | following_id: 73
8 | }
9 | assert {:ok, inserted_follow} = App.Follow.create(follow)
10 | assert inserted_follow.follower_id == follow.follower_id
11 | end
12 |
13 | test "App.Follow.create/1 is_org:true" do
14 | follow = %{
15 | follower_id: 42,
16 | following_id: 73,
17 | is_org: true
18 | }
19 | assert {:ok, inserted_follow} = App.Follow.create(follow)
20 | assert inserted_follow.follower_id == follow.follower_id
21 | assert inserted_follow.is_org == true
22 | end
23 |
24 | test "App.Follow.get_followers_from_api/2" do
25 | # Get followers for User:
26 | user_followers = App.Follow.get_followers_from_api("amistc")
27 | assert length(user_followers) > 1
28 |
29 | # Get followers for Org
30 | org_followers = App.Follow.get_followers_from_api("ideaq", true)
31 | assert length(org_followers) > 0
32 | end
33 |
34 | test "App.Follow.get_following_id/2 happy path" do
35 | # Get an *existing* user:
36 | App.User.get_user_from_api(%{login: "charlie"})
37 | assert App.Follow.get_following_id("charlie") == 1_763
38 |
39 | # Get an *existing* org:
40 | App.Org.get_org_from_api(%{login: "github"})
41 | assert App.Follow.get_following_id("github", true) == 9_919
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/lib/app/image.ex:
--------------------------------------------------------------------------------
1 | defmodule App.Img do
2 | @moduledoc """
3 | Handles extracting color data from images.
4 | Uses: https://github.com/elixir-image/image
5 | """
6 | require Logger
7 | :inets.start()
8 | :ssl.start()
9 | @hex "0123456789ABCDEF"
10 |
11 | @doc """
12 | Retrieve raw image data from a URL.
13 | https://stackoverflow.com/questions/30267943/elixir-download-image-from-url
14 | """
15 | def get_raw_image_data(imgurl) do
16 | {:ok, resp} = :httpc.request(:get, {imgurl, []}, [], [body_format: :binary])
17 | {{_, 200, ~c"OK"}, _headers, body} = resp
18 |
19 | body
20 | end
21 |
22 | @doc """
23 | Returns the predominant color for an image.
24 | https://hexdocs.pm/image/Image.html#dominant_color/2
25 | """
26 | def extract_color(img_data) do
27 | {:ok, [r, g, b]} =
28 | Image.open!(img_data)
29 | |> Image.dominant_color()
30 |
31 | rgb_to_hex(r, g, b)
32 | end
33 |
34 | def get_avatar_color(avatar_url) do
35 | get_raw_image_data(avatar_url) |> extract_color()
36 | end
37 |
38 | # functions borrowed from:
39 | # https://github.com/nelsonic/colors/blob/master/colors.html#L96
40 | def rgb_to_hex(r, g, b) do
41 | "#{to_hex(r)}#{to_hex(g)}#{to_hex(b)}"
42 | end
43 |
44 | # No error/bounds checking as values come from `Image.dominant_color/1`
45 | def to_hex(n) do
46 | mod = Integer.mod(n, 16)
47 | rounded = trunc(Float.ceil((n - mod) / 16))
48 | "#{String.at(@hex, rounded)}#{String.at(@hex, mod)}"
49 | end
50 | end
51 |
--------------------------------------------------------------------------------
/lib/app_web/endpoint.ex:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.Endpoint do
2 | use Phoenix.Endpoint, otp_app: :app
3 |
4 | # The session will be stored in the cookie and signed,
5 | # this means its contents can be read but not tampered with.
6 | # Set :encryption_salt if you would also like to encrypt it.
7 | @session_options [
8 | store: :cookie,
9 | key: "_app_key",
10 | signing_salt: "P8W6pys9"
11 | ]
12 |
13 | socket "/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]]
14 |
15 | # Serve at "/" the static files from "priv/static" directory.
16 | #
17 | # You should set gzip to true if you are running phx.digest
18 | # when deploying your static files in production.
19 | plug Plug.Static,
20 | at: "/",
21 | from: :app,
22 | gzip: false,
23 | only: ~w(assets fonts images favicon.ico robots.txt)
24 |
25 | # Code reloading can be explicitly enabled under the
26 | # :code_reloader configuration of your endpoint.
27 | if code_reloading? do
28 | socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
29 | plug Phoenix.LiveReloader
30 | plug Phoenix.CodeReloader
31 | plug Phoenix.Ecto.CheckRepoStatus, otp_app: :app
32 | end
33 |
34 | plug Plug.RequestId
35 | plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint]
36 |
37 | plug Plug.Parsers,
38 | parsers: [:urlencoded, :multipart, :json],
39 | pass: ["*/*"],
40 | json_decoder: Phoenix.json_library()
41 |
42 | plug Plug.MethodOverride
43 | plug Plug.Head
44 | plug Plug.Session, @session_options
45 | plug AppWeb.Router
46 | end
47 |
--------------------------------------------------------------------------------
/lib/app/reqlog.ex:
--------------------------------------------------------------------------------
1 | defmodule App.Reqlog do
2 | use Ecto.Schema
3 | import Ecto.{Changeset, Query}
4 | alias App.{Repo}
5 | alias __MODULE__
6 | require Logger
7 |
8 | schema "reqlogs" do
9 | field :req, :string
10 | field :param, :string
11 |
12 | timestamps()
13 | end
14 |
15 | @doc false
16 | def changeset(reqlog, attrs) do
17 | reqlog
18 | |> cast(attrs, [:req, :param])
19 | |> validate_required([:req, :param])
20 | end
21 |
22 | @doc """
23 | Creates a `reqlog` (request log) record.
24 | """
25 | def create(attrs) do
26 | %Reqlog{}
27 | |> changeset(attrs)
28 | |> Repo.insert()
29 | end
30 |
31 | # clean interface function that can be called from App.GitHub functions
32 | # e.g: log("repository", "#{owner}/#{repo}")
33 | def log(req, param) do
34 | Logger.info "Fetching #{req} #{param}"
35 | create(%{req: req, param: param})
36 | end
37 |
38 | @doc """
39 | `req_count_last_hour/0` returns the count (integer) of how many API Requests
40 | were made in the last hour to help us stay under the `5k/h` limit.
41 | Sample SQL if you need to test this independently:
42 | SELECT COUNT(*) FROM reqlogs WHERE inserted_at > '2025-01-27 11:02:50'
43 | """
44 | def req_count_last_hour() do
45 | # Using `DateTime.add/4` with a negative number to subtract. ;-)
46 | # via: https://elixirforum.com/t/create-time-with-one-hour-plus/3666/5
47 | one_hour_ago = DateTime.utc_now(:second) |> DateTime.add(-3600)
48 | Repo.one(from r in Reqlog, select: count("*"),
49 | where: r.inserted_at > ^one_hour_ago)
50 | end
51 | end
52 |
--------------------------------------------------------------------------------
/test/app/image_test.exs:
--------------------------------------------------------------------------------
1 | defmodule App.ImgTest do
2 | use ExUnit.Case
3 | alias App.Img
4 |
5 | test "App.Img.get_raw_image_data/1" do
6 | url = "https://avatars.githubusercontent.com/u/4185328"
7 | img_data = Img.get_raw_image_data(url) # |> dbg
8 | assert is_binary(img_data)
9 | end
10 |
11 | test "App.Img.extract_color/1 retrieves color" do
12 | url = "https://avatars.githubusercontent.com/u/4185328"
13 | img_data = Img.get_raw_image_data(url)
14 | assert Img.extract_color(img_data) == "F8F8F8"
15 |
16 | url2 = "https://avatars.githubusercontent.com/u/194400"
17 | img_data2 = Img.get_raw_image_data(url2)
18 | assert Img.extract_color(img_data2) == "F80818"
19 |
20 | url3 = "https://avatars.githubusercontent.com/u/19310512"
21 | img_data3 = Img.get_raw_image_data(url3)
22 | assert Img.extract_color(img_data3) == "080808"
23 | end
24 |
25 | test "App.Img.get_avatar_color/1 gets the hex color for avatar" do
26 | avatar_url = "https://avatars.githubusercontent.com/u/4185328"
27 | assert Img.get_avatar_color(avatar_url) == "F8F8F8"
28 |
29 | avatar_url2 = "https://avatars.githubusercontent.com/u/7805691"
30 | assert Img.get_avatar_color(avatar_url2) == "C85878"
31 | # https://github.com/harrygfox
32 | # https://www.color-hex.com/color/c85878
33 | end
34 |
35 | test "to_hex/1 returns the hex value of an integer" do
36 | assert Img.to_hex(42) == "2A"
37 | end
38 |
39 | test "rgb_to_hex/1 returns the hex of an RGB color" do
40 | # https://www.colorhexa.com/2bf0cf
41 | assert Img.rgb_to_hex(43, 240, 207) == "2BF0CF"
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/lib/app/api_manager.ex:
--------------------------------------------------------------------------------
1 | defmodule App.ApiManager do
2 | @moduledoc """
3 | This function manages requests to the `GitHub` API
4 | To avoid hitting their `5k/h` limit and being blocked.
5 | It checks the request log each minute for the number of API requests made
6 | in the last hour. If requests < 4920, then back-fill the incomplete users.
7 | Inspired by José Valim's: https://stackoverflow.com/a/32097971/1148249
8 | """
9 | use GenServer
10 |
11 | def start_link(_opts) do
12 | GenServer.start_link(__MODULE__, %{})
13 | end
14 |
15 | def init(state) do
16 | schedule_work() # Schedule work to be performed at some point
17 | {:ok, state}
18 | end
19 |
20 | def handle_info(:work, state) do
21 | get_users() # get the incomplete users from the API
22 | schedule_work() # Reschedule once more
23 | {:noreply, state}
24 | end
25 |
26 | defp schedule_work() do
27 | Process.send_after(self(), :work, 60 * 1000) # check again in 1 minute
28 | end
29 |
30 | def get_users() do
31 | # Check how many requests have been made in the last hour:
32 | count = App.Reqlog.req_count_last_hour()
33 | # Q: Why 4920...?
34 | # A: API limit is 5,000 requests per hour
35 | # 5000 / 60 min = 83.33 (requests per minute)
36 | # 5000 - 83 = 4917 ... so rounded to 4920.
37 | if count < 4920 do
38 | # Get the top 80 users that need to be queried:
39 | App.User.list_incomplete_users() # |> dbg()
40 | |> Enum.each(fn user ->
41 | # Get and insert the full user data:
42 | App.User.get_user_from_api(user)
43 | App.Orgmember.get_orgs_for_user(user)
44 | App.Follow.get_followers_from_api(user.login)
45 | end)
46 | # Backfill 5 orgs with full data:
47 | App.Org.backfill()
48 | end
49 | end
50 | end
51 |
--------------------------------------------------------------------------------
/test/support/data_case.ex:
--------------------------------------------------------------------------------
1 | defmodule App.DataCase do
2 | @moduledoc """
3 | This module defines the setup for tests requiring
4 | access to the application's data layer.
5 |
6 | You may define functions here to be used as helpers in
7 | your tests.
8 |
9 | Finally, if the test case interacts with the database,
10 | we enable the SQL sandbox, so changes done to the database
11 | are reverted at the end of every test. If you are using
12 | PostgreSQL, you can even run database tests asynchronously
13 | by setting `use App.DataCase, async: true`, although
14 | this option is not recommended for other databases.
15 | """
16 |
17 | use ExUnit.CaseTemplate
18 |
19 | using do
20 | quote do
21 | alias App.Repo
22 |
23 | import Ecto
24 | import Ecto.Changeset
25 | import Ecto.Query
26 | import App.DataCase
27 | end
28 | end
29 |
30 | setup tags do
31 | App.DataCase.setup_sandbox(tags)
32 | :ok
33 | end
34 |
35 | @doc """
36 | Sets up the sandbox based on the test tags.
37 | """
38 | def setup_sandbox(tags) do
39 | pid = Ecto.Adapters.SQL.Sandbox.start_owner!(App.Repo, shared: not tags[:async])
40 | on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
41 | end
42 |
43 | @doc """
44 | A helper that transforms changeset errors into a map of messages.
45 |
46 | assert {:error, changeset} = Accounts.create_user(%{password: "short"})
47 | assert "password is too short" in errors_on(changeset).password
48 | assert %{password: ["password is too short"]} = errors_on(changeset)
49 |
50 | """
51 | def errors_on(changeset) do
52 | Ecto.Changeset.traverse_errors(changeset, fn {message, opts} ->
53 | Regex.replace(~r"%{(\w+)}", message, fn _, key ->
54 | opts |> Keyword.get(String.to_existing_atom(key), key) |> to_string()
55 | end)
56 | end)
57 | end
58 | end
59 |
--------------------------------------------------------------------------------
/assets/js/app.js:
--------------------------------------------------------------------------------
1 | // We import the CSS which is extracted to its own file by esbuild.
2 | // Remove this line if you add a your own CSS build pipeline (e.g postcss).
3 |
4 | // If you want to use Phoenix channels, run `mix help phx.gen.channel`
5 | // to get started and then uncomment the line below.
6 | // import "./user_socket.js"
7 |
8 | // You can include dependencies in two ways.
9 | //
10 | // The simplest option is to put them in assets/vendor and
11 | // import them using relative paths:
12 | //
13 | // import "../vendor/some-package.js"
14 | //
15 | // Alternatively, you can `npm install some-package --prefix assets` and import
16 | // them using a path starting with the package name:
17 | //
18 | // import "some-package"
19 | //
20 |
21 | // Include phoenix_html to handle method=PUT/DELETE in forms and buttons.
22 | import "phoenix_html"
23 | // Establish Phoenix Socket and LiveView configuration.
24 | import {Socket} from "phoenix"
25 | import {LiveSocket} from "phoenix_live_view"
26 | import topbar from "../vendor/topbar"
27 |
28 | let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
29 | let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}})
30 |
31 | // Show progress bar on live navigation and form submits
32 | topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"})
33 | window.addEventListener("phx:page-loading-start", info => topbar.show())
34 | window.addEventListener("phx:page-loading-stop", info => topbar.hide())
35 |
36 | // connect if there are any LiveViews on the page
37 | liveSocket.connect()
38 |
39 | // expose liveSocket on window for web console debug logs and latency simulation:
40 | // >> liveSocket.enableDebug()
41 | // >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session
42 | // >> liveSocket.disableLatencySim()
43 | window.liveSocket = liveSocket
44 |
45 |
--------------------------------------------------------------------------------
/config/prod.exs:
--------------------------------------------------------------------------------
1 | import Config
2 |
3 | # For production, don't forget to configure the url host
4 | # to something meaningful, Phoenix uses this information
5 | # when generating URLs.
6 | #
7 | # Note we also include the path to a cache manifest
8 | # containing the digested version of static files. This
9 | # manifest is generated by the `mix phx.digest` task,
10 | # which you should run after static files are built and
11 | # before starting your production server.
12 | config :app, AppWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"
13 |
14 | # Do not print debug messages in production
15 | config :logger, level: :info
16 |
17 | # ## SSL Support
18 | #
19 | # To get SSL working, you will need to add the `https` key
20 | # to the previous section and set your `:url` port to 443:
21 | #
22 | # config :app, AppWeb.Endpoint,
23 | # ...,
24 | # url: [host: "example.com", port: 443],
25 | # https: [
26 | # ...,
27 | # port: 443,
28 | # cipher_suite: :strong,
29 | # keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"),
30 | # certfile: System.get_env("SOME_APP_SSL_CERT_PATH")
31 | # ]
32 | #
33 | # The `cipher_suite` is set to `:strong` to support only the
34 | # latest and more secure SSL ciphers. This means old browsers
35 | # and clients may not be supported. You can set it to
36 | # `:compatible` for wider support.
37 | #
38 | # `:keyfile` and `:certfile` expect an absolute path to the key
39 | # and cert in disk or a relative path inside priv, for example
40 | # "priv/ssl/server.key". For all supported SSL configuration
41 | # options, see https://hexdocs.pm/plug/Plug.SSL.html#configure/1
42 | #
43 | # We also recommend setting `force_ssl` in your endpoint, ensuring
44 | # no data is ever sent via http, always redirecting to https:
45 | #
46 | # config :app, AppWeb.Endpoint,
47 | # force_ssl: [hsts: true]
48 | #
49 | # Check `Plug.SSL` for all available options in `force_ssl`.
50 |
--------------------------------------------------------------------------------
/lib/app/follow.ex:
--------------------------------------------------------------------------------
1 | defmodule App.Follow do
2 | alias App.{Repo}
3 | use Ecto.Schema
4 | import Ecto.Changeset
5 | require Logger
6 | alias __MODULE__
7 |
8 | schema "follows" do
9 | field :follower_id, :integer, primary_key: true
10 | field :following_id, :integer, primary_key: true
11 | field :is_org, :boolean, default: false
12 | field :stop, :utc_datetime
13 |
14 | timestamps()
15 | end
16 |
17 | @doc false
18 | def changeset(follow, attrs) do
19 | follow
20 | |> cast(attrs, [:follower_id, :following_id, :is_org, :stop])
21 | |> unique_constraint(:follows_unique_constraint, name: :follows_unique)
22 | |> validate_required([:follower_id, :following_id])
23 | end
24 |
25 | @doc """
26 | Creates a `follow` record.
27 | """
28 | def create(attrs) do
29 | %Follow{}
30 | |> changeset(attrs)
31 | |> Repo.insert(on_conflict: :nothing,
32 | conflict_target: [:follower_id, :following_id])
33 | end
34 |
35 | def get_followers_from_api(login, is_org \\ false) do
36 | # dbg("Login: #{login}, is_org: #{is_org}")
37 | following_id = get_following_id(login, is_org)
38 | App.GitHub.followers(login) # |> dbg()
39 | |> Enum.map(fn user ->
40 | # dbg(user)
41 | u = App.User.create_incomplete_user_no_overwrite(user)
42 |
43 | {:ok, _follow} = create(%{
44 | following_id: following_id,
45 | follower_id: u.id,
46 | is_org: is_org
47 | })
48 |
49 | u
50 | end)
51 | end
52 |
53 | def get_following_id(login, is_org \\ false) do
54 | if is_org do
55 | org = App.Org.get_org_by_login(login)
56 | org = if is_nil(org) do
57 | App.Org.get_org_from_api(%{login: login})
58 | else
59 | org
60 | end
61 |
62 | org.id
63 | else
64 | user = App.User.get_user_by_login(login)
65 | user = if is_nil(user) do
66 | App.User.get_user_from_api(%{login: login})
67 | else
68 | user
69 | end
70 |
71 | user.id
72 | end
73 | end
74 | end
75 |
--------------------------------------------------------------------------------
/lib/app/orgmember.ex:
--------------------------------------------------------------------------------
1 | defmodule App.Orgmember do
2 | use Ecto.Schema
3 | import Ecto.Changeset
4 | alias App.{Repo}
5 | alias __MODULE__
6 |
7 | schema "orgmembers" do
8 | field :stop, :utc_datetime
9 | field :org_id, :integer, primary_key: true
10 | field :user_id, :integer, primary_key: true
11 |
12 | timestamps()
13 | end
14 |
15 | @doc false
16 | def changeset(orgmember, attrs) do
17 | orgmember
18 | |> cast(attrs, [:org_id, :user_id, :stop])
19 | |> unique_constraint(:orgmembers_unique_constraint, name: :orgmembers_unique)
20 | |> validate_required([:org_id, :user_id])
21 | end
22 |
23 | @doc """
24 | Creates a `orgmember` record.
25 | """
26 | def create(attrs) do
27 | %Orgmember{}
28 | |> changeset(attrs)
29 | |> Repo.insert(on_conflict: :nothing, conflict_target: [:org_id, :user_id])
30 | end
31 |
32 | @doc """
33 | `get_orgs_for_user` gets the list of the orgs for a given user.
34 | expects the `%User` struct to have `id` and `login` fields.
35 | e.g: `%{id: 123, login: "al3x"}`
36 | """
37 | def get_orgs_for_user(user) do
38 | # Get the list of orgs a user belongs to (public)
39 | App.GitHub.user_orgs(user.login) # |> dbg()
40 | |> Enum.map(fn org ->
41 | {:ok, inserted_org} = App.Org.create(org)
42 | create(%{org_id: org.id, user_id: user.id})
43 |
44 | inserted_org
45 | end)
46 | end
47 |
48 | @doc """
49 | `get_users_for_org` gets list of `users` who are `public` members of an org
50 | """
51 | def get_users_for_org(org) do
52 | # Get the list of orgs a user belongs to (public)
53 | data = App.GitHub.org_user_list(org.login)
54 | if is_map(data) && Map.has_key?(data, :status) && data.status == 404 do
55 |
56 | []
57 | else
58 | data
59 | |> Enum.map(fn user ->
60 | App.User.create_incomplete_user_no_overwrite(user)
61 | # insert the orgmember record:
62 | create(%{org_id: org.id, user_id: user.id})
63 |
64 | user
65 | end)
66 | end
67 | end
68 | end
69 |
--------------------------------------------------------------------------------
/config/config.exs:
--------------------------------------------------------------------------------
1 | # This file is responsible for configuring your application
2 | # and its dependencies with the aid of the Config module.
3 | #
4 | # This configuration file is loaded before any dependency and
5 | # is restricted to this project.
6 |
7 | # General application configuration
8 | import Config
9 |
10 | config :app,
11 | ecto_repos: [App.Repo]
12 |
13 | # Configures the endpoint
14 | config :app, AppWeb.Endpoint,
15 | url: [host: "localhost"],
16 | render_errors: [view: AppWeb.ErrorView, accepts: ~w(html json), layout: false],
17 | pubsub_server: App.PubSub,
18 | live_view: [signing_salt: "sVXfP0tB"]
19 |
20 | # Configure esbuild (the version is required)
21 | config :esbuild,
22 | version: "0.14.29",
23 | default: [
24 | args:
25 | ~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
26 | cd: Path.expand("../assets", __DIR__),
27 | env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
28 | ]
29 |
30 | # Configures Elixir's Logger
31 | config :logger, :console,
32 | format: "$time $metadata[$level] $message\n",
33 | metadata: [:request_id]
34 |
35 | # Use Jason for JSON parsing in Phoenix
36 | config :phoenix, :json_library, Jason
37 |
38 | # https://github.com/dwyl/learn-tailwind#part-2-tailwind-in-phoenix
39 | config :tailwind,
40 | version: "3.1.0",
41 | default: [
42 | args: ~w(
43 | --config=tailwind.config.js
44 | --input=css/app.css
45 | --output=../priv/static/assets/app.css
46 | ),
47 | cd: Path.expand("../assets", __DIR__)
48 | ]
49 |
50 | # https://hexdocs.pm/joken/introduction.html#usage
51 | config :joken, default_signer: System.get_env("SECRET_KEY_BASE")
52 |
53 | # # https://github.com/dwyl/auth_plug
54 | # config :auth_plug,
55 | # api_key: System.get_env("AUTH_API_KEY")
56 |
57 | config :tentacat,
58 | access_token: System.get_env("GH_PERSONAL_ACCESS_TOKEN"),
59 | deserialization_options: [keys: :atoms]
60 |
61 | # Import environment specific config. This must remain at the bottom
62 | # of this file so it overrides the configuration defined above.
63 | import_config "#{config_env()}.exs"
64 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: Elixir CI
2 |
3 | on:
4 | push:
5 | branches: [ main ]
6 | pull_request:
7 | branches: [ main ]
8 |
9 | jobs:
10 | build:
11 | name: Build and test
12 | runs-on: ubuntu-latest
13 | services:
14 | postgres:
15 | image: postgres:12
16 | ports: ['5432:5432']
17 | env:
18 | POSTGRES_PASSWORD: postgres
19 | options: >-
20 | --health-cmd pg_isready
21 | --health-interval 10s
22 | --health-timeout 5s
23 | --health-retries 5
24 | steps:
25 | - uses: actions/checkout@v2
26 | - name: Set up Elixir
27 | uses: erlef/setup-beam@v1 # https://github.com/erlef/setup-beam
28 | with:
29 | elixir-version: '1.18.2' # Define the elixir version [required]
30 | otp-version: '27.2' # Define the OTP version [required]
31 | # https://github.com/actions/cache
32 | - name: Restore dependencies cache
33 | uses: actions/cache@v4
34 | with:
35 | path: deps
36 | key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
37 | restore-keys: ${{ runner.os }}-mix-
38 | - name: Install dependencies
39 | run: mix deps.get
40 | - name: Run Tests
41 | run: mix coveralls.json
42 | env:
43 | MIX_ENV: test
44 | AUTH_API_KEY: ${{ secrets.AUTH_API_KEY }}
45 | ENCRYPTION_KEYS: ${{ secrets.ENCRYPTION_KEYS }}
46 | GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
47 | - name: Upload coverage to Codecov
48 | uses: codecov/codecov-action@v3
49 |
50 | # # Continuous Deployment to Fly.io
51 | # # https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
52 | # deploy:
53 | # name: Deploy app
54 | # runs-on: ubuntu-latest
55 | # needs: build
56 | # # https://stackoverflow.com/questions/58139406/only-run-job-on-specific-branch-with-github-actions
57 | # if: github.ref == 'refs/heads/main'
58 | # env:
59 | # FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
60 | # steps:
61 | # - uses: actions/checkout@v2
62 | # - uses: superfly/flyctl-actions@1.1
63 | # with:
64 | # args: "deploy"
65 |
--------------------------------------------------------------------------------
/lib/app_web/templates/layout/icons.html.heex:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
61 |
67 |
73 |
79 |
80 |
81 |
85 |
--------------------------------------------------------------------------------
/test/app/github_test.exs:
--------------------------------------------------------------------------------
1 | defmodule App.GitHubTest do
2 | use ExUnit.Case
3 | use App.DataCase
4 | alias App.GitHub
5 |
6 | test "App.GitHub.followers/1" do
7 | username = "iteles"
8 | list = GitHub.followers(username)
9 | assert length(list) > 400
10 |
11 | # confirm works for an organization:
12 | org = "dwyl"
13 | org_followers = GitHub.followers(org)
14 | assert length(org_followers) > 650
15 | end
16 |
17 | test "App.GitHub.repository/1" do
18 | owner = "dwyl"
19 | reponame = "start-here"
20 | repo = GitHub.repository(owner, reponame) # |> dbg
21 | assert repo.stargazers_count > 1700
22 | end
23 |
24 | test "App.GitHub.repo_contribs/2 returns list of contribs (users)" do
25 | owner = "dwyl"
26 | reponame = "start-here"
27 | contribs = GitHub.repo_contribs(owner, reponame)
28 | assert length(contribs) > 10
29 | end
30 |
31 | test "App.GitHub.user/1" do
32 | username = "iteles"
33 | user = GitHub.user(username) # |> dbg
34 | assert user.public_repos > 30
35 | end
36 |
37 | test "App.GitHub.user_orgs/1" do
38 | username = "iteles"
39 | list = GitHub.user_orgs(username) # |> dbg
40 | assert length(list) > 2
41 |
42 | [org | _] = Enum.filter(list, fn org -> org.login == "dwyl" end)
43 | assert org.id == 11_708_465
44 | end
45 |
46 | test "App.GitHub.org_user_list/1" do
47 | orgname = "ideaq"
48 | list = GitHub.org_user_list(orgname)
49 | dbg(list)
50 | assert length(list) > 2
51 | end
52 |
53 | test "App.GitHub.org_user_list/1 UNHAPPY PATH issue #244" do
54 | orgname = "2024-hgu-ccd-one-in-christ"
55 | list = GitHub.org_user_list(orgname)
56 | dbg(list)
57 | end
58 |
59 | test "App.GitHub.user/1 known 404 (unhappy path)" do
60 | username = "kittenking"
61 | data = App.GitHub.user(username)
62 | assert data.status == "404"
63 | end
64 |
65 | test "App.GitHub.org/1 get org data" do
66 | org = App.GitHub.org("ideaq")
67 | assert org.id == 6_831_072
68 | end
69 |
70 | test "App.GitHub.org_repos/1 get repos for org" do
71 | org = "ideaq"
72 | list = App.GitHub.org_repos(org) # |> dbg
73 | assert length(list) > 2
74 | end
75 |
76 | test "App.GitHub.repo_stargazers/2 get stargazers for repo" do
77 | owner = "dwyl"
78 | repo = "pizza"
79 | list = App.GitHub.repo_stargazers("#{owner}/#{repo}") # |> dbg
80 | assert length(list) > 0
81 | end
82 | end
83 |
--------------------------------------------------------------------------------
/test/app/org_test.exs:
--------------------------------------------------------------------------------
1 | defmodule App.OrgTest do
2 | use App.DataCase
3 |
4 |
5 | test "App.Org.create/1" do
6 | org = %{
7 | id: 123,
8 | avatar_url: "https://avatars.githubusercontent.com/u/4185328?v=4",
9 | blog: "https://blog.dwyl.com",
10 | company: "@dwyl",
11 | created_at: "2013-04-17T21:10:06Z",
12 | description: "the dwyl org",
13 | followers: 378,
14 | location: "London, UK",
15 | login: "dwyl",
16 | name: "dwyl",
17 | public_repos: 31
18 | }
19 | assert {:ok, inserted_org} = App.Org.create(org)
20 | assert inserted_org.name == org.name
21 | end
22 |
23 | test "get_org_from_api/1 retrieves and inserts the org into DB" do
24 | org = App.Org.get_org_from_api(%{login: "dwyl"})
25 | assert org.id == 11_708_465
26 | assert org.followers > 650 # https://github.com/orgs/dwyl/followers
27 | assert org.hex == "48B8A8" # https://www.colorhexa.com/48b8a8
28 | end
29 |
30 | test "get_org_from_api/1 -> 404 (unhappy path)" do
31 | data = %{login: "superlongnamepleasedontregister"}
32 | org = App.Org.get_org_from_api(data)
33 | assert org.login == data.login
34 | end
35 |
36 | test "App.Org.list_incomplete_orgs" do
37 | {:ok, org} = App.Org.create(%{
38 | id: 123,
39 | avatar_url: "https://avatars.githubusercontent.com/u/4185328?v=4",
40 | login: "dwyl"
41 | })
42 | list = App.Org.list_incomplete_orgs()
43 | assert length(list) > 0
44 | o = Enum.filter(list, fn o -> o.login == org.login end) |> List.first
45 | assert o.login == org.login
46 | end
47 |
48 | test "App.Org.backfill" do
49 | {:ok, org} = App.Org.create(%{
50 | id: 6_831_072,
51 | avatar_url: "https://avatars.githubusercontent.com/u/6831072",
52 | login: "ideaq"
53 | })
54 | App.Org.backfill()
55 | updated_org = App.Org.get_org_by_login(org.login)
56 | assert updated_org.hex == "F8F8F8"
57 | assert updated_org.description == "a Q of Ideas"
58 | assert updated_org.created_at == "2014-03-02T13:18:11Z"
59 | end
60 |
61 | test "App.Org.update_org_created/1 updates the created_at date to now" do
62 | {:ok, org} = App.Org.create(%{
63 | id: 6_831_072,
64 | avatar_url: "https://avatars.githubusercontent.com/u/6831072",
65 | login: "myawesomeorg"
66 | })
67 | assert org.created_at == nil
68 | now = App.Org.now()
69 | updated_org = App.Org.update_org_created(org)
70 | assert updated_org.created_at == now
71 | end
72 | end
73 |
--------------------------------------------------------------------------------
/lib/app_web/telemetry.ex:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.Telemetry do
2 | use Supervisor
3 | import Telemetry.Metrics
4 |
5 | def start_link(arg) do
6 | Supervisor.start_link(__MODULE__, arg, name: __MODULE__)
7 | end
8 |
9 | @impl true
10 | def init(_arg) do
11 | children = [
12 | # Telemetry poller will execute the given period measurements
13 | # every 10_000ms. Learn more here: https://hexdocs.pm/telemetry_metrics
14 | {:telemetry_poller, measurements: periodic_measurements(), period: 10_000}
15 | # Add reporters as children of your supervision tree.
16 | # {Telemetry.Metrics.ConsoleReporter, metrics: metrics()}
17 | ]
18 |
19 | Supervisor.init(children, strategy: :one_for_one)
20 | end
21 |
22 | def metrics do
23 | [
24 | # Phoenix Metrics
25 | summary("phoenix.endpoint.stop.duration",
26 | unit: {:native, :millisecond}
27 | ),
28 | summary("phoenix.router_dispatch.stop.duration",
29 | tags: [:route],
30 | unit: {:native, :millisecond}
31 | ),
32 |
33 | # Database Metrics
34 | summary("app.repo.query.total_time",
35 | unit: {:native, :millisecond},
36 | description: "The sum of the other measurements"
37 | ),
38 | summary("app.repo.query.decode_time",
39 | unit: {:native, :millisecond},
40 | description: "The time spent decoding the data received from the database"
41 | ),
42 | summary("app.repo.query.query_time",
43 | unit: {:native, :millisecond},
44 | description: "The time spent executing the query"
45 | ),
46 | summary("app.repo.query.queue_time",
47 | unit: {:native, :millisecond},
48 | description: "The time spent waiting for a database connection"
49 | ),
50 | summary("app.repo.query.idle_time",
51 | unit: {:native, :millisecond},
52 | description:
53 | "The time the connection spent waiting before being checked out for the query"
54 | ),
55 |
56 | # VM Metrics
57 | summary("vm.memory.total", unit: {:byte, :kilobyte}),
58 | summary("vm.total_run_queue_lengths.total"),
59 | summary("vm.total_run_queue_lengths.cpu"),
60 | summary("vm.total_run_queue_lengths.io")
61 | ]
62 | end
63 |
64 | defp periodic_measurements do
65 | [
66 | # A module, function and arguments to be invoked periodically.
67 | # This function must call :telemetry.execute/3 and a metric must be added above.
68 | # {AppWeb, :count_users, []}
69 | ]
70 | end
71 | end
72 |
--------------------------------------------------------------------------------
/test/app/user_test.exs:
--------------------------------------------------------------------------------
1 | defmodule App.UserTest do
2 | use App.DataCase
3 | alias App.User
4 |
5 | def user do
6 | %{
7 | avatar_url: "https://avatars.githubusercontent.com/u/4185328?v=4",
8 | bio: "Co-founder @dwyl",
9 | blog: "https://www.twitter.com/iteles",
10 | company: "@dwyl",
11 | created_at: "2013-04-17T21:10:06Z",
12 | email: nil,
13 | followers: 378,
14 | following: 79,
15 | hireable: true,
16 | html_url: "https://github.com/iteles",
17 | id: 4185328,
18 | location: "London, UK",
19 | login: "iteles",
20 | name: "Ines TC",
21 | organizations_url: "https://api.github.com/users/iteles/orgs",
22 | public_gists: 0,
23 | public_repos: 31
24 | }
25 | end
26 |
27 | test "App.User.create/1" do
28 | user = user()
29 | assert {:ok, inserted_user} = App.User.create(user)
30 | assert inserted_user.name == user.name
31 | end
32 |
33 | test "get_user_from_api/1" do
34 | data = App.User.get_user_from_api(%{login: "iteles"}) # |> dbg
35 | assert data.public_repos > 30
36 | end
37 |
38 | test "get_user_from_api/1 unhappy path (kittenking)" do
39 | # ref: https://github.com/dwyl/who/issues/216
40 | user = %{
41 | id: 53072918,
42 | type: "User",
43 | url: "https://api.github.com/users/kittenking",
44 | avatar_url: "https://avatars.githubusercontent.com/u/53072918?v=4",
45 | login: "kittenking",
46 | node_id: "MDQ6VXNlcjUzMDcyOTE4",
47 | user_view_type: "public",
48 | site_admin: false
49 | }
50 | data = App.User.get_user_from_api(user)
51 | assert data.id == user.id
52 | end
53 |
54 | test "list_users" do
55 | data = App.User.dummy_data(%{id: 41, login: "k3v1n"})
56 | assert data.company == "good"
57 | end
58 |
59 | test "list_incomplete_users/0 returns recent incomplete users" do
60 | dummy_data = App.User.dummy_data(%{id: 43, login: "c4t"})
61 | App.User.create_incomplete_user_no_overwrite(dummy_data)
62 | list = App.User.list_incomplete_users()
63 | assert length(list) > 0
64 | end
65 |
66 | test "list_users_avatars/0" do
67 | user = user() |> User.map_github_fields_to_table()
68 | User.create(user)
69 | list = App.User.list_users_avatars()
70 | assert length(list) > 0
71 | end
72 |
73 | test "get_user_by_login(login)" do
74 | dummy_data = App.User.dummy_data(%{id: 46, login: "hi"})
75 | App.User.create_incomplete_user_no_overwrite(dummy_data)
76 | App.User.get_user_by_login(dummy_data.login)
77 | end
78 | end
79 |
--------------------------------------------------------------------------------
/config/runtime.exs:
--------------------------------------------------------------------------------
1 | import Config
2 |
3 | # config/runtime.exs is executed for all environments, including
4 | # during releases. It is executed after compilation and before the
5 | # system starts, so it is typically used to load production configuration
6 | # and secrets from environment variables or elsewhere. Do not define
7 | # any compile-time configuration in here, as it won't be applied.
8 | # The block below contains prod specific runtime configuration.
9 |
10 | # ## Using releases
11 | #
12 | # If you use `mix release`, you need to explicitly enable the server
13 | # by passing the PHX_SERVER=true when you start it:
14 | #
15 | # PHX_SERVER=true bin/app start
16 | #
17 | # Alternatively, you can use `mix phx.gen.release` to generate a `bin/server`
18 | # script that automatically sets the env var above.
19 | if System.get_env("PHX_SERVER") do
20 | config :app, AppWeb.Endpoint, server: true
21 | end
22 |
23 | if config_env() == :prod do
24 | database_url =
25 | System.get_env("DATABASE_URL") ||
26 | raise """
27 | environment variable DATABASE_URL is missing.
28 | For example: ecto://USER:PASS@HOST/DATABASE
29 | """
30 |
31 | maybe_ipv6 = if System.get_env("ECTO_IPV6"), do: [:inet6], else: []
32 |
33 | config :app, App.Repo,
34 | # ssl: true,
35 | url: database_url,
36 | pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
37 | socket_options: maybe_ipv6
38 |
39 | # The secret key base is used to sign/encrypt cookies and other secrets.
40 | # A default value is used in config/dev.exs and config/test.exs but you
41 | # want to use a different value for prod and you most likely don't want
42 | # to check this value into version control, so we use an environment
43 | # variable instead.
44 | secret_key_base =
45 | System.get_env("SECRET_KEY_BASE") ||
46 | raise """
47 | environment variable SECRET_KEY_BASE is missing.
48 | You can generate one by calling: mix phx.gen.secret
49 | """
50 |
51 | host = System.get_env("PHX_HOST") || "example.com"
52 | port = String.to_integer(System.get_env("PORT") || "4000")
53 |
54 | config :app, AppWeb.Endpoint,
55 | url: [host: host, port: 443, scheme: "https"],
56 | http: [
57 | # Enable IPv6 and bind on all interfaces.
58 | # Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.
59 | # See the documentation on https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html
60 | # for details about using IPv6 vs IPv4 and loopback vs public addresses.
61 | ip: {0, 0, 0, 0, 0, 0, 0, 0},
62 | port: port
63 | ],
64 | secret_key_base: secret_key_base
65 | end
66 |
--------------------------------------------------------------------------------
/lib/app_web/templates/layout/root.html.heex:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <.live_title suffix="- Who?">
9 | <%= assigns[:page_title] || "Welcome!" %>
10 |
11 | <%= render("icons.html") %>
12 |
13 |
14 |
15 |
16 |
17 |
42 |
43 | <%= @inner_content %>
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/config/dev.exs:
--------------------------------------------------------------------------------
1 | import Config
2 |
3 | # Configure your database
4 | config :app, App.Repo,
5 | username: "postgres",
6 | password: "postgres",
7 | hostname: "localhost",
8 | database: "app_dev",
9 | stacktrace: true,
10 | show_sensitive_data_on_connection_error: true,
11 | pool_size: 10
12 |
13 | # For development, we disable any cache and enable
14 | # debugging and code reloading.
15 | #
16 | # The watchers configuration can be used to run external
17 | # watchers to your application. For example, we use it
18 | # with esbuild to bundle .js and .css sources.
19 | config :app, AppWeb.Endpoint,
20 | # Binding to loopback ipv4 address prevents access from other machines.
21 | # Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
22 | http: [ip: {127, 0, 0, 1}, port: 4000],
23 | check_origin: false,
24 | code_reloader: true,
25 | debug_errors: true,
26 | secret_key_base: "dRjrTxYmIud786RRIydAytahWWiofrj5e64Z6yCQNq5iaxp5CeO9Rq6YMiCukBzn",
27 | watchers: [
28 | # Start the esbuild watcher by calling Esbuild.install_and_run(:default, args)
29 | esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]},
30 | tailwind: {Tailwind, :install_and_run, [:default, ~w(--watch)]}
31 | ]
32 |
33 | # ## SSL Support
34 | #
35 | # In order to use HTTPS in development, a self-signed
36 | # certificate can be generated by running the following
37 | # Mix task:
38 | #
39 | # mix phx.gen.cert
40 | #
41 | # Note that this task requires Erlang/OTP 20 or later.
42 | # Run `mix help phx.gen.cert` for more information.
43 | #
44 | # The `http:` config above can be replaced with:
45 | #
46 | # https: [
47 | # port: 4001,
48 | # cipher_suite: :strong,
49 | # keyfile: "priv/cert/selfsigned_key.pem",
50 | # certfile: "priv/cert/selfsigned.pem"
51 | # ],
52 | #
53 | # If desired, both `http:` and `https:` keys can be
54 | # configured to run both http and https servers on
55 | # different ports.
56 |
57 | # Watch static and templates for browser reloading.
58 | config :app, AppWeb.Endpoint,
59 | live_reload: [
60 | patterns: [
61 | ~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
62 | ~r"lib/app_web/(live|views)/.*(ex)$",
63 | ~r"lib/app_web/templates/.*(eex)$"
64 | ]
65 | ]
66 |
67 | # Do not include metadata nor timestamps in development logs
68 | config :logger, :console, format: "[$level] $message\n"
69 |
70 | # Set a higher stacktrace during development. Avoid configuring such
71 | # in production as building large stacktraces may be expensive.
72 | config :phoenix, :stacktrace_depth, 20
73 |
74 | # Initialize plugs at runtime for faster development compilation
75 | config :phoenix, :plug_init_mode, :runtime
76 |
--------------------------------------------------------------------------------
/assets/css/app.css:
--------------------------------------------------------------------------------
1 | @import "tailwindcss/base";
2 | @import "tailwindcss/components";
3 | @import "tailwindcss/utilities";
4 |
5 | /* This file is for your main application CSS */
6 |
7 | /* Alerts and form errors used by phx.new */
8 | .alert {
9 | padding: 15px;
10 | margin-bottom: 20px;
11 | border: 1px solid transparent;
12 | border-radius: 4px;
13 | }
14 | .alert-info {
15 | color: #31708f;
16 | background-color: #d9edf7;
17 | border-color: #bce8f1;
18 | }
19 | .alert-warning {
20 | color: #8a6d3b;
21 | background-color: #fcf8e3;
22 | border-color: #faebcc;
23 | }
24 | .alert-danger {
25 | color: #a94442;
26 | background-color: #f2dede;
27 | border-color: #ebccd1;
28 | }
29 | .alert p {
30 | margin-bottom: 0;
31 | }
32 | .alert:empty {
33 | display: none;
34 | }
35 | .invalid-feedback {
36 | color: #a94442;
37 | display: block;
38 | margin: -1rem 0 2rem;
39 | }
40 |
41 | /* LiveView specific classes for your customization */
42 | .phx-no-feedback.invalid-feedback,
43 | .phx-no-feedback .invalid-feedback {
44 | display: none;
45 | }
46 |
47 | .phx-click-loading {
48 | opacity: 0.5;
49 | transition: opacity 1s ease-out;
50 | }
51 |
52 | .phx-loading{
53 | cursor: wait;
54 | }
55 |
56 | .phx-modal {
57 | opacity: 1!important;
58 | position: fixed;
59 | z-index: 1;
60 | left: 0;
61 | top: 0;
62 | width: 100%;
63 | height: 100%;
64 | overflow: auto;
65 | background-color: rgba(0,0,0,0.4);
66 | }
67 |
68 | .phx-modal-content {
69 | background-color: #fefefe;
70 | margin: 15vh auto;
71 | padding: 20px;
72 | border: 1px solid #888;
73 | width: 80%;
74 | }
75 |
76 | .phx-modal-close {
77 | color: #aaa;
78 | float: right;
79 | font-size: 28px;
80 | font-weight: bold;
81 | }
82 |
83 | .phx-modal-close:hover,
84 | .phx-modal-close:focus {
85 | color: black;
86 | text-decoration: none;
87 | cursor: pointer;
88 | }
89 |
90 | .fade-in-scale {
91 | animation: 0.2s ease-in 0s normal forwards 1 fade-in-scale-keys;
92 | }
93 |
94 | .fade-out-scale {
95 | animation: 0.2s ease-out 0s normal forwards 1 fade-out-scale-keys;
96 | }
97 |
98 | .fade-in {
99 | animation: 0.2s ease-out 0s normal forwards 1 fade-in-keys;
100 | }
101 | .fade-out {
102 | animation: 0.2s ease-out 0s normal forwards 1 fade-out-keys;
103 | }
104 |
105 | @keyframes fade-in-scale-keys{
106 | 0% { scale: 0.95; opacity: 0; }
107 | 100% { scale: 1.0; opacity: 1; }
108 | }
109 |
110 | @keyframes fade-out-scale-keys{
111 | 0% { scale: 1.0; opacity: 1; }
112 | 100% { scale: 0.95; opacity: 0; }
113 | }
114 |
115 | @keyframes fade-in-keys{
116 | 0% { opacity: 0; }
117 | 100% { opacity: 1; }
118 | }
119 |
120 | @keyframes fade-out-keys{
121 | 0% { opacity: 1; }
122 | 100% { opacity: 0; }
123 | }
124 |
125 |
--------------------------------------------------------------------------------
/lib/app_web/live/app_live.ex:
--------------------------------------------------------------------------------
1 | defmodule AppWeb.AppLive do
2 | use AppWeb, :live_view
3 |
4 | @topic "live"
5 | @img "https://avatars.githubusercontent.com/u/"
6 |
7 | def mount(_session, _params, socket) do
8 | if connected?(socket) do
9 | AppWeb.Endpoint.subscribe(@topic) # subscribe to the channel
10 | end
11 |
12 | p = %{id: 183617417, login: "Alex",
13 | avatar_url: "#{@img}128895421", name: "Alexander the Greatest",
14 | bio: "Love learning how to code with my crew of cool cats!",
15 | created_at: "2010-02-02T08:44:49Z", company: "ideaq"}
16 | # NEXT: prepend avatars to list ...
17 |
18 | {:ok, assign(socket, %{data: p,
19 | ids: App.User.list_users_avatars(),
20 | count: App.Reqlog.req_count_last_hour()})}
21 | end
22 |
23 | def handle_event("sync", value, socket) do
24 | # IO.inspect("handle_event:sync - - - - -")
25 | org = socket.assigns.data.company
26 | override = if value && Map.has_key?(value, "org") do
27 | # dbg(value)
28 | Map.get(value, "org")
29 | end
30 |
31 | sync(socket, override || org)
32 |
33 | {:noreply, socket}
34 | end
35 |
36 | # def handle_event("update", _value, socket) do
37 | # {:noreply, socket}
38 | # end
39 |
40 | def handle_info(msg, socket) do
41 | {:noreply, assign(socket, data: msg.payload.data)}
42 | end
43 |
44 | # update `data` by broadcasting it as the profiles are crawled:
45 | def sync(socket, org) do
46 | # Get Repos:
47 | Task.start(fn ->
48 | App.Repository.get_org_repos(org)
49 | # |> dbg()
50 | # get all stargazers for a given repo
51 | |> Enum.map(fn repo ->
52 | App.Star.get_stargazers_for_repo(repo.full_name)
53 | # Get List of Contributors for each Repo:
54 | App.Contrib.get_contribs_from_api(repo.full_name)
55 | # repo
56 | end)
57 |
58 | end)
59 |
60 | list = App.GitHub.org_user_list(org)
61 | # Iterate through the list of people and fetch profiles from API
62 | Stream.with_index(list)
63 | |> Enum.map(fn {u, index} ->
64 | # IO.inspect("- - - Enum.map u.login: #{index}: #{u.login}")
65 | data = App.User.get_user_from_api(u)
66 | |> AuthPlug.Helpers.strip_struct_metadata()
67 | sock = assign(socket, %{data: data})
68 | new_state = assign(sock, %{count: App.Reqlog.req_count_last_hour()})
69 | Task.start(fn ->
70 | :timer.sleep(300 + 100 * index)
71 | AppWeb.Endpoint.broadcast(@topic, "update", new_state.assigns)
72 | end)
73 | end)
74 |
75 | {:noreply, socket}
76 | end
77 |
78 | # Template Helper Functions
79 | def short_date(date) do
80 | String.split(date, "T") |> List.first
81 | end
82 |
83 | def truncate_bio(bio) do
84 | Useful.truncate(bio, 29, " ...")
85 | end
86 |
87 | def avatar(id) do
88 | "https://avatars.githubusercontent.com/u/#{id}?s=30"
89 | end
90 | end
91 |
--------------------------------------------------------------------------------
/lib/app_web.ex:
--------------------------------------------------------------------------------
1 | defmodule AppWeb do
2 | @moduledoc """
3 | The entrypoint for defining your web interface, such
4 | as controllers, views, channels and so on.
5 |
6 | This can be used in your application as:
7 |
8 | use AppWeb, :controller
9 | use AppWeb, :view
10 |
11 | The definitions below will be executed for every view,
12 | controller, etc, so keep them short and clean, focused
13 | on imports, uses and aliases.
14 |
15 | Do NOT define functions inside the quoted expressions
16 | below. Instead, define any helper function in modules
17 | and import those modules here.
18 | """
19 |
20 | def controller do
21 | quote do
22 | use Phoenix.Controller, namespace: AppWeb
23 |
24 | import Plug.Conn
25 | alias AppWeb.Router.Helpers, as: Routes
26 | end
27 | end
28 |
29 | def view do
30 | quote do
31 | use Phoenix.View,
32 | root: "lib/app_web/templates",
33 | namespace: AppWeb
34 |
35 | # Import convenience functions from controllers
36 | import Phoenix.Controller,
37 | only: [get_flash: 1, get_flash: 2, view_module: 1, view_template: 1]
38 |
39 | # Include shared imports and aliases for views
40 | unquote(view_helpers())
41 | end
42 | end
43 |
44 | def live_view do
45 | quote do
46 | use Phoenix.LiveView,
47 | layout: {AppWeb.LayoutView, :live}
48 |
49 | unquote(view_helpers())
50 | end
51 | end
52 |
53 | def live_component do
54 | quote do
55 | use Phoenix.LiveComponent
56 |
57 | unquote(view_helpers())
58 | end
59 | end
60 |
61 | def component do
62 | quote do
63 | use Phoenix.Component
64 |
65 | unquote(view_helpers())
66 | end
67 | end
68 |
69 | def router do
70 | quote do
71 | use Phoenix.Router
72 |
73 | import Plug.Conn
74 | import Phoenix.Controller
75 | import Phoenix.LiveView.Router
76 | end
77 | end
78 |
79 | def channel do
80 | quote do
81 | use Phoenix.Channel
82 | end
83 | end
84 |
85 | defp view_helpers do
86 | quote do
87 | # Use all HTML functionality (forms, tags, etc)
88 | import Phoenix.HTML
89 | import Phoenix.HTML.Form
90 | use PhoenixHTMLHelpers
91 |
92 | # Import LiveView and .heex helpers (live_render, live_patch, <.form>, etc)
93 | import Phoenix.LiveView.Helpers
94 |
95 | # Import basic rendering functionality (render, render_layout, etc)
96 | import Phoenix.View
97 |
98 | import AppWeb.ErrorHelpers
99 | alias AppWeb.Router.Helpers, as: Routes
100 | end
101 | end
102 |
103 | @doc """
104 | When used, dispatch to the appropriate controller/view/etc.
105 | """
106 | defmacro __using__(which) when is_atom(which) do
107 | apply(__MODULE__, which, [])
108 | end
109 | end
110 |
--------------------------------------------------------------------------------
/lib/app/repository.ex:
--------------------------------------------------------------------------------
1 | defmodule App.Repository do
2 | use Ecto.Schema
3 | alias App.{Repo}
4 | import Ecto.{Changeset} #, Query}
5 | require Logger
6 | alias __MODULE__
7 |
8 | schema "repositories" do
9 | field :created_at, :string
10 | field :description, :string
11 | field :fork, :boolean, default: false
12 | field :forks_count, :integer
13 | field :full_name, :string
14 | field :language, :string
15 | field :name, :string
16 | field :open_issues_count, :integer
17 | field :owner_id, :integer
18 | field :pushed_at, :string
19 | field :stargazers_count, :integer
20 | field :topics, :string
21 | field :watchers_count, :integer
22 |
23 | timestamps()
24 | end
25 |
26 | @doc false
27 | def changeset(repository, attrs) do
28 | attrs = %{attrs | topics: Enum.join(attrs.topics, ", ")}
29 |
30 | repository
31 | |> cast(attrs, [
32 | :created_at,
33 | :id,
34 | :description,
35 | :fork,
36 | :forks_count,
37 | :full_name,
38 | :language,
39 | :name,
40 | :open_issues_count,
41 | :owner_id,
42 | :pushed_at,
43 | :stargazers_count,
44 | :topics,
45 | :watchers_count
46 | ])
47 | |> validate_required([:name, :full_name])
48 | end
49 |
50 | @doc """
51 | Creates a `repository`.
52 | """
53 | def create(attrs) do
54 | %Repository{}
55 | |> changeset(attrs)
56 | |> Repo.insert(on_conflict: :replace_all, conflict_target: [:id])
57 | end
58 |
59 | @doc """
60 | `get_repo_id_by_full_name/1` Gets the repository `id` by `full_name`.
61 | e.g: get_repo_id_by_full_name("dwyl/start-here") -> 17338019
62 | """
63 | def get_repo_id_by_full_name(full_name) do
64 | repo = Repo.get_by(Repository, [full_name: full_name])
65 | if is_nil(repo) do
66 | [owner, reponame] = String.split(full_name, "/")
67 | {:ok, repo} = App.GitHub.repository(owner, reponame) |> create()
68 |
69 | repo.id
70 | else
71 | repo.id
72 | end
73 | end
74 |
75 | @doc """
76 | Get all repositories for an organization and insert them into DB.
77 | """
78 | def get_org_repos(org) do
79 | App.GitHub.org_repos(org)
80 | |> Enum.map(fn repo ->
81 | {:ok, inserted_repo} = create(repo)
82 |
83 | inserted_repo
84 | end)
85 | end
86 | end
87 |
88 | """
89 | %App.Repository{
90 | __meta__: #Ecto.Schema.Metadata<:loaded, "repositories">,
91 | id: 35713694,
92 | created_at: "2015-05-16T07:06:03Z",
93 | description: "Effortless Meteor.js Image Uploads",
94 | fork: true,
95 | forks_count: 1,
96 | full_name: "ideaq/image-uploads",
97 | language: "JavaScript",
98 | name: "image-uploads",
99 | open_issues_count: 0,
100 | owner_id: nil,
101 | pushed_at: "2016-07-02T12:37:46Z",
102 | stargazers_count: 5,
103 | topics: nil,
104 | watchers_count: 5,
105 | inserted_at: ~N[2025-01-20 12:27:57],
106 | updated_at: ~N[2025-01-20 12:27:57]
107 | }
108 | """
109 |
--------------------------------------------------------------------------------
/lib/app/github.ex:
--------------------------------------------------------------------------------
1 | defmodule App.GitHub do
2 | @moduledoc """
3 | Handles all interactions with the GitHub REST API
4 | via: github.com/edgurgel/tentacat Elixir GitHub Lib.
5 | """
6 | import App.Reqlog, only: [log: 2]
7 |
8 | @access_token Application.compile_env(:tentacat, :access_token)
9 | @client Tentacat.Client.new(%{access_token: @access_token})
10 |
11 | @doc """
12 | Returns org data.
13 | """
14 | def followers(login) do
15 | log("followers", login)
16 | {_status, data, _res} =
17 | Tentacat.Users.Followers.followers(@client, login)
18 | data
19 | end
20 |
21 | @doc """
22 | Returns org data.
23 | """
24 | def org(login) do
25 | log("org", login)
26 | {_status, data, _res} =
27 | Tentacat.Organizations.find(@client, login)
28 | data
29 | end
30 |
31 | @doc """
32 | Returns the list of GitHub repositories for an Org.
33 | """
34 | def org_repos(owner) do
35 | log("org_repos", owner)
36 | {_status, data, _res} =
37 | Tentacat.Repositories.list_orgs(@client, owner)
38 | data
39 | end
40 |
41 | @doc """
42 | Returns the GitHub repository data.
43 | """
44 | def repository(owner, reponame) do
45 | log("repository", "#{owner}/#{reponame}")
46 | {_status, data, _res} =
47 | Tentacat.Repositories.repo_get(@client, owner, reponame)
48 | data
49 | end
50 |
51 | @doc """
52 | Returns the list of contributors for a GitHub repository.
53 | """
54 | def repo_contribs(owner, reponame) do
55 | log("repo_contribs", "#{owner}/#{reponame}")
56 | {_status, data, _res} =
57 | Tentacat.Repositories.Contributors.list(@client, owner, reponame)
58 | data
59 | end
60 |
61 | @doc """
62 | `repo_stargazers/2` Returns the list of GitHub users starring a repo.
63 | `owner` - the owner of the repo
64 | `repo` - name of the repo to check stargazers for.
65 | """
66 | def repo_stargazers(fullname) do
67 | [owner, repo] = String.split(fullname, "/")
68 | log("repo_stargazers", "#{owner}/#{repo}")
69 | {_status, data, _res} =
70 | Tentacat.Users.Starring.stargazers(@client, owner, repo)
71 | data
72 | end
73 |
74 | @doc """
75 | `user/1` Returns the GitHub user profile data.
76 | """
77 | def user(username) do
78 | log("user", username)
79 | {_status, data, _res} = Tentacat.Users.find(@client, username)
80 | data
81 | end
82 |
83 | @doc """
84 | `user_orgs/1` Returns the list of `public` GitHub orgs for a user.
85 | """
86 | def user_orgs(username) do
87 | log("user_orgs", username)
88 | {_status, data, _res} = Tentacat.Organizations.list(@client, username)
89 | data
90 | end
91 |
92 | @doc """
93 | `org_user_list/1` Returns the list of GitHub users for an org.
94 | """
95 | def org_user_list(orgname) do
96 | log("org_user_list", orgname)
97 | handler(Tentacat.Organizations.Members.list(@client, orgname))
98 | end
99 |
100 | def handler(callee) do
101 | # {status, data, _res} = callee
102 | # dbg(status)
103 | # dbg(data)
104 | # data
105 | case callee do
106 | {200, data, _res} ->
107 | data
108 | {404, data, res} ->
109 | log(res.request_url, res.status_code)
110 | dbg(data)
111 | end
112 | end
113 | end
114 |
--------------------------------------------------------------------------------
/mix.exs:
--------------------------------------------------------------------------------
1 | defmodule App.MixProject do
2 | use Mix.Project
3 |
4 | def project do
5 | [
6 | app: :app,
7 | version: "1.7.0",
8 | elixir: "~> 1.17",
9 | elixirc_paths: elixirc_paths(Mix.env()),
10 | compilers: Mix.compilers(),
11 | start_permanent: Mix.env() == :prod,
12 | aliases: aliases(),
13 | deps: deps(),
14 | test_coverage: [tool: ExCoveralls],
15 | preferred_cli_env: [
16 | c: :test,
17 | coveralls: :test,
18 | "coveralls.json": :test,
19 | "coveralls.html": :test,
20 | t: :test
21 | ]
22 | ]
23 | end
24 |
25 | # Configuration for the OTP application.
26 | #
27 | # Type `mix help compile.app` for more information.
28 | def application do
29 | [
30 | mod: {App.Application, []},
31 | extra_applications: [:logger, :runtime_tools]
32 | ]
33 | end
34 |
35 | # Specifies which paths to compile per environment.
36 | defp elixirc_paths(:test), do: ["lib", "test/support"]
37 | defp elixirc_paths(_), do: ["lib"]
38 |
39 | # Specifies your project dependencies.
40 | #
41 | # Type `mix help deps` for examples and options.
42 | defp deps do
43 | [
44 | {:phoenix, "~> 1.8.0"},
45 | {:phoenix_ecto, "~> 4.4"},
46 | {:ecto_sql, "~> 3.6"},
47 | {:postgrex, ">= 0.0.0"},
48 | {:phoenix_html, "~> 4.0"},
49 | {:phoenix_html_helpers, "~> 1.0"},
50 | {:phoenix_live_reload, "~> 1.2", only: :dev},
51 | {:phoenix_live_view, "~> 1.1.2"},
52 | {:phoenix_view, "~> 2.0"},
53 | {:floki, ">= 0.30.0", only: :test},
54 | {:esbuild, "~> 0.4", runtime: Mix.env() == :dev},
55 | {:telemetry_metrics, "~> 1.0"},
56 | {:telemetry_poller, "~> 1.0"},
57 | {:jason, "~> 1.2"},
58 | {:plug_cowboy, "~> 2.5"},
59 |
60 | # Check/get Environment Variables: https://github.com/dwyl/envar
61 | {:envar, "~> 1.0.8"},
62 | # Auth with ONE Environment Variable™: github.com/dwyl/auth_plug
63 | {:auth_plug, "~> 1.5.0"},
64 | # Easily Encrypt Senstive Data: github.com/dwyl/fields
65 | {:fields, "~> 2.10.3"},
66 | # Useful functions: github.com/dwyl/useful
67 | {:useful, "~> 1.15.0", override: true},
68 |
69 | # JSON Parsing: https://hex.pm/packages/poison
70 | {:poison, "~> 6.0.0"},
71 |
72 | # Extract image data: https://github.com/elixir-image/image/
73 | {:image, "~> 0.37"},
74 |
75 | # Create docs on localhost by running "mix docs"
76 | {:ex_doc, "~> 0.39.1", only: :dev, runtime: false},
77 | # Track test coverage
78 | {:excoveralls, "~> 0.18.0", only: [:test, :dev]},
79 | # git pre-commit hook runs tests before allowing commits
80 | {:pre_commit, "~> 0.3.4"},
81 | # Credo static analysis: https://github.com/rrrene/credo
82 | {:credo, "~> 1.7.0", only: [:dev, :test], runtime: false},
83 |
84 | # Ref: github.com/dwyl/learn-tailwind
85 | {:tailwind, "~> 0.4.0", runtime: Mix.env() == :dev},
86 |
87 | # Elixir GitHub REST API lib: github.com/edgurgel/tentacat
88 | {:tentacat, "~> 2.0"},
89 | {:lazy_html, ">= 0.1.0", only: :test}
90 | ]
91 | end
92 |
93 | # Aliases are shortcuts or tasks specific to the current project.
94 | # For example, to install project dependencies and perform other setup tasks, run:
95 | #
96 | # $ mix setup
97 | #
98 | # See the documentation for `Mix` for more info on aliases.
99 | defp aliases do
100 | [
101 | seeds: ["run priv/repo/seeds.exs"],
102 | setup: ["deps.get", "ecto.reset", "tailwind.install"],
103 | "ecto.setup": [
104 | "ecto.create --quiet",
105 | "ecto.migrate --quiet",
106 | "run priv/repo/seeds.exs"
107 | ],
108 | "ecto.reset": ["ecto.drop --quiet", "ecto.setup"],
109 | "assets.deploy": [
110 | "tailwind default --minify",
111 | "esbuild default --minify",
112 | "phx.digest"
113 | ],
114 | test: ["ecto.reset", "test"],
115 | t: ["test --trace"],
116 | c: ["coveralls.html --trace"],
117 | s: ["phx.server"]
118 | ]
119 | end
120 | end
121 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | dwyl - Who?
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | - Why?
18 | - Who?
19 | - What?
20 | - How?
21 |
22 |
23 |
24 |
25 | dwyl is made by many people
26 | all over the world!
27 |
28 |
29 |
30 |
31 |
32 |
59 |
60 |
139 |
140 |
141 |
142 |
--------------------------------------------------------------------------------
/lib/app/org.ex:
--------------------------------------------------------------------------------
1 | defmodule App.Org do
2 | alias App.{Repo}
3 | use Ecto.Schema
4 | import Ecto.{Changeset, Query}
5 | require Logger
6 | alias __MODULE__
7 |
8 | schema "orgs" do
9 | field :avatar_url, :string
10 | field :blog, :string
11 | field :company, :string
12 | field :created_at, :string
13 | field :description, :string
14 | field :followers, :integer
15 | field :hex, :string
16 | field :location, :string
17 | field :login, :string #, primary_key: true
18 | field :name, :string
19 | field :public_repos, :integer
20 | field :show, :boolean, default: false
21 |
22 | timestamps()
23 | end
24 |
25 | @doc false
26 | def changeset(org, attrs) do
27 | org
28 | |> cast(attrs, [:id, :login, :avatar_url, :hex, :description, :name,
29 | :company, :created_at, :public_repos, :location, :followers, :show])
30 | # |> validate_required([:id, :login, :avatar_url])
31 | # |> unique_constraint(:login, name: :org_login_unique)
32 | end
33 |
34 | @doc """
35 | Creates an `org`.
36 | """
37 | def create(attrs) do
38 | %Org{}
39 | |> changeset(attrs)
40 | |> Repo.insert(on_conflict: :replace_all, conflict_target: [:id]) # upsert
41 | end
42 |
43 | def get_org_by_login(login) do
44 | from(o in Org, where: o.login == ^login)
45 | |> Repo.one()
46 | end
47 |
48 | # `org` map must include the `id` and `login` fields
49 | def get_org_from_api(org) do
50 | data = App.GitHub.org(org.login)
51 | # Not super happy about this crude error handling ... feel free to refactor.
52 | if Map.has_key?(data, :status) && data.status == "404" do
53 | update_org_created(org)
54 | else
55 | create_org_with_hex(data)
56 | end
57 | end
58 |
59 | def create_org_with_hex(data) do
60 | {:ok, org} =
61 | App.User.map_github_fields_to_table(data)
62 | |> Map.put(:hex, App.Img.get_avatar_color(data.avatar_url))
63 | |> create()
64 |
65 | org
66 | end
67 |
68 | @doc """
69 | `list_incomplete_orgs/0` returns a list of incomplete orgs. Why...?
70 | An `org` returned by `App.Orgmember.get_orgs_for_user/1` it is incomplete.
71 | Therefore we need to back-fill the data by selecting and querying.
72 | """
73 | # When an org is returned by `App.Orgmember.get_orgs_for_user/1` it is incomplete
74 | # Therefore we need to back-fill the data by selecting and querying
75 | # SELECT COUNT(*) FROM orgs WHERE created_at IS NULL
76 | def list_incomplete_orgs do
77 | from(o in Org,
78 | select: %{login: o.login, id: o.id},
79 | where: is_nil(o.created_at)
80 | )
81 | |> limit(5)
82 | |> order_by(desc: :inserted_at)
83 | |> Repo.all()
84 | end
85 |
86 | def backfill do
87 | list_incomplete_orgs()
88 | |> Enum.each(fn org ->
89 | get_org_from_api(org)
90 | App.Orgmember.get_users_for_org(org)
91 | App.Follow.get_followers_from_api(org.login, true)
92 | end)
93 | end
94 |
95 | @doc """
96 | `update_org_created/1` updates the `created_at` date to Now
97 | so that we don't keep requesting the data from GitHub.
98 | """
99 | def update_org_created(org) do
100 | org = get_or_create_org(org)
101 | {:ok, org_updated} =
102 | Ecto.Changeset.change(org, %{created_at: now()})
103 | |> App.Repo.update()
104 |
105 | # return the org that was updated:
106 | org_updated
107 | end
108 |
109 | @doc """
110 | `now/0` returns a `NaiveDateTime` as a `String` in format: 2025-02-25 07:29:10
111 | """
112 | def now do
113 | NaiveDateTime.utc_now()
114 | |> NaiveDateTime.to_string()
115 | |> String.split(".")
116 | |> List.first()
117 | end
118 |
119 | # def strip_struct_metadata(struct) do
120 | # struct
121 | # |> Map.delete(:__meta__)
122 | # |> Map.delete(:__struct__)
123 | # end
124 |
125 |
126 | def get_or_create_org(org) do
127 | org_data = get_org_by_login(org.login)
128 | if is_nil(org_data) do
129 | # dbg(org)
130 | {:ok, org_data} =
131 | create(Map.merge(org, %{id: :rand.uniform(1_000_000_000_000)}))
132 |
133 | org_data
134 | else
135 | org_data
136 | end
137 | end
138 | end
139 |
--------------------------------------------------------------------------------
/lib/app/user.ex:
--------------------------------------------------------------------------------
1 | defmodule App.User do
2 | use Ecto.Schema
3 | alias App.{Repo}
4 | import Ecto.{Changeset, Query}
5 | require Logger
6 | alias __MODULE__
7 |
8 | schema "users" do
9 | field :avatar_url, :string
10 | field :bio, :string
11 | field :blog, :string
12 | field :company, :string
13 | field :created_at, :string
14 | field :email, :string
15 | field :followers, :integer
16 | field :following, :integer
17 | field :hex, :string
18 | field :hireable, :boolean #, default: false
19 | field :location, :string
20 | field :login, :string
21 | field :name, :string
22 | field :public_repos, :integer
23 | field :two_factor_authentication, :boolean, default: false
24 |
25 | timestamps()
26 | end
27 |
28 | @doc false
29 | def changeset(user, attrs) do
30 | user
31 | |> cast(attrs, [:id, :login, :avatar_url, :name, :company, :bio, :blog, :location, :email, :created_at, :hex, :hireable, :two_factor_authentication, :public_repos, :followers, :following])
32 | |> validate_required([:id, :login, :avatar_url])
33 | end
34 |
35 | @doc """
36 | Creates a `user`.
37 | """
38 | def create(attrs) do
39 | %User{}
40 | |> changeset(attrs)
41 | |> Repo.insert(on_conflict: :replace_all, conflict_target: [:id])
42 | end
43 |
44 | def get_user_by_login(login) do
45 | Repo.get_by(User, [login: login])
46 | end
47 |
48 | # `user` map must include the `id` and `login` fields
49 | def get_user_from_api(user) do
50 | data = App.GitHub.user(user.login) # |> dbg()
51 | # Not super happy about this crude error handling ... feel free to refactor.
52 | if Map.has_key?(data, :status) && data.status == "404" do
53 | # {:ok, user} = dummy_data(user) |> create() # don't insert dummy data!
54 |
55 | user
56 | else
57 | create_user_with_hex(data)
58 | end
59 | end
60 |
61 | def create_user_with_hex(data) do
62 | {:ok, user} =
63 | map_github_fields_to_table(data)
64 | |> Map.put(:hex, App.Img.get_avatar_color(data.avatar_url))
65 | |> create()
66 |
67 | user
68 | end
69 |
70 | # This is useful when inserting partial user records e.g. stargazers
71 | def create_incomplete_user_no_overwrite(data) do
72 | partial_data =
73 | map_github_fields_to_table(data)
74 | |> Map.put(:hex, App.Img.get_avatar_color(data.avatar_url))
75 |
76 | {:ok, user} =
77 | %User{}
78 | |> changeset(partial_data)
79 | |> Repo.insert(on_conflict: :nothing, conflict_target: [:id])
80 |
81 | user
82 | end
83 |
84 | # tidy data before insertion
85 | def map_github_fields_to_table(u) do
86 | Map.merge(u, %{
87 | avatar_url: String.split(u.avatar_url, "?") |> List.first,
88 | company: clean_company(u),
89 | })
90 | end
91 |
92 | def clean_company(u) do
93 | # avoid `String.replace(nil, "@", "", [])` error
94 | if not Map.has_key?(u, :company) or u.company == nil do
95 | ""
96 | else
97 | String.replace(u.company, "@", "")
98 | end
99 | end
100 |
101 | # create function that returns dummy user data
102 | def dummy_data(u \\ %{}) do
103 | Map.merge(%{
104 | id: :rand.uniform(1_000_000_000) + 1_000_000_000,
105 | avatar_url: "https://avatars.githubusercontent.com/u/10137",
106 | bio: "",
107 | blog: "",
108 | company: "good",
109 | created_at: "",
110 | email: "",
111 | followers: 0,
112 | following: 0,
113 | hireable: false,
114 | location: "",
115 | login: "al3x",
116 | name: "Lex",
117 | public_repos: 0,
118 | two_factor_authentication: false
119 | }, u)
120 | end
121 |
122 | # When a user is returned by `org_user_list/1` it is incomplete
123 | # Therefore we need to back-fill the data by selecting and querying
124 | # SELECT COUNT(*) FROM users WHERE created_at IS NULL
125 | def list_incomplete_users do
126 | from(u in User,
127 | select: %{id: u.id, login: u.login},
128 | where: is_nil(u.created_at)
129 | )
130 | |> limit(20)
131 | |> order_by(desc: :inserted_at)
132 | |> Repo.all()
133 | end
134 |
135 | def list_users_avatars do
136 | from(u in User, select: %{id: u.id})
137 | |> limit(100)
138 | # |> order_by(desc: :hex)
139 | # |> distinct(true)
140 | |> order_by(asc: :created_at)
141 | |> Repo.all()
142 | # return a list of urls not a list of maps
143 | |> Enum.reduce([], fn u, acc ->
144 | [u.id | acc]
145 | end)
146 | end
147 | end
148 |
--------------------------------------------------------------------------------
/lib/app_web/live/app_live.html.heex:
--------------------------------------------------------------------------------
1 |
5 | {@count}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Unique Visitors
17 |
18 | 24.7K
19 |
20 |
21 |
22 |
23 |
24 | +20%
25 |
26 |
27 | vs. last month
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | Total Pageviews
37 |
38 | 55.9K
39 |
40 |
41 |
42 |
43 |
44 | +4%
45 |
46 |
47 | vs. last month
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | Bounce Rate
57 |
58 | 54%
59 |
60 |
61 |
62 |
63 |
64 | -4%
65 |
66 |
67 | vs. last month
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | Visit Duration
78 |
79 | 2m 56s
80 |
81 |
82 |
83 |
84 |
85 | +7%
86 |
87 |
88 | vs. last month
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
Newest person:
102 |
103 |
104 |
105 |
107 |
108 |

110 |
111 |
112 | @{@data.login}
113 |
114 |
115 | {@data.name}
116 |
117 |
118 | {truncate_bio(@data.bio)}
119 |
120 |
121 | -
122 | Company
123 |
124 |
125 | {@data.company}
126 |
127 |
128 |
129 | -
130 | Joined On
131 | {short_date(@data.created_at)}
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
--------------------------------------------------------------------------------
/assets/vendor/topbar.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license MIT
3 | * topbar 1.0.0, 2021-01-06
4 | * https://buunguyen.github.io/topbar
5 | * Copyright (c) 2021 Buu Nguyen
6 | */
7 | (function (window, document) {
8 | "use strict";
9 |
10 | // https://gist.github.com/paulirish/1579671
11 | (function () {
12 | var lastTime = 0;
13 | var vendors = ["ms", "moz", "webkit", "o"];
14 | for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
15 | window.requestAnimationFrame =
16 | window[vendors[x] + "RequestAnimationFrame"];
17 | window.cancelAnimationFrame =
18 | window[vendors[x] + "CancelAnimationFrame"] ||
19 | window[vendors[x] + "CancelRequestAnimationFrame"];
20 | }
21 | if (!window.requestAnimationFrame)
22 | window.requestAnimationFrame = function (callback, element) {
23 | var currTime = new Date().getTime();
24 | var timeToCall = Math.max(0, 16 - (currTime - lastTime));
25 | var id = window.setTimeout(function () {
26 | callback(currTime + timeToCall);
27 | }, timeToCall);
28 | lastTime = currTime + timeToCall;
29 | return id;
30 | };
31 | if (!window.cancelAnimationFrame)
32 | window.cancelAnimationFrame = function (id) {
33 | clearTimeout(id);
34 | };
35 | })();
36 |
37 | var canvas,
38 | progressTimerId,
39 | fadeTimerId,
40 | currentProgress,
41 | showing,
42 | addEvent = function (elem, type, handler) {
43 | if (elem.addEventListener) elem.addEventListener(type, handler, false);
44 | else if (elem.attachEvent) elem.attachEvent("on" + type, handler);
45 | else elem["on" + type] = handler;
46 | },
47 | options = {
48 | autoRun: true,
49 | barThickness: 3,
50 | barColors: {
51 | 0: "rgba(26, 188, 156, .9)",
52 | ".25": "rgba(52, 152, 219, .9)",
53 | ".50": "rgba(241, 196, 15, .9)",
54 | ".75": "rgba(230, 126, 34, .9)",
55 | "1.0": "rgba(211, 84, 0, .9)",
56 | },
57 | shadowBlur: 10,
58 | shadowColor: "rgba(0, 0, 0, .6)",
59 | className: null,
60 | },
61 | repaint = function () {
62 | canvas.width = window.innerWidth;
63 | canvas.height = options.barThickness * 5; // need space for shadow
64 |
65 | var ctx = canvas.getContext("2d");
66 | ctx.shadowBlur = options.shadowBlur;
67 | ctx.shadowColor = options.shadowColor;
68 |
69 | var lineGradient = ctx.createLinearGradient(0, 0, canvas.width, 0);
70 | for (var stop in options.barColors)
71 | lineGradient.addColorStop(stop, options.barColors[stop]);
72 | ctx.lineWidth = options.barThickness;
73 | ctx.beginPath();
74 | ctx.moveTo(0, options.barThickness / 2);
75 | ctx.lineTo(
76 | Math.ceil(currentProgress * canvas.width),
77 | options.barThickness / 2
78 | );
79 | ctx.strokeStyle = lineGradient;
80 | ctx.stroke();
81 | },
82 | createCanvas = function () {
83 | canvas = document.createElement("canvas");
84 | var style = canvas.style;
85 | style.position = "fixed";
86 | style.top = style.left = style.right = style.margin = style.padding = 0;
87 | style.zIndex = 100001;
88 | style.display = "none";
89 | if (options.className) canvas.classList.add(options.className);
90 | document.body.appendChild(canvas);
91 | addEvent(window, "resize", repaint);
92 | },
93 | topbar = {
94 | config: function (opts) {
95 | for (var key in opts)
96 | if (options.hasOwnProperty(key)) options[key] = opts[key];
97 | },
98 | show: function () {
99 | if (showing) return;
100 | showing = true;
101 | if (fadeTimerId !== null) window.cancelAnimationFrame(fadeTimerId);
102 | if (!canvas) createCanvas();
103 | canvas.style.opacity = 1;
104 | canvas.style.display = "block";
105 | topbar.progress(0);
106 | if (options.autoRun) {
107 | (function loop() {
108 | progressTimerId = window.requestAnimationFrame(loop);
109 | topbar.progress(
110 | "+" + 0.05 * Math.pow(1 - Math.sqrt(currentProgress), 2)
111 | );
112 | })();
113 | }
114 | },
115 | progress: function (to) {
116 | if (typeof to === "undefined") return currentProgress;
117 | if (typeof to === "string") {
118 | to =
119 | (to.indexOf("+") >= 0 || to.indexOf("-") >= 0
120 | ? currentProgress
121 | : 0) + parseFloat(to);
122 | }
123 | currentProgress = to > 1 ? 1 : to;
124 | repaint();
125 | return currentProgress;
126 | },
127 | hide: function () {
128 | if (!showing) return;
129 | showing = false;
130 | if (progressTimerId != null) {
131 | window.cancelAnimationFrame(progressTimerId);
132 | progressTimerId = null;
133 | }
134 | (function loop() {
135 | if (topbar.progress("+.1") >= 1) {
136 | canvas.style.opacity -= 0.05;
137 | if (canvas.style.opacity <= 0.05) {
138 | canvas.style.display = "none";
139 | fadeTimerId = null;
140 | return;
141 | }
142 | }
143 | fadeTimerId = window.requestAnimationFrame(loop);
144 | })();
145 | },
146 | };
147 |
148 | if (typeof module === "object" && typeof module.exports === "object") {
149 | module.exports = topbar;
150 | } else if (typeof define === "function" && define.amd) {
151 | define(function () {
152 | return topbar;
153 | });
154 | } else {
155 | this.topbar = topbar;
156 | }
157 | }.call(this, window, document));
158 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # *Who*? 🦄
4 |
5 | 
6 |
7 | The **quick _answer_**
8 | to the question:
9 | **_Who_ is in the `@dwyl` community?**
10 |
11 | [](https://github.com/dwyl/who/actions/workflows/ci.yml)
12 | [](http://codecov.io/github/dwyl/who?branch=main)
13 | [](https://hex.pm/packages/elixir_auth_google)
14 | [](https://github.com/dwyl/who/issues)
15 | [](https://hits.dwyl.com/dwyl/app-who)
16 |
17 |
18 |
19 | # **`TODO`**: re-generate the "wall of faces" using latest data `#HelpWanted`
20 |
21 |
22 | 
23 |
24 | # *Why*?
25 |
26 | We needed an **easy, fast & reliable _system_**
27 | to **_visualize_ `who`** is joining
28 | the **`@dwyl` community**
29 | and **track growth** over time. 📈
30 |
31 | The [**start-here** > ***who***](https://github.com/dwyl/start-here/tree/8bbd28d2ab0c3b5a2a266a1e41fd160fc6ee3038#who)
32 | section ~~is~~ _was_ *woefully* out of date
33 | because we had to update it _manually_. ⏳
34 | (_this was
35 | [noted](https://github.com/dwyl/start-here/issues/9)
36 | a `while` back...
37 | but sadly was not made
38 | a priority at the time..._)
39 | This mini-app/project is designed
40 | to scratch our own itch
41 | and save us
42 | [time](https://github.com/dwyl/start-here/issues/255).
43 |
44 | # *What*?
45 |
46 | There are **_two_ ways**
47 | of discovering
48 | the list of people
49 | contributing to the
50 | **dwyl mission**;
51 |
52 | ## 1. _Manually_ check *dwyl* Org *People Page* on GitHub
53 |
54 | Visit
55 | [github.com/orgs/dwyl/people](https://github.com/orgs/dwyl/people)
56 | you can see a list of people
57 | who are _members_ of the Org.
58 | *Simple. effective. incomplete*.
59 | This list only scratches the surface!
60 |
61 | ## 2. List all contributors to dwyl repos on `GitHub`
62 |
63 | Read the Commit History for all the dwyl repos on GitHub
64 | and extract the names of people ...
65 | As you can imagine,
66 | this second option
67 | is _painful_ to do _manually_ ... ⏳
68 | So we _had_ to create a mini-App
69 | to do it for us
70 | via the **`GitHub` API**! 💡
71 |
72 | # *How*?
73 |
74 | We built this mini-App
75 | using the
76 | [**`PETAL`** Stack](https://github.com/dwyl/technology-stack/#the-petal-stack)
77 | because we feel
78 | it's the _fastest_
79 | and most _effective_ way
80 | to ship a web app.
81 |
82 | ## Build Log 👷♀️
83 |
84 | If you want to **understand _every_ step**
85 | of the process of **_building_** the **mini-app**,
86 | read:
87 | [**`BUILDIT.md`**](https://github.com/dwyl/who/blob/main/BUILDIT.md)
88 |
89 |
90 | ## Run the `Who` App on your `localhost` ⬇️
91 |
92 | > **Note**: You will need to have
93 | **`Elixir`** and **`Postgres` installed**,
94 | see:
95 | [learn-elixir#installation](https://github.com/dwyl/learn-elixir#installation)
96 | and
97 | [learn-postgresql#installation](https://github.com/dwyl/learn-postgresql#installation)
98 | > respectively.
99 | > **Tip**: check the prerequisites in:
100 | > [**/phoenix-chat-example**](https://github.com/dwyl/phoenix-chat-example#0-pre-requisites-before-you-start)
101 |
102 | On your `localhost`,
103 | run the following commands
104 | in your terminal:
105 |
106 | ```sh
107 | git clone git@github.com:dwyl/who.git && cd who
108 | mix setup
109 | ```
110 |
111 | That will download the **`code`**,
112 | install dependencies
113 | and create the necessary database + tables.
114 |
115 | _Next_ you need to do **`1 minute`** of setup. ⏱️
116 | ### Create `.env` file
117 |
118 | Create an `.env` file by copying the sample:
119 |
120 | ```sh
121 | cp .env_sample .env
122 | ```
123 |
124 | This file will load the
125 | [environment variables](https://github.com/dwyl/learn-environment-variables)
126 | required to run the App.
127 |
128 | ### Get your `GitHub` Personal Access Token
129 |
130 | To access the **`GitHub` API**,
131 | you will need to generate a
132 | **Personal Access Token**:
133 | [github.com/settings/tokens](https://github.com/settings/tokens/new)
134 |
135 | Click on the **`Generate new token`** button.
136 | Name it something memorable so you know what the token is for:
137 |
138 |
139 |
140 | and make sure the token will have both `repo`
141 |
142 |
143 |
144 | and `user` access:
145 |
146 |
147 |
148 | Once you've created the token,
149 | copy it to your clipboard for the next step.
150 |
151 | ### Add your `GitHub` token to the `.env` file
152 |
153 | Add your token after the `=` sign:
154 |
155 | ```sh
156 | export GH_PERSONAL_ACCESS_TOKEN=
157 | ```
158 |
159 | Once you've saved your `.env` file,
160 | run:
161 |
162 | ```sh
163 | source .env
164 | ```
165 |
166 | Once you have sourced your `.env` file,
167 | you can run the app with:
168 |
169 | ```sh
170 | mix s
171 | ```
172 |
173 | Open the App in your web browser
174 | [**`localhost:4000`**](http://localhost:4000/)
175 | and start your tour!
176 |
177 |
178 |
179 | ## Contributing 👩💻
180 |
181 | All contributions
182 | from typo fixes
183 | to feature requests
184 | are always welcome! 🙌
185 |
186 | Please start by:
187 | a. **Star** the repo on GitHub
188 | so you have a "bookmark" you can return to. ⭐
189 | b. **Fork** the repo
190 | so you have a copy you can "hack" on. 🍴
191 | c. **Clone** the repo to your `localhost`
192 | and run it! 👩💻
193 |
194 |
195 | For more detail on contributing,
196 | please see:
197 | [dwyl/**contributing**](https://github.com/dwyl/contributing)
198 |
199 | ### More Features? 🔔
200 |
201 | If you have feature ideas, that's great! 🎉
202 | Please _share_:
203 | [**who/issues**](https://github.com/dwyl/who/issues) 🙏
204 |
205 | # Features (Todo)
206 |
207 | + List Repos in the Org:
208 | https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories
209 |
210 | + List of people that Star a given repo.
211 |
212 | + List of people who have _contributed_ to repo.
--------------------------------------------------------------------------------
/assets/css/phoenix.css:
--------------------------------------------------------------------------------
1 | /* Includes some default style for the starter application.
2 | * This can be safely deleted to start fresh.
3 | */
4 |
5 | /* Milligram v1.4.1 https://milligram.github.io
6 | * Copyright (c) 2020 CJ Patoilo Licensed under the MIT license
7 | */
8 |
9 | *,*:after,*:before{box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{color:#000000;font-family:'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;font-size:1.6em;font-weight:300;letter-spacing:.01em;line-height:1.6}blockquote{border-left:0.3rem solid #d1d1d1;margin-left:0;margin-right:0;padding:1rem 1.5rem}blockquote *:last-child{margin-bottom:0}.button,button,input[type='button'],input[type='reset'],input[type='submit']{background-color:#0069d9;border:0.1rem solid #0069d9;border-radius:.4rem;color:#fff;cursor:pointer;display:inline-block;font-size:1.1rem;font-weight:700;height:3.8rem;letter-spacing:.1rem;line-height:3.8rem;padding:0 3.0rem;text-align:center;text-decoration:none;text-transform:uppercase;white-space:nowrap}.button:focus,.button:hover,button:focus,button:hover,input[type='button']:focus,input[type='button']:hover,input[type='reset']:focus,input[type='reset']:hover,input[type='submit']:focus,input[type='submit']:hover{background-color:#606c76;border-color:#606c76;color:#fff;outline:0}.button[disabled],button[disabled],input[type='button'][disabled],input[type='reset'][disabled],input[type='submit'][disabled]{cursor:default;opacity:.5}.button[disabled]:focus,.button[disabled]:hover,button[disabled]:focus,button[disabled]:hover,input[type='button'][disabled]:focus,input[type='button'][disabled]:hover,input[type='reset'][disabled]:focus,input[type='reset'][disabled]:hover,input[type='submit'][disabled]:focus,input[type='submit'][disabled]:hover{background-color:#0069d9;border-color:#0069d9}.button.button-outline,button.button-outline,input[type='button'].button-outline,input[type='reset'].button-outline,input[type='submit'].button-outline{background-color:transparent;color:#0069d9}.button.button-outline:focus,.button.button-outline:hover,button.button-outline:focus,button.button-outline:hover,input[type='button'].button-outline:focus,input[type='button'].button-outline:hover,input[type='reset'].button-outline:focus,input[type='reset'].button-outline:hover,input[type='submit'].button-outline:focus,input[type='submit'].button-outline:hover{background-color:transparent;border-color:#606c76;color:#606c76}.button.button-outline[disabled]:focus,.button.button-outline[disabled]:hover,button.button-outline[disabled]:focus,button.button-outline[disabled]:hover,input[type='button'].button-outline[disabled]:focus,input[type='button'].button-outline[disabled]:hover,input[type='reset'].button-outline[disabled]:focus,input[type='reset'].button-outline[disabled]:hover,input[type='submit'].button-outline[disabled]:focus,input[type='submit'].button-outline[disabled]:hover{border-color:inherit;color:#0069d9}.button.button-clear,button.button-clear,input[type='button'].button-clear,input[type='reset'].button-clear,input[type='submit'].button-clear{background-color:transparent;border-color:transparent;color:#0069d9}.button.button-clear:focus,.button.button-clear:hover,button.button-clear:focus,button.button-clear:hover,input[type='button'].button-clear:focus,input[type='button'].button-clear:hover,input[type='reset'].button-clear:focus,input[type='reset'].button-clear:hover,input[type='submit'].button-clear:focus,input[type='submit'].button-clear:hover{background-color:transparent;border-color:transparent;color:#606c76}.button.button-clear[disabled]:focus,.button.button-clear[disabled]:hover,button.button-clear[disabled]:focus,button.button-clear[disabled]:hover,input[type='button'].button-clear[disabled]:focus,input[type='button'].button-clear[disabled]:hover,input[type='reset'].button-clear[disabled]:focus,input[type='reset'].button-clear[disabled]:hover,input[type='submit'].button-clear[disabled]:focus,input[type='submit'].button-clear[disabled]:hover{color:#0069d9}code{background:#f4f5f6;border-radius:.4rem;font-size:86%;margin:0 .2rem;padding:.2rem .5rem;white-space:nowrap}pre{background:#f4f5f6;border-left:0.3rem solid #0069d9;overflow-y:hidden}pre>code{border-radius:0;display:block;padding:1rem 1.5rem;white-space:pre}hr{border:0;border-top:0.1rem solid #f4f5f6;margin:3.0rem 0}input[type='color'],input[type='date'],input[type='datetime'],input[type='datetime-local'],input[type='email'],input[type='month'],input[type='number'],input[type='password'],input[type='search'],input[type='tel'],input[type='text'],input[type='url'],input[type='week'],input:not([type]),textarea,select{-webkit-appearance:none;background-color:transparent;border:0.1rem solid #d1d1d1;border-radius:.4rem;box-shadow:none;box-sizing:inherit;height:3.8rem;padding:.6rem 1.0rem .7rem;width:100%}input[type='color']:focus,input[type='date']:focus,input[type='datetime']:focus,input[type='datetime-local']:focus,input[type='email']:focus,input[type='month']:focus,input[type='number']:focus,input[type='password']:focus,input[type='search']:focus,input[type='tel']:focus,input[type='text']:focus,input[type='url']:focus,input[type='week']:focus,input:not([type]):focus,textarea:focus,select:focus{border-color:#0069d9;outline:0}select{background:url('data:image/svg+xml;utf8,') center right no-repeat;padding-right:3.0rem}select:focus{background-image:url('data:image/svg+xml;utf8,')}select[multiple]{background:none;height:auto}textarea{min-height:6.5rem}label,legend{display:block;font-size:1.6rem;font-weight:700;margin-bottom:.5rem}fieldset{border-width:0;padding:0}input[type='checkbox'],input[type='radio']{display:inline}.label-inline{display:inline-block;font-weight:normal;margin-left:.5rem}.container{margin:0 auto;max-width:112.0rem;padding:0 2.0rem;position:relative;width:100%}.row{display:flex;flex-direction:column;padding:0;width:100%}.row.row-no-padding{padding:0}.row.row-no-padding>.column{padding:0}.row.row-wrap{flex-wrap:wrap}.row.row-top{align-items:flex-start}.row.row-bottom{align-items:flex-end}.row.row-center{align-items:center}.row.row-stretch{align-items:stretch}.row.row-baseline{align-items:baseline}.row .column{display:block;flex:1 1 auto;margin-left:0;max-width:100%;width:100%}.row .column.column-offset-10{margin-left:10%}.row .column.column-offset-20{margin-left:20%}.row .column.column-offset-25{margin-left:25%}.row .column.column-offset-33,.row .column.column-offset-34{margin-left:33.3333%}.row .column.column-offset-40{margin-left:40%}.row .column.column-offset-50{margin-left:50%}.row .column.column-offset-60{margin-left:60%}.row .column.column-offset-66,.row .column.column-offset-67{margin-left:66.6666%}.row .column.column-offset-75{margin-left:75%}.row .column.column-offset-80{margin-left:80%}.row .column.column-offset-90{margin-left:90%}.row .column.column-10{flex:0 0 10%;max-width:10%}.row .column.column-20{flex:0 0 20%;max-width:20%}.row .column.column-25{flex:0 0 25%;max-width:25%}.row .column.column-33,.row .column.column-34{flex:0 0 33.3333%;max-width:33.3333%}.row .column.column-40{flex:0 0 40%;max-width:40%}.row .column.column-50{flex:0 0 50%;max-width:50%}.row .column.column-60{flex:0 0 60%;max-width:60%}.row .column.column-66,.row .column.column-67{flex:0 0 66.6666%;max-width:66.6666%}.row .column.column-75{flex:0 0 75%;max-width:75%}.row .column.column-80{flex:0 0 80%;max-width:80%}.row .column.column-90{flex:0 0 90%;max-width:90%}.row .column .column-top{align-self:flex-start}.row .column .column-bottom{align-self:flex-end}.row .column .column-center{align-self:center}@media (min-width: 40rem){.row{flex-direction:row;margin-left:-1.0rem;width:calc(100% + 2.0rem)}.row .column{margin-bottom:inherit;padding:0 1.0rem}}a{color:#0069d9;text-decoration:none}a:focus,a:hover{color:#606c76}dl,ol,ul{list-style:none;margin-top:0;padding-left:0}dl dl,dl ol,dl ul,ol dl,ol ol,ol ul,ul dl,ul ol,ul ul{font-size:90%;margin:1.5rem 0 1.5rem 3.0rem}ol{list-style:decimal inside}ul{list-style:circle inside}.button,button,dd,dt,li{margin-bottom:1.0rem}fieldset,input,select,textarea{margin-bottom:1.5rem}blockquote,dl,figure,form,ol,p,pre,table,ul{margin-bottom:2.5rem}table{border-spacing:0;display:block;overflow-x:auto;text-align:left;width:100%}td,th{border-bottom:0.1rem solid #e1e1e1;padding:1.2rem 1.5rem}td:first-child,th:first-child{padding-left:0}td:last-child,th:last-child{padding-right:0}@media (min-width: 40rem){table{display:table;overflow-x:initial}}b,strong{font-weight:bold}p{margin-top:0}h1,h2,h3,h4,h5,h6{font-weight:300;letter-spacing:-.1rem;margin-bottom:2.0rem;margin-top:0}h1{font-size:4.6rem;line-height:1.2}h2{font-size:3.6rem;line-height:1.25}h3{font-size:2.8rem;line-height:1.3}h4{font-size:2.2rem;letter-spacing:-.08rem;line-height:1.35}h5{font-size:1.8rem;letter-spacing:-.05rem;line-height:1.5}h6{font-size:1.6rem;letter-spacing:0;line-height:1.4}img{max-width:100%}.clearfix:after{clear:both;content:' ';display:table}.float-left{float:left}.float-right{float:right}
10 |
11 | /* General style */
12 | h1{font-size: 3.6rem; line-height: 1.25}
13 | h2{font-size: 2.8rem; line-height: 1.3}
14 | h3{font-size: 2.2rem; letter-spacing: -.08rem; line-height: 1.35}
15 | h4{font-size: 1.8rem; letter-spacing: -.05rem; line-height: 1.5}
16 | h5{font-size: 1.6rem; letter-spacing: 0; line-height: 1.4}
17 | h6{font-size: 1.4rem; letter-spacing: 0; line-height: 1.2}
18 | pre{padding: 1em;}
19 |
20 | .container{
21 | margin: 0 auto;
22 | max-width: 80.0rem;
23 | padding: 0 2.0rem;
24 | position: relative;
25 | width: 100%
26 | }
27 | select {
28 | width: auto;
29 | }
30 |
31 | /* Phoenix promo and logo */
32 | .phx-hero {
33 | text-align: center;
34 | border-bottom: 1px solid #e3e3e3;
35 | background: #eee;
36 | border-radius: 6px;
37 | padding: 3em 3em 1em;
38 | margin-bottom: 3rem;
39 | font-weight: 200;
40 | font-size: 120%;
41 | }
42 | .phx-hero input {
43 | background: #ffffff;
44 | }
45 | .phx-logo {
46 | min-width: 300px;
47 | margin: 1rem;
48 | display: block;
49 | }
50 | .phx-logo img {
51 | width: auto;
52 | display: block;
53 | }
54 |
55 | /* Headers */
56 | header {
57 | width: 100%;
58 | background: #fdfdfd;
59 | border-bottom: 1px solid #eaeaea;
60 | margin-bottom: 2rem;
61 | }
62 | header section {
63 | align-items: center;
64 | display: flex;
65 | flex-direction: column;
66 | justify-content: space-between;
67 | }
68 | header section :first-child {
69 | order: 2;
70 | }
71 | header section :last-child {
72 | order: 1;
73 | }
74 | header nav ul,
75 | header nav li {
76 | margin: 0;
77 | padding: 0;
78 | display: block;
79 | text-align: right;
80 | white-space: nowrap;
81 | }
82 | header nav ul {
83 | margin: 1rem;
84 | margin-top: 0;
85 | }
86 | header nav a {
87 | display: block;
88 | }
89 |
90 | @media (min-width: 40.0rem) { /* Small devices (landscape phones, 576px and up) */
91 | header section {
92 | flex-direction: row;
93 | }
94 | header nav ul {
95 | margin: 1rem;
96 | }
97 | .phx-logo {
98 | flex-basis: 527px;
99 | margin: 2rem 1rem;
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/mix.lock:
--------------------------------------------------------------------------------
1 | %{
2 | "argon2_elixir": {:hex, :argon2_elixir, "3.0.0", "fd4405f593e77b525a5c667282172dd32772d7c4fa58cdecdaae79d2713b6c5f", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "8b753b270af557d51ba13fcdebc0f0ab27a2a6792df72fd5a6cf9cfaffcedc57"},
3 | "auth_plug": {:hex, :auth_plug, "1.5.0", "fa9f8c022d76cd7ef4cd322f25846698f18a0b6d2435a3ae1cb0e61167199e52", [:mix], [{:envar, "~> 1.0.8", [hex: :envar, repo: "hexpm", optional: false]}, {:httpoison, "~> 1.8.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:joken, "~> 2.5", [hex: :joken, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:useful, "~> 1.0.8", [hex: :useful, repo: "hexpm", optional: false]}], "hexpm", "3481aed63f8bb24081268db6713c931c33b5b3b17d2f53ca7949ff8443c1fbb7"},
4 | "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
5 | "castore": {:hex, :castore, "1.0.14", "4582dd7d630b48cf5e1ca8d3d42494db51e406b7ba704e81fbd401866366896a", [:mix], [], "hexpm", "7bc1b65249d31701393edaaac18ec8398d8974d52c647b7904d01b964137b9f4"},
6 | "cc_precompiler": {:hex, :cc_precompiler, "0.1.11", "8c844d0b9fb98a3edea067f94f616b3f6b29b959b6b3bf25fee94ffe34364768", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "3427232caf0835f94680e5bcf082408a70b48ad68a5f5c0b02a3bea9f3a075b9"},
7 | "certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"},
8 | "comeonin": {:hex, :comeonin, "5.5.0", "364d00df52545c44a139bad919d7eacb55abf39e86565878e17cebb787977368", [:mix], [], "hexpm", "6287fc3ba0aad34883cbe3f7949fc1d1e738e5ccdce77165bc99490aa69f47fb"},
9 | "cowboy": {:hex, :cowboy, "2.14.2", "4008be1df6ade45e4f2a4e9e2d22b36d0b5aba4e20b0a0d7049e28d124e34847", [:make, :rebar3], [{:cowlib, ">= 2.16.0 and < 3.0.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, ">= 1.8.0 and < 3.0.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "569081da046e7b41b5df36aa359be71a0c8874e5b9cff6f747073fc57baf1ab9"},
10 | "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
11 | "cowlib": {:hex, :cowlib, "2.16.0", "54592074ebbbb92ee4746c8a8846e5605052f29309d3a873468d76cdf932076f", [:make, :rebar3], [], "hexpm", "7f478d80d66b747344f0ea7708c187645cfcc08b11aa424632f78e25bf05db51"},
12 | "credo": {:hex, :credo, "1.7.13", "126a0697df6b7b71cd18c81bc92335297839a806b6f62b61d417500d1070ff4e", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "47641e6d2bbff1e241e87695b29f617f1a8f912adea34296fb10ecc3d7e9e84f"},
13 | "db_connection": {:hex, :db_connection, "2.8.1", "9abdc1e68c34c6163f6fb96a96532272d13ad7ca45262156ae8b7ec6d9dc4bec", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a61a3d489b239d76f326e03b98794fb8e45168396c925ef25feb405ed09da8fd"},
14 | "decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"},
15 | "earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"},
16 | "ecto": {:hex, :ecto, "3.13.5", "9d4a69700183f33bf97208294768e561f5c7f1ecf417e0fa1006e4a91713a834", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "df9efebf70cf94142739ba357499661ef5dbb559ef902b68ea1f3c1fabce36de"},
17 | "ecto_sql": {:hex, :ecto_sql, "3.13.2", "a07d2461d84107b3d037097c822ffdd36ed69d1cf7c0f70e12a3d1decf04e2e1", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.13.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "539274ab0ecf1a0078a6a72ef3465629e4d6018a3028095dc90f60a19c371717"},
18 | "elixir_make": {:hex, :elixir_make, "0.9.0", "6484b3cd8c0cee58f09f05ecaf1a140a8c97670671a6a0e7ab4dc326c3109726", [:mix], [], "hexpm", "db23d4fd8b757462ad02f8aa73431a426fe6671c80b200d9710caf3d1dd0ffdb"},
19 | "envar": {:hex, :envar, "1.0.9", "b51976b00035efd254c3f51ee7f3cf2e22f91350ef104da393d1d71286eb4fdc", [:mix], [], "hexpm", "bfc3a73f97910c744e0d9e53722ad2d1f73bbb392d2dd1cac63e0af27776fde3"},
20 | "esbuild": {:hex, :esbuild, "0.10.0", "b0aa3388a1c23e727c5a3e7427c932d89ee791746b0081bbe56103e9ef3d291f", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "468489cda427b974a7cc9f03ace55368a83e1a7be12fba7e30969af78e5f8c70"},
21 | "ex_doc": {:hex, :ex_doc, "0.39.1", "e19d356a1ba1e8f8cfc79ce1c3f83884b6abfcb79329d435d4bbb3e97ccc286e", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "8abf0ed3e3ca87c0847dfc4168ceab5bedfe881692f1b7c45f4a11b232806865"},
22 | "excoveralls": {:hex, :excoveralls, "0.18.5", "e229d0a65982613332ec30f07940038fe451a2e5b29bce2a5022165f0c9b157e", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "523fe8a15603f86d64852aab2abe8ddbd78e68579c8525ae765facc5eae01562"},
23 | "fields": {:hex, :fields, "2.10.3", "2683d8fdfd582869b459c88c693c4e15e2247961869719e03213286764b82093", [:mix], [{:argon2_elixir, "~> 3.0.0", [hex: :argon2_elixir, repo: "hexpm", optional: false]}, {:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:envar, "~> 1.0.8", [hex: :envar, repo: "hexpm", optional: false]}, {:html_sanitize_ex, "~> 1.4.2", [hex: :html_sanitize_ex, repo: "hexpm", optional: false]}], "hexpm", "d68567e175fb6d3be04cdf795fc6ed94973c66706ca3f87e2ec6251159b4b965"},
24 | "file_system": {:hex, :file_system, "1.1.1", "31864f4685b0148f25bd3fbef2b1228457c0c89024ad67f7a81a3ffbc0bbad3a", [:mix], [], "hexpm", "7a15ff97dfe526aeefb090a7a9d3d03aa907e100e262a0f8f7746b78f8f87a5d"},
25 | "fine": {:hex, :fine, "0.1.4", "b19a89c1476c7c57afb5f9314aed5960b5bc95d5277de4cb5ee8e1d1616ce379", [:mix], [], "hexpm", "be3324cc454a42d80951cf6023b9954e9ff27c6daa255483b3e8d608670303f5"},
26 | "floki": {:hex, :floki, "0.38.0", "62b642386fa3f2f90713f6e231da0fa3256e41ef1089f83b6ceac7a3fd3abf33", [:mix], [], "hexpm", "a5943ee91e93fb2d635b612caf5508e36d37548e84928463ef9dd986f0d1abd9"},
27 | "hackney": {:hex, :hackney, "1.20.1", "8d97aec62ddddd757d128bfd1df6c5861093419f8f7a4223823537bad5d064e2", [:rebar3], [{:certifi, "~> 2.12.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"},
28 | "html_sanitize_ex": {:hex, :html_sanitize_ex, "1.4.3", "67b3d9fa8691b727317e0cc96b9b3093be00ee45419ffb221cdeee88e75d1360", [:mix], [{:mochiweb, "~> 2.15 or ~> 3.1", [hex: :mochiweb, repo: "hexpm", optional: false]}], "hexpm", "87748d3c4afe949c7c6eb7150c958c2bcba43fc5b2a02686af30e636b74bccb7"},
29 | "httpoison": {:hex, :httpoison, "1.8.2", "9eb9c63ae289296a544842ef816a85d881d4a31f518a0fec089aaa744beae290", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "2bb350d26972e30c96e2ca74a1aaf8293d61d0742ff17f01e0279fef11599921"},
30 | "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
31 | "image": {:hex, :image, "0.62.1", "1dd3d8d0d29d6562aa2141b5ef08c0f6a60e2a9f843fe475499b2f4f1ef60406", [:mix], [{:bumblebee, "~> 0.6", [hex: :bumblebee, repo: "hexpm", optional: true]}, {:evision, "~> 0.1.33 or ~> 0.2", [hex: :evision, repo: "hexpm", optional: true]}, {:exla, "~> 0.9", [hex: :exla, repo: "hexpm", optional: true]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: true]}, {:kino, "~> 0.13", [hex: :kino, repo: "hexpm", optional: true]}, {:nx, "~> 0.9", [hex: :nx, repo: "hexpm", optional: true]}, {:nx_image, "~> 0.1", [hex: :nx_image, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.1 or ~> 3.2 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:plug, "~> 1.13", [hex: :plug, repo: "hexpm", optional: true]}, {:req, "~> 0.4", [hex: :req, repo: "hexpm", optional: true]}, {:rustler, "> 0.0.0", [hex: :rustler, repo: "hexpm", optional: true]}, {:scholar, "~> 0.3", [hex: :scholar, repo: "hexpm", optional: true]}, {:sweet_xml, "~> 0.7", [hex: :sweet_xml, repo: "hexpm", optional: false]}, {:vix, "~> 0.33", [hex: :vix, repo: "hexpm", optional: false]}], "hexpm", "5a5a7acaf68cfaed8932d478b95152cd7d84071442cac558c59f2d31427e91ab"},
32 | "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
33 | "joken": {:hex, :joken, "2.6.2", "5daaf82259ca603af4f0b065475099ada1b2b849ff140ccd37f4b6828ca6892a", [:mix], [{:jose, "~> 1.11.10", [hex: :jose, repo: "hexpm", optional: false]}], "hexpm", "5134b5b0a6e37494e46dbf9e4dad53808e5e787904b7c73972651b51cce3d72b"},
34 | "jose": {:hex, :jose, "1.11.10", "a903f5227417bd2a08c8a00a0cbcc458118be84480955e8d251297a425723f83", [:mix, :rebar3], [], "hexpm", "0d6cd36ff8ba174db29148fc112b5842186b68a90ce9fc2b3ec3afe76593e614"},
35 | "lazy_html": {:hex, :lazy_html, "0.1.8", "677a8642e644eef8de98f3040e2520d42d0f0f8bd6c5cd49db36504e34dffe91", [:make, :mix], [{:cc_precompiler, "~> 0.1", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.9.0", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:fine, "~> 0.1.0", [hex: :fine, repo: "hexpm", optional: false]}], "hexpm", "0d8167d930b704feb94b41414ca7f5779dff9bca7fcf619fcef18de138f08736"},
36 | "makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
37 | "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
38 | "makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"},
39 | "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
40 | "mime": {:hex, :mime, "2.0.7", "b8d739037be7cd402aee1ba0306edfdef982687ee7e9859bee6198c1e7e2f128", [:mix], [], "hexpm", "6171188e399ee16023ffc5b76ce445eb6d9672e2e241d2df6050f3c771e80ccd"},
41 | "mimerl": {:hex, :mimerl, "1.3.0", "d0cd9fc04b9061f82490f6581e0128379830e78535e017f7780f37fea7545726", [:rebar3], [], "hexpm", "a1e15a50d1887217de95f0b9b0793e32853f7c258a5cd227650889b38839fe9d"},
42 | "mochiweb": {:hex, :mochiweb, "3.2.2", "bb435384b3b9fd1f92f2f3fe652ea644432877a3e8a81ed6459ce951e0482ad3", [:rebar3], [], "hexpm", "4114e51f1b44c270b3242d91294fe174ce1ed989100e8b65a1fab58e0cba41d5"},
43 | "nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"},
44 | "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"},
45 | "phoenix": {:hex, :phoenix, "1.8.1", "865473a60a979551a4879db79fbfb4503e41cd809e77c85af79716578b6a456d", [:mix], [{:bandit, "~> 1.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "84d77d2b2e77c3c7e7527099bd01ef5c8560cd149c036d6b3a40745f11cd2fb2"},
46 | "phoenix_ecto": {:hex, :phoenix_ecto, "4.7.0", "75c4b9dfb3efdc42aec2bd5f8bccd978aca0651dbcbc7a3f362ea5d9d43153c6", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.1", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "1d75011e4254cb4ddf823e81823a9629559a1be93b4321a6a5f11a5306fbf4cc"},
47 | "phoenix_html": {:hex, :phoenix_html, "4.3.0", "d3577a5df4b6954cd7890c84d955c470b5310bb49647f0a114a6eeecc850f7ad", [:mix], [], "hexpm", "3eaa290a78bab0f075f791a46a981bbe769d94bc776869f4f3063a14f30497ad"},
48 | "phoenix_html_helpers": {:hex, :phoenix_html_helpers, "1.0.1", "7eed85c52eff80a179391036931791ee5d2f713d76a81d0d2c6ebafe1e11e5ec", [:mix], [{:phoenix_html, "~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "cffd2385d1fa4f78b04432df69ab8da63dc5cf63e07b713a4dcf36a3740e3090"},
49 | "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.6.1", "05df733a09887a005ed0d69a7fc619d376aea2730bf64ce52ac51ce716cc1ef0", [:mix], [{:file_system, "~> 0.2.10 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "74273843d5a6e4fef0bbc17599f33e3ec63f08e69215623a0cd91eea4288e5a0"},
50 | "phoenix_live_view": {:hex, :phoenix_live_view, "1.1.17", "1d782b5901cf13b137c6d8c56542ff6cb618359b2adca7e185b21df728fa0c6c", [:mix], [{:igniter, ">= 0.6.16 and < 1.0.0-0", [hex: :igniter, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:lazy_html, "~> 0.1.0", [hex: :lazy_html, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0 or ~> 1.8.0-rc", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "fa82307dd9305657a8236d6b48e60ef2e8d9f742ee7ed832de4b8bcb7e0e5ed2"},
51 | "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.2.0", "ff3a5616e1bed6804de7773b92cbccfc0b0f473faf1f63d7daf1206c7aeaaa6f", [:mix], [], "hexpm", "adc313a5bf7136039f63cfd9668fde73bba0765e0614cba80c06ac9460ff3e96"},
52 | "phoenix_template": {:hex, :phoenix_template, "1.0.4", "e2092c132f3b5e5b2d49c96695342eb36d0ed514c5b252a77048d5969330d639", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "2c0c81f0e5c6753faf5cca2f229c9709919aba34fab866d3bc05060c9c444206"},
53 | "phoenix_view": {:hex, :phoenix_view, "2.0.4", "b45c9d9cf15b3a1af5fb555c674b525391b6a1fe975f040fb4d913397b31abf4", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "4e992022ce14f31fe57335db27a28154afcc94e9983266835bb3040243eb620b"},
54 | "plug": {:hex, :plug, "1.18.1", "5067f26f7745b7e31bc3368bc1a2b818b9779faa959b49c934c17730efc911cf", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "57a57db70df2b422b564437d2d33cf8d33cd16339c1edb190cd11b1a3a546cc2"},
55 | "plug_cowboy": {:hex, :plug_cowboy, "2.7.4", "729c752d17cf364e2b8da5bdb34fb5804f56251e88bb602aff48ae0bd8673d11", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "9b85632bd7012615bae0a5d70084deb1b25d2bcbb32cab82d1e9a1e023168aa3"},
56 | "plug_crypto": {:hex, :plug_crypto, "2.1.1", "19bda8184399cb24afa10be734f84a16ea0a2bc65054e23a62bb10f06bc89491", [:mix], [], "hexpm", "6470bce6ffe41c8bd497612ffde1a7e4af67f36a15eea5f921af71cf3e11247c"},
57 | "poison": {:hex, :poison, "6.0.0", "9bbe86722355e36ffb62c51a552719534257ba53f3271dacd20fbbd6621a583a", [:mix], [{:decimal, "~> 2.1", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "bb9064632b94775a3964642d6a78281c07b7be1319e0016e1643790704e739a2"},
58 | "postgrex": {:hex, :postgrex, "0.21.1", "2c5cc830ec11e7a0067dd4d623c049b3ef807e9507a424985b8dcf921224cd88", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "27d8d21c103c3cc68851b533ff99eef353e6a0ff98dc444ea751de43eb48bdac"},
59 | "pre_commit": {:hex, :pre_commit, "0.3.4", "e2850f80be8090d50ad8019ef2426039307ff5dfbe70c736ad0d4d401facf304", [:mix], [], "hexpm", "16f684ba4f1fed1cba6b19e082b0f8d696e6f1c679285fedf442296617ba5f4e"},
60 | "ranch": {:hex, :ranch, "2.2.0", "25528f82bc8d7c6152c57666ca99ec716510fe0925cb188172f41ce93117b1b0", [:make, :rebar3], [], "hexpm", "fa0b99a1780c80218a4197a59ea8d3bdae32fbff7e88527d7d8a4787eff4f8e7"},
61 | "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
62 | "sweet_xml": {:hex, :sweet_xml, "0.7.5", "803a563113981aaac202a1dbd39771562d0ad31004ddbfc9b5090bdcd5605277", [:mix], [], "hexpm", "193b28a9b12891cae351d81a0cead165ffe67df1b73fe5866d10629f4faefb12"},
63 | "tailwind": {:hex, :tailwind, "0.4.1", "e7bcc222fe96a1e55f948e76d13dd84a1a7653fb051d2a167135db3b4b08d3e9", [:mix], [], "hexpm", "6249d4f9819052911120dbdbe9e532e6bd64ea23476056adb7f730aa25c220d1"},
64 | "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
65 | "telemetry_metrics": {:hex, :telemetry_metrics, "1.1.0", "5bd5f3b5637e0abea0426b947e3ce5dd304f8b3bc6617039e2b5a008adc02f8f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "e7b79e8ddfde70adb6db8a6623d1778ec66401f366e9a8f5dd0955c56bc8ce67"},
66 | "telemetry_poller": {:hex, :telemetry_poller, "1.3.0", "d5c46420126b5ac2d72bc6580fb4f537d35e851cc0f8dbd571acf6d6e10f5ec7", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "51f18bed7128544a50f75897db9974436ea9bfba560420b646af27a9a9b35211"},
67 | "tentacat": {:hex, :tentacat, "2.2.0", "ed2f137c3f64a787cd278ccb1ddbb9e5b696c9c09e3c89d559fffa64ad1494b8", [:mix], [{:httpoison, "~> 1.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "b4ca367af4769774c7dd24a53738f20603012c03715be6c23d8e22c220ee8c07"},
68 | "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
69 | "useful": {:hex, :useful, "1.15.0", "3c967dd3013d710538f37ec9ae5d074a4ee19add367172e0dff22c0f72ea30bd", [:mix], [{:plug, "~> 1.16", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "900180dc839831fa82717ee25ae3d912656095a58fb8a4bed8975495516b8dd0"},
70 | "vix": {:hex, :vix, "0.35.0", "f6319b715e3b072e53eba456a21af5f2ff010a7a7b19b884600ea98a0609b18c", [:make, :mix], [{:cc_precompiler, "~> 0.1.4 or ~> 0.2", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.7.3 or ~> 0.8", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:kino, "~> 0.7", [hex: :kino, repo: "hexpm", optional: true]}], "hexpm", "a3e80067a89d0631b6cf2b93594e03c1b303a2c7cddbbdd28040750d521984e5"},
71 | "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
72 | "websock_adapter": {:hex, :websock_adapter, "0.5.9", "43dc3ba6d89ef5dec5b1d0a39698436a1e856d000d84bf31a3149862b01a287f", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "5534d5c9adad3c18a0f58a9371220d75a803bf0b9a3d87e6fe072faaeed76a08"},
73 | }
74 |
--------------------------------------------------------------------------------