GithubHelp home page GithubHelp logo

nsidnev / edgebeats Goto Github PK

View Code? Open in Web Editor NEW
21.0 4.0 2.0 545 KB

LiveBeats + EdgeDB

Home Page: https://edgebeats.fly.dev/

License: MIT License

Elixir 84.91% Dockerfile 1.00% Shell 0.05% Batchfile 0.03% CSS 4.94% JavaScript 4.17% HTML 4.89%
edgedb phoenix elixir example

edgebeats's Introduction

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

edgebeats's People

Contributors

adamwiggall avatar bemesa21 avatar chrismccord avatar colinstark avatar dsdshcym avatar freedomben avatar fzn0x avatar gazler avatar leejarvis avatar mcrumm avatar mrkurt avatar ndarilek avatar nsidnev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

asloan7 mazz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.