What Elixir related stuff are you doing?

I’m going to serialise lightweight creator apps in Elixir! My first example app is Pillars — Modern Divination

Learn more from my Substack:

Just saw you posted Fluxon UI on r/elixir. Very cool, pimp it here on the forum, too.

1 Like

Writing a user recommendation system, it combines three different models, one which uses Nx.

1 Like

My Elixir/Erlang related thing is making it possible to run Elixir code in browser compiled to WASM module. It’s more of a compiler and a small runtime than a real BEAM implementation.

With WASM-FX, which is not yet part of the standard, you can have lightweight threads and actor model implemented natively.

2 Likes

I’m finally back on the forum, after a couple years of giving up on ever doing anything “real” with Elixir. So to catch up:

  • Spoke at Code BEAM Europe again, this time on my definition of software quality and how to achieve it.

  • Finally put up an MVP of a SaaS to look for changes in other web pages, at https://www.wwwizzzard.com/.

  • As part of that, created and have just updated a Hex package called diffie – no, it’s nothing to do with key exchanges, it takes the list of differences from List.myers_difference and turns it into something more human-readable, like the output of a command-line diff tool.

5 Likes

I’m doing some Advent Of Code warmup before this Sunday! :muscle:
I never completed 2017, so here I am :christmas_tree:

1 Like

Nice! I don’t know why, but Advent of Code 2017 day 3 was one of the hardest for me that year. I recently did my warm up and had trouble solving that one again.

1 Like

I have now reached day 17, but day 3 was the one I struggled the most with!

I didn’t want to brute-force part1 because I was certain it wouldn’t work for part2, so I tried clever math tricks … :exploding_head: Eventually brute-forcing was the way to go :sweat_smile:

looking to redo this [Solar Monitor] (https://paperless-lab.ngrok.io/) in Live view
I have been studying both liveview content from Sign in · Arrowsmith Labs and The Pragmatic Studio.

Making the jump from Vue.js + Ellie + UnoCSS to Liveview is not as easy as the books make it look.

The mental models are painfully different.
Would need to re-think and re-architect everything from scratch.

what would you advise to help me in this transition?

1 Like

Not entirely sure what is your specific difficulty, however migrating from vue to liveview should be pretty painless. You copy the same templates/components change the templates format to accommodate phoenix and rewrite all JS logic. It might become hairy if you have UI stuff that requires JS logic to run (for example maplibre).

The main advice I would give is to avoid using hooks and client-side state if you can help it. You might be tempted to use client-side logic wherever possible, because you might think that things like latency is very important, however you will pay a huge price of development time and complexity, at some point it might become unclear if you have any real benefits from using liveview compared to a classical 2 stack web app.

2 Likes

this difference in development mindset is the main difficulty I’m dealing with.

all data exchange presently uses Server-sent-events and Xhr.

Ripping all that out would require a total re-write, and like you commented, i need to think from the LiveView sever-first point of view.

That change from client-first to server-first viewpoint / orientation is a big jump

1 Like

I won an Elixir give away, so I’m diving into Programming Liveview which will soon be updated now that Liveview officially has a version 1 release.

Also giving ML on the side, still trying to get the hang of Axon.

Happy holidays to everyone!

3 Likes

This is question

to comply with the bonus entry requirement of
" Condition : Tell us what Elixir-related stuff you’ve been doing recently in this thread"

How recent should your last entry be?

Building a chat app with Elixir/Phoenix. Learning the ropes. Breaking my head with Ecto mostly for now. :sweat_smile:

just learning phoenix framework right now!

2 Likes

Launched my side-project: Newsmaker AI

Please check it out. Don’t break it, LOL.

If you want to keep up with news on social media like Twitter, but don’t want to constantly check for new posts - Newsmaker AI will do it for you. It will also summarize the content like a blog post and send it to you by email at the frequency you specify.

The stack is: Phoenix, LiveView, SQLite Postgres, Raspberry Pi, Kamal, CapRover.

That was a fun process.

Some things that I remember

  • I wanted to try out self-hosting and Kamal for deployments. Ordered a Raspberry Pi with a NVMe drive. Set it up, hooked it up to my router and started playing with deployments. Raspberry Pi is also a very useful thing even without the hosting part. I installed AdGuardHome on it and now it blocks ads for all devices in the network.

This is where the site is hosted:

  • Turned out - Kamal didn’t really work for me, because of how my Pi is exposed to the internet. I tunnel traffic with Couldflare straight to the Pi and the container, so that I don’t need to worry about dynamic ips and also Cloudflare has some nice security features. Ended up with Caprover, it works quite nicely and also has a 1-click install thingy for Cloudflare. Really happy with this setup. Only downside is - when I deploy, the container is changed and it takes some seconds for Cloudflare to pick up the change. Users see a 500 in the meantime. Not great, but not terrible either. I moved all my projects to CapRover.

  • I initially started with SQLite, because I wanted to try it. Turns out - SQLite is a really great DB. I ended up contributing to ecto_sqlite and exqlite to make it work even nicer with Phoenix. [1] [2] Also learned that Oban works very well, but Oban Web doesn’t work with SQLite (also I can’t afford it for a side-project). Created Obanalyze to have a dashboard.

  • While SQLite is nice - I did run into some Database busy errors recently. With SQLite you can have 1 writer at a time. busy_timeout helps, but I figured that it will only get worse with more users, so I jumped ship a couple of days ago and moved to Postgres. It was interesting to migrate the data, because I already had some users at this time, and I didn’t want to email them and ask to register again, because I moved to new DB :smile: There are some tools to move data from SQLite to Postgres, like pgloader, but it didn’t work out of the box for me, so I wrote my own Elixir script that loaded data with Exqlite, converted it a bit and wrote to Postgres. Found out that when inserting data with my own IDs (I wanted to have IDs 1:1 like in SQLite), I needed to reset sequences in every table, because it doesn’t happen automatically (IMO, would be nice).

  • Building the UI was also a nice challenge. I think I tried all available component libraries for LiveView and ended up buying Fluxon UI. It is really polished and I really liked that the components have the same look and feel. @andrielfn is also very supportive and fixes any issues very fast.

What’s next?

  • Going to add Bluesky support next and some other sources. Maybe Reddit, HN and something else.
  • Dedicate more time to experimenting with different prompts. It kinda works right now, but maybe could be improved.
  • Think of a better algorithm to pick content before feeding it to AI. For example: if I follow the #MyElixirStatus hashtag and pick weekly news - the amount of tweets in a week can be quite large (200-300). That’s probably already a big amount of data and if done at scale - my OpenAI bill will be significant. But how to reduce the dataset without losing the quality… :thinking: Things like this.
10 Likes

Thanks for sharing, it was an enjoyable read. Just to point out: those two links are identical.

1 Like

Thanks. Fixed

1 Like

Building my side-project: livecheck.io

LiveView all the way for the dashboards, and Elixir for everything else (task scheduling, data ingestion, APIs). LiveView’s been great for fast prototyping so far, and with maturing ecosystem (Oban, Backpex etc.) it’s a great combo for SaaS development.

4 Likes

Building backend for a chat app. Trying to understand Elixir, it doesnt come easy for sure. :sweat_smile:

1 Like