LiveBeats + EdgeDB
Find a file
2023-06-22 19:43:08 -04:00
.github/workflows fix songs order configuration (#5) 2023-06-15 22:55:53 -04:00
assets Checkpoint 2023-06-12 09:55:20 -04:00
config fix songs order configuration (#5) 2023-06-15 22:55:53 -04:00
lib fix songs order configuration (#5) 2023-06-15 22:55:53 -04:00
priv fix songs order configuration (#5) 2023-06-15 22:55:53 -04:00
rel replace PostgreSQL with EdgeDB 2022-05-22 12:22:55 +03:00
test prepare for run on EdgeDB Cloud 2023-06-12 12:45:36 -04:00
.credo.exs replace PostgreSQL with EdgeDB 2022-05-22 12:22:55 +03:00
.dockerignore Add latest phx.gen.docker files 2021-12-03 08:54:28 -05:00
.formatter.exs Add heex formatter 2022-03-18 11:13:29 -04:00
.gitignore Test basic uploads 2021-12-14 15:19:03 -05:00
Dockerfile prepare for run on EdgeDB Cloud 2023-06-12 12:45:36 -04:00
edgedb.toml fix songs order configuration (#5) 2023-06-15 22:55:53 -04:00
fly.toml prepare for run on EdgeDB Cloud 2023-06-12 12:45:36 -04:00
LICENSE.md Add license 2022-02-02 08:26:25 -05:00
mix.exs update EdgeDB client to 0.6.0 (#6) 2023-06-22 19:43:08 -04:00
mix.lock update EdgeDB client to 0.6.0 (#6) 2023-06-22 19:43:08 -04:00
README.md prepare for run on EdgeDB Cloud 2023-06-12 12:45:36 -04:00

LiveBeats with EdgeDB

Play music together with Phoenix LiveView!

Visit edgebeats.fly.dev to try it out, or run locally:

  • Create a Github OAuth app from this page

    • Set the app homepage to http://localhost:4000 and Authorization callback URL to http://localhost:4000/oauth/callbacks/github
    • After completing the form, click "Generate a new client secret" to obtain your API secret
  • Export your GitHub Client ID and secret:

    export LIVE_BEATS_GITHUB_CLIENT_ID="..."
    export LIVE_BEATS_GITHUB_CLIENT_SECRET="..."
    
  • Install dependencies with mix deps.get

  • Create and migrate your database with mix ecto.setup

  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Changes compared to the original LiveBeats implementation

The main change is replacing PostgreSQL with EdgeDB. What does this mean?

  1. Ecto is preserved, although changes have been made to get rid of the use of Ecto.Repo and Ecto.Query, since the EdgeDB driver has no adapter for Ecto. At least for now ;)
  2. Postgrex has been replaced by EdgeDB (wow, thanks, cap). Although Postgrex itself was retained as an application dependency in order to implement the support of EctoNetwork.INET through Postgrex.INET.
  3. Most of the other usual Ecto stuff (Ecto.Schema, Ecto.Changeset, Ecto.Multi) is mostly as it is, but some changes have been made to be able to run this application without an adapter.
  4. Queries are written using pure EdgeQL instead of Ecto DSL for Elixir and stored in priv/edgedb/edgeql/<domain>/<query_name>.edgeql files.
  5. There is no longer LiveBeats.ReplicaRepo. It was removed to simplify refactoring, although it can be restored later.
  6. The database schema has been migrated to EdgeQL SDL mostly unchanged, except for the new syntax. This includes database migrations, which are now managed through EdgeDB CLI instead of Ecto.
  7. To support encoding/decoding of Ecto.Enum and EctoNetwork.INET instances, custom codecs were implemented for EdgeDB.

Note: Although the tests pass, no additional tests were added, and the original cases did not cover the entire project. In addition, the EdgeDB driver itself is quite young and has not been tested in real applications. ecause of all this, various bugs can (and probably do) exist in the application. If you face them, open the issue in the repository or, if you like, create a PR with a fix. Any type of contribution is welcome!

Learn more