JasonTrue / ex_jagaimo_blog

Elixir Blogging App

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ExJagaimoBlog

I'm playing around with a blogging application. As of the time of this writing, I've only spent a couple of partial days hacking on this, so it's not very interesting yet.

The initial goals are to replace a half-completed Rails app that I started ages ago and never had time to finish. That repository is here but is private.

I figure making the repo public is worthwhile just because almost all of my other Elixir code is owned by employers or consulting clients, and I'd like to at least have some sort of public demonstration of the programming language I spend most of my work hours writing in.

That said, this codebase isn't expected to ever be particularly robust; it's a side project whose predecessor I'd largely been neglecting.

The current features:

  • Models blogs, posts, comments.
  • Has a sort of "magazine" view see (LandingController) that's routed by domain name.
  • Has some sort of historical archive view (organized by year/month/day)
  • Not important to you, but migrates my old Rails-based database schema to use Ecto conventions, while still (hopefully) having decent-ish greenfield migrations.
  • A tag cloud view (needs to be a bit more flexible.)
  • Filtering the archive by tags (Easy-ish! yay! may have some performance issues with larger databases)
  • Dockerized if you're into that sort of thing

Things that I'm hoping to work on soon:

  • Atom feed
  • Styling

Things that I'm hoping to work on eventually:

  • Blog post editing features
  • Blog configuration code (not important to me because legacy schema)
  • Opengraph support for Twitter/Facebook cards

License

Please consider this "proprietary" for now, but if you're interested in leveraging this code for your own projects please file an issue

I'm probably open to converting this to a MIT or similar license but I'm only likely to do that if a couple of people show interest in the code.

Running

If you want full text search, you'll need to run a copy of ElasticSearch that your server can reach.

For local development, you can start a server with these steps in bash if you have docker:

(I hope to simplify these but I'm busy):

./bin/run-elasticsearch
# once elastic is running, you'll need to copy the auto-generated cert to `./priv

# Recent versions of elasticsearch spit out an autogenerated password in the logs.
# You can optionally set the password yourself using:
# ` docker exec -ti jaga-es elasticsearch-reset-password -u elastic`
#
docker cp jaga-es:/usr/share/elasticsearch/config/certs/http_ca.crt ./priv/dev/http_ca.crt

Make sure you have these environment variables set appropriately before running ExJagaimoBlog. In my own environment I use direnv to manage this.

export ELASTIC_PASSWORD="<use a good strong password>" #ExJagaimoBlog doesn't have a default password
export ELASTIC_URI="https://localhost:9200" #Elastic uses https, thus the ceremony around the Certificate Authority
export ELASTIC_USERNAME=elastic #That's our default username, so you can skip it unless you're using another username

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup
  • Install Node.js dependencies with npm install inside the assets directory
  • Start Phoenix endpoint with mix phx.server

Now you can visit localhost:4000 from your browser.

This won't get you very far though; you'll need to create at least one Blog record for the app to be of any use. (The ExJagaimoBlog context doesn't yet help for that very much)

Deploying

Yikes I'm gonna have to write this soon.

About

Elixir Blogging App


Languages

Language:Elixir 87.9%Language:HTML 5.4%Language:JavaScript 4.7%Language:Dockerfile 1.8%Language:CSS 0.2%Language:SCSS 0.1%