wewelll / jukee

Jukee, the modern jukebox (basically a web music player with collaborative playlist management) !

Home Page:https://jukee.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jukee

This is a basic setup for an React(16) + Phoenix(1.3)/Elixir(1.5) project, using webpack(3) and users with authentication.

INSTALL PROJECT

mix deps.get
mix deps.compile
mix ecto.create
mix ecto.migrate
cd assets
yarn install
cd ..

STARTING PROJECT WITH PIERRE

Start at the root of the project.

First install elixir (subset of erlang for web) and phoenix (framework for elixir)

brew update
brew install elixir
mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez (installing phoenix)

Then compile the project

mix deps.get
mix deps.compile

Add frontend dependencies

cd assets
yarn install
cd ..

Get docker compose and set up the db by running :

docker-compose up

Finally, you can start the project

mix ecto.create
mix ecto.migrate
mix phx.server

STARTING PROJECT WITH SAMUEL

Start the database

docker-compose up

Start server

mix phx.server

SUPERUSER

After running mix ecto.migrate command you will have superuser:

username: amdin
password: 12345678

SETUP

Redux logger

If you want to turn redux logger on just assign true to useReduxLogger in app/store/index.js

...
const useReduxLogger = true;
...

DEPLOYING TO HEROKU

You should have installed heroku-cli

Create heroku application

heroku create --buildpack "https://github.com/HashNuke/heroku-buildpack-elixir.git"

Optional change app address

heroku apps:rename appname

Adding phoenix buildpack

heroku buildpacks:add https://github.com/chernyshof/heroku-buildpack-phoenix-static.git

Add you address

in config/prod.exs change in config, :appname, Appname.Repo, url line(if needed)

url: [scheme: "https", host: "appnameaddress.herokuapp.com", port: 443],

Creating Environment Variables

heroku addons:create heroku-postgresql:hobby-dev
heroku config:set POOL_SIZE=18

Secret key

gen secret key

$ mix phx.gen.secret
xvafzY4y01jYuzLm3ecJqo008dVnU3CN4f+MamNd1Zue4pXvfvUjbiXT8akaIF53
now set key that you got in heroku
heroku config:set SECRET_KEY_BASE="xvafzY4y01jYuzLm3ecJqo008dVnU3CN4f+MamNd1Zue4pXvfvUjbiXT8akaIF53"

Guardian secret key

$ mix phx.gen.secret
xvafzY4y01jYuzLm3ecJqo008dVnU3CN4f+MamNd1Zue4pXvfvUjbiXT8akaIF53
now set key that you got in heroku
heroku config:set GUARDIAN_SECRET_KEY="xvafzY4y01jYuzLm3ecJqo008dVnU3CN4f+MamNd1Zue4pXvfvUjbiXT8akaIF53"

Deploy time!

git push heroku master
heroku run "POOL_SIZE=2 mix ecto.migrate"

REQUIREMENTS

USED PLUGINS AND TECHNOLOGIES

Frontend

Backend

About

Jukee, the modern jukebox (basically a web music player with collaborative playlist management) !

https://jukee.app/

License:MIT License


Languages

Language:Elixir 57.7%Language:JavaScript 41.0%Language:HTML 1.3%Language:CSS 0.0%