virkillz / backerbackend

This is gonna be backend for backer (pun intended) project built in elixir.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backerbackend

Many project require admin panel. This is a simple boilerplate for admin panel using phoenix. It already have user authentication. And modified HTML generator to make it slightly nicer.

Everytime you need a project which require backend admin portal, clone this and continue. Save several hours of mine.

Screenshot

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Check your database setting at config/dev.exs and match your postgresql credential
  • Create and migrate your database with mix ecto.create && mix ecto.migrate
  • Install Node.js dependencies with cd assets && npm install
  • Run seed mix run priv/repo/seeds.exs (if you are from asset folder, dont forget to back to root project folder cd ..)
  • Start Phoenix endpoint with mix phx.server
  • Login with username 'administrator' and passsword 'administrator'

Now you can visit localhost:4000 from your browser.

Add other data!

You can start do the regular way, using generator or such. For example:

mix phx.gen.html Content Post post title:string content:string is_published:boolean

OR

mix backerbackend.gen.html Content Post post title:string content:string is_published:boolean

The later one will give nicer html output.

Put resources "/post", PostController in the router /lib/Yourapp_web/router.ex

Run migration mix ecto.migrate

Add link to your menu at '/lib/Yourapp_web/templates/layout/app.html.eex'

Now you got CMS!

I know its not a lot. Just spend half day doing this. But It cound save me hours everytime I need admin panel.

TODO LIST:

  • Sign in - sign out activity record
  • Modify generated template
  • Fix activity display and remove delete button
  • Boilerplate for notification, probably use channel?

About

This is gonna be backend for backer (pun intended) project built in elixir.


Languages

Language:JavaScript 73.9%Language:CSS 16.6%Language:Elixir 5.6%Language:HTML 3.8%