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
) - 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. ![]()
Edit: And here’s an example post on the site so you can see what they look like.
Most Liked
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
) 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
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
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
Popular in Discussions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #code-sync
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









