DiodonHystrix

DiodonHystrix

Hey I come from Ruby world and I would say that there are some well-known gems like Devise, ActiveModelSerializer, Sidekiq, etc, that most of Rails projects are using. What I mean is that when I need to solve A I can just reach for some well known well-used gem A.

And how does it look like in Phoenix? From what I see a lot of packages are not actively maintained and many lack support for Phoenix 1.4, which shouldn’t be a big deal if a package is Phoenix oriented. I spend a lot of time looking for a correct package and many times I am disappointed.

What are your thoughts? I would like to build Saas serverside rendered, need a login, some permissions probably, background jobs, maybe some statistics, activities feed…

Does anyone feel similar? Or do you just build everything yourself? Maybe you miss something from other ecosystems?

I asked this on reddit, but I haven’t received any meaningful answer, so maybe here I will have better luck.
Just please don’t tell me not to use many packages, because they are bad or wrong. I understand that point of view, but I don’t have a team of 10 people to implement every necessary feature, it’s just me.

Showing Posts 1 to 5

hauleth

hauleth

Short answer: if you can implement such feature on your own in reasonable time, then do not use library.

My choices:

  • authentication
    • If you can, use outside provider like OAuth from Google/FB/Twitter/etc. This will save you a lot pain in user management
    • If you cannot use the above, then implement it on your own using Comeonin with bcrypt or Argon2 (I would use that order, but some people may disagree)
  • Authorisation (permissions) - I would use functions, you know, that thing where you pass 2 arguments (user and resource) and return true or false. Nothing fancy needed, especially as pattern matching will do 99% of the work.
  • Background jobs - for simple things - GenServer, for more complicated things - GenServer + DB queue
  • Statistics (if you mean in app stats) - SQL queries
  • Metrics - there I would 100% go with a library, just go and pick something (my personal choice is OpenCensus but I am biased here)
DiodonHystrix

DiodonHystrix OP

Hey, thanks a lot. I am curious, what do you mean by GenServe + DB? Do you have any example?

mbuhot

mbuhot

There are a few packages that implement job queues over a DB table.

EctoJob is one I maintain that is little more than GenStage producer and ConsumerSupervisor triggered by Postgrex.Notifications.

Elixir makes building these things really simple and fun :slight_smile:

sanswork

sanswork

The packages I use most often across all my projects are(in no order):

comeonin
httpoison
money
timex
bamboo
distillery
absinthe + related
geo_postgis

For auth if its b2c I’ll reach for uberauth and social logins but generally I prefer just a self rolled auth system using comeonin permissions self rolled too. I never really liked working with stuff like cancan.

Background jobs I just use separate processes or genservers.

danschultzer

danschultzer

Pow Core Team

I felt similarly when I first started out with Phoenix. It seems a lot of the earlier elixir libraries are ports from popular ruby libraries, made by developers who just started out with elixir. It’s constantly improving though, and there are some great libraries for what you need.

For background jobs, I really like honeydew. We’re planning to use it in production soon. For user authentication, I’ve written Pow and currently run it in two production apps. For permissions you should build it yourself, it’s super simple with a plug module.

I don’t like to waste too much time with my (tiny) team on things that isn’t essential to our business, so I get where you are coming from. It took some time to switch from rails mindset to phoenix/elixir, but it was definitely worth it for us. Our development is running much smoother now, and after learning the a-z with our first app, it has been an incredibly easy process to build new apps, and we haven’t felt much was lacking in the ecosystem.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews