Home

Awesome

Phoenix Ash Tailwind Svelte Yjs Flowbite Skeleton TipTap Milkdown Mermaid Mash-Up

<img alt='Phoenix' src="https://seeklogo.com/images/P/phoenix-logo-D15F067911-seeklogo.com.png" height=40 width=45><img alt='ash' align="top" src="https://ash-hq.org/images/ash-logo-side.svg" height=50 width=100><img alt='Tailwind CSS' src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Tailwind_CSS_Logo.svg/1200px-Tailwind_CSS_Logo.svg.png" height=45 width=45><img alt='Flowbite' src="https://flowbite.com/docs/images/logo.svg" height=45 width=45><img alt='Svelte' src="https://upload.wikimedia.org/wikipedia/commons/1/1b/Svelte_Logo.svg" height=45 width=45><img alt='Yjs' height=45 width=45 src="https://yjs.dev/images/logo/yjs.svg"><img alt='Skeleton' height=45 width=45 src="https://pbs.twimg.com/profile_images/1587479781544759297/TINbbJLC_400x400.png"><img height=45 width=45 alt="TipTap" src="https://camo.githubusercontent.com/a1e57801dcd479596fc7fac670540acda3edc1b07d1820ec4315361eba95f310/68747470733a2f2f756e6176617461722e696f2f6769746875622f7565626572646f736973"><img height=45 width=45 alt="Milkdown" src="https://milkdown.dev/milkdown-logo.svg"><img height=45 width=45 alt="Mermaid" src="https://www.mermaidchart.com/img/icon-logo.svg">

Previous Versions

Video

May 26 2023

Introduction

This is a web browser application demonstrating:

License

MIT

Help and additional information

Join the Ash Discord Server and check out the Pyro channel.

Requirements

Postgres

Install Postgres

nvm

Elixir

Restart your terminal after installing Elixir.

Installing stable Elixir on MacOS

Installing bleeding-edge Elixir on MacOS with asdf

This might work better with VSCode language servers for Elixir. Or it might not work at all.

This currently fails to build erlang-ssl-fun.

brew install autoconf wxwidgets libxslt fop openssl@1.1 asdf
# I use zsh. Change the following line to >> ~/.bashrc if you use bash.
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
# Restart your terminal
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
# To install more docs, add the following at the beginning:
# KERL_INSTALL_MANPAGES=yes KERL_INSTALL_HTMLDOCS=yes
KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac --with-ssl=$(brew --prefix openssl@1.1)" KERL_BUILD_DOCS=yes asdf install erlang 26.0.1
asdf global erlang 26.0.1
asdf plugin add elixir
asdf install elixir 1.15.0
asdf global elixir 1.15.0

Rust (for Rustler) - not yet needed

See https://www.rust-lang.org/tools/install

Visual Studio Code Configuration

Tailwind CSS Intellisence

vscode-tailwindcss

  "tailwindCSS.experimental.configFile": "./assets/tailwind.config.js"

Usage

git clone https://github.com/dev-guy/phoenix-ash-svelte-flowbite.git
cd phoenix-ash-svelte-flowbite
nvm install
npm install -g @pnpm/exe
mix local.hex
mix local.rebar
mix tailwind.install
mix setup
# Register the version of esbuild installed by pnpm
mix esbuild.install
mix phx.server

Open a browser to http://localhost:4000

Notes

    "live_svelte": "file:../deps/live_svelte",
    "pyro": "file:../deps/pyro",
    "phoenix": "file:../deps/phoenix",
    "phoenix_html": "file:../deps/phoenix_html",
    "phoenix_live_view": "file:../deps/phoenix_live_view"

References

Guides

  1. Install Phoenix
  2. Install Ash Authentication
  3. Install Pyro
  4. Install Flowbite for Phoenix
  5. Install LiveSvelte
  6. Install Svelte Skeleton
  1. Install Tailwind Scrollbar Hide Plugin
  2. LiveView feels faster with a delayed loading indicator

Upgrading npm packages

  1. esbuild: modify config.exs
  2. tailwindcss: modify config.exs
  3. node (see .nvmrc): build.js (see target:)

Other

Milkdown Collaborative Editing

Tabbed collaboration works out of the box. Cross-browser collaboration requires running a WebRTC server:

nvm i
cd assets
PORT=4444 npx y-webrtc server.js

TODO

  1. Sync styles between Svelte and Pyro components - details

Credits

  1. Prosemirror-adapter Svelte Example