ykostov

ykostov

E-commerce in Elixir - pros and cons (vs Rails)

Hello devs!
I’m starting these day coding my own e-commerce platform, and so I have a few questions…
First of all, except the live-view, do Elixir have more pros (or cons)? The site will be used by approximate 5K per month (not sure at all) users, so is it good for this subject. As I have better knowledge in Rails, which lang is better for you? Are there any free open-sources in Phoenix (like Solidus and Spree in Rails)? Please, share your thoughts, I’d glad to view different opinions…

Best Regards,
YKostov

Marked As Solved

joselo

joselo

In an old reply I mentioned that I’m building a kind of shopify clone for my country, well… after some months working this is the result. the work is still in progress, so the answer is yes, you can build a e-comerce app in phoenix elixir :sunglasses:

My mix.exs updated

      {:phoenix, "~> 1.5.12"},
      {:phoenix_ecto, "~> 4.4.0"},
      {:ecto_sql, "~> 3.7.0"},
      {:postgrex, ">= 0.15.10"},
      # Needs to be updated to 3.0.0 but there are still conflicts with live_view
      {:phoenix_html, "~> 3.0.3"},
      {:phoenix_live_reload, "~> 1.3.3", only: :dev},
      {:telemetry_metrics, "~> 0.6.1"},
      {:telemetry_poller, "~> 0.4"},
      {:gettext, "~> 0.11"},
      {:jason, "~> 1.2.2"},
      {:plug_cowboy, "~> 2.5.1"},
      {:bcrypt_elixir, "~> 2.3.0"},
      {:ex_machina, "~> 2.7.0", only: :test},
      {:wallaby, "~> 0.28.1", runtime: false, only: :test},
      {:credo, "~> 1.5.6", only: [:dev, :test], runtime: false},
      {:git_hooks, "~> 0.6.3", only: [:test, :dev], runtime: false},
      {:phoenix_live_view, "~> 0.16.3"},
      {:floki, ">= 0.31.0"},
      {:cachex, "~> 3.4.0"},
      {:money, github: "elixirmoney/money", branch: "master"},
      {:liquex, "~> 0.6.1"},
      {:puid, "~> 1.0"},
      {:ecto_enum, "~> 1.4"},
      {:attrition, "~> 0.1.0"},
      {:poison, "~> 5.0.0"},
      {:struct_access, "~> 1.1"},
      {:bamboo, "~> 2.2.0"},
      {:bamboo_phoenix, "~> 1.0"},
      {:bamboo_ses, "~> 0.2.0"},
      {:timex, "~> 3.7.6"},
      {:oban, "~> 2.8.0"},
      {:mimic, "~> 1.5.0", only: :test},
      {:excoveralls, "~> 0.14.2", only: :test},
      {:httpoison, "~> 1.8"},
      {:slugify, "~> 1.3"},
      {:pdf, "~> 0.5.0"},
      {:elixir_xml_to_map, "~> 2.0"},
      {:barlix, "~> 0.6.1"},
      {:xml_builder, "~> 2.2"},
      {:mox, "~> 1.0", only: :test},
      {:premailex, "~> 0.3.13"},
      {:geocoder, "~> 1.1.3"}

Also Liked

olivermt

olivermt

I started as a CTO for www.amoi.no (and www.amoi.se) last wednesday and we’re an eCommerce using Elixir and liveview with sprinkles of Surface.

We’re pivoting to be a bit more api heavy, so most likely we will leave liveview out of it, but liveview was a great enabler to get the product off the ground quickly with a small and super senior / great team.

Not «eCommerce» in the traditional sense, as amoi is city-as-a-warehouse (for now) similar to what gojek etc do in asia, but we do logistics, payments and all that jazz.

dimitarvp

dimitarvp

LiveView is VERY FAR from being the biggest positive trait of Elixir.

Have you read on the OTP? The guarantees of a process being restarted if it crashes, for example?

joselo

joselo

Hi I come from Rails and I’m building a kind of Shoppify clone with some custom things for my country, I’m convinced that Phoenix/Elixir was the right choice, It has every thing to create a E-Commerce site. I even had to create a electronic invoice using a P12 Certificate and I was able to do using erlang libraries (from elixir), Phoenix is amazing and with liveview complex interfaces was easy to do. An E-Commerce platform is a big thing you have orders, customers, inventories, shipping, etc. there are many things, but I feel that Phoenix/Liveview help a lot.

if it can help this is my current mix.ex

  defp deps do
    [
      {:phoenix, "~> 1.5.8"},
      {:phoenix_ecto, "~> 4.2.1"},
      {:ecto_sql, "~> 3.5.4"},
      {:postgrex, ">= 0.15.8"},
      {:phoenix_html, "~> 2.14.3"},
      {:phoenix_live_reload, "~> 1.3.0", only: :dev},
      {:phoenix_live_dashboard, "~> 0.4.0"},
      {:telemetry_metrics, "~> 0.6.0"},
      {:telemetry_poller, "~> 0.4"},
      {:gettext, "~> 0.11"},
      {:jason, "~> 1.2.2"},
      {:plug_cowboy, "~> 2.4.1"},
      {:bcrypt_elixir, "~> 2.3.0"},
      {:ex_machina, "~> 2.7.0", only: :test},
      {:wallaby, "~> 0.28.0", runtime: false, only: :test},
      {:credo, "~> 1.5.5", only: [:dev, :test], runtime: false},
      {:git_hooks, "~> 0.5.2", only: [:test, :dev], runtime: false},
      {:phoenix_live_view, "~> 0.15.4"},
      {:floki, ">= 0.30.0", only: :test},
      {:cachex, "~> 3.3"},
      {:money, "~> 1.8.0"},
      {:liquex, "~> 0.5.0"},
      {:puid, "~> 1.0"},
      {:ecto_enum, "~> 1.4"},
      {:attrition, "~> 0.1.0"},
      {:poison, "~> 4.0"},
      {:geocoder, "~> 1.1.0"},
      {:countries, "~> 1.5"},
      {:mox, "~> 1.0", only: :test},
      {:struct_access, "~> 1.1"},
      {:bamboo, "~> 2.0.1"},
      {:bamboo_phoenix, "~> 1.0"},
      {:bamboo_ses, "~> 0.2.0"},
      {:grpc, "~> 0.3.1"},
      {:cowlib, "~> 2.8.1", hex: :grpc_cowlib, override: true},
      {:timex, "~> 3.7.3"},
      {:oban, "~> 2.5"},
      {:mimic, "~> 1.4", only: :test},
      {:excoveralls, "~> 0.14", only: :test},
      {:httpoison, "~> 1.8"}
    ]
  end

One of my favorite lib is liquex Liquex — liquex v0.5.0 you can use liquid lang for your templates.

Regards!

Exadra37

Exadra37

Not really. The Elixir community is well known to be upfront to tell when Elixir is not a good fit, and we have examples of that in this forum :slight_smile:

I am not aware of Spree, but Elixir already have some e-commerce stuff, and can be found on this forum:

Or this book by @shankardevy to build an e-commerce store form scratch:

Sebb

Sebb

Elixir/Phoenix is very good in building complex software systems.
See the talks of Sasa Juric (“Solid Ground”, “The Soul of Erlang and Elixir”) - these are a must see when you are looking into Elixir.
Or this talk, where Rich Hickey (creator of closure) tries to not promote Erlang (but does) https://www.youtube.com/watch?v=ROor6_NGIWU
When I look at https://spreecommerce.org/features/ - this is surely a complex software system.

On the other hand you’ll maybe want to communicate with 3rd parties (eg payment) or want to reuse sth for the CMS and so on. You’ll find more in Rails world for those.

But obviously you are doing this for fun, I’m sure you’ll have more of that using Elixir than Ruby.

Where Next?

Popular in Questions Top

yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New

Other popular topics Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New

We're in Beta

About us Mission Statement