tyro

tyro

Sceopa - an open source blogging platform

Hello!

I’ve created Sceopa, a free, open source blogging platform in Phoenix/Elixir. It allows anyone to sign up and create new blog posts in seconds. My aims are:

  • fast and responsive on all devices (my phone is super slow :weary:)
  • to allow quick creation of technical blog posts (markdown/syntax highlighting are supported)
  • minimal design (distraction-free articles)
  • clear and simple code
  • to learn from your feedback!

Sceopa is now live here.

The source code can be found on GitLab here.

I’m still quite new to Phoenix/Elixir so any feedback/tips/suggestions would be fantastic. Have some tips to improve the code? Or the UX? A new feature you want to see? Let me know! And feel free to submit issues/pull requests. :smiley:

Edit: And here’s an example post on the site so you can see what they look like.

Most Liked

tyro

tyro

Just an update, I’ve added support for uploading/download posts via JSON. For more info see here: https://sceopa.com/posts/17

ps. If anyone wants to look at the code for this feature (or code review it which would be awesome :slight_smile:) you can see the commit here: Add support for uploading multiple posts from json file (793fa9e3) · Commits · James Long / sceopa · GitLab, the main function is:

  def import_posts(user, file) do
    with {:ok, contents} <- File.read(file.path),
         {:ok, %{"posts" => posts}} <- Poison.decode(contents),
         {:ok, _results} <-
           posts
           |> Enum.map(fn params ->
             assoc = build_assoc(user, :posts)
             Post.changeset(assoc, params)
           end)
           |> Enum.with_index()
           |> Enum.reduce(Multi.new(), fn {changeset, index}, multi ->
             Multi.insert(multi, index, changeset)
           end)
           |> Repo.transaction(),
      do: {:ok}
  end
tyro

tyro

Well as far as learning Elixir goes, I’ve been working through quite a few exercism exercises which have helped. I’m still very much a noob when it comes to OTP but am working through Elixir in Action to help with this. Overall I think there are a lot of good learning resources out there for the core language.

The two main difficulties I had were I guess the standard ones:

a) lack of libraries

e.g. For this project I wanted to have server-side syntax-highlighting. There are good libraries for this in python, haskell, and ruby, but not elixir (I ended up using Pandoc for this which is written in Haskell).

b) deployment

Setting up Heroku deployment and SSL was a bit of a pain, but mainly because I’m new to this. There are elixir/phoenix buildpacks for Heroku which are very helpful.

hlx

hlx

Use the force of Pattern Matching you much (or at least try ;))

above can be written as

defp put_email_key(%Ecto.Changeset{valid?: false} = changeset), do: changeset
defp put_email_key(%Ecto.Changeset{valid?: true} = changeset) do
  put_change(changeset, :email_verification_key, gen_email_key())
end

Where Next?

Popular in Discussions Top

vans163
So useless benchmarks aside, Its possible to write a webserver that can serve 300k requests per second (perhaps more with optimizations)....
New
Donovan
Hello everyone, I’m so glad to have discovered this awesome community. Thanks for creating it! This is my second post, and apologies for...
New
mmport80
I have put far too much effort into Dialyzer over the last year or so - and basically - I doubt it’s worth the effort. It’s not as easy ...
New
mmmrrr
Just saw that dhh announced https://hotwire.dev/ Is it just me or is this essentially live view? :smiley: Although I like the “iFrame-e...
New
praveenperera
How We Replaced React with Phoenix By: Thought Bot
New
Ankhers
Just a little information upfront. Generally speaking, if I feel like I need to either break a pipe chain or use an anonymous function in...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
und0ck3d
Hello everyone! A few days ago I’ve created a topic here about how people were creating CMSs with Elixir and Phoenix. I’ve been studying...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
AstonJ
Can you believe the first professionally published Elixir book was published just 8 years ago? Since then I think we’ve seen more books f...
New

Other popular topics Top

skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
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
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement