8ctopotamus / real_deal_API

Learning Elixir and Pheonix Framework with the "Backend Stuff - Phoenix Framework" Youtube Tutorial.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RealDealApi

Learning Elixir and Pheonix Framework with the Backend Stuff - Phoenix Framework Tutorial on Youtube.

Develop locally

  • Make sure to have docker container created and running (see commands below)
  • See below for running Pheonix server

Commands learned along the way

# pull docker postgress image
docker pull postgres

# create docker container (add your own user/pass)
docker run --name bs_db -p 5432:5432 -e POSTGRES_USER=XXX -e POSTGRES_PASSWORD=XXX -d postgres

# view container info
docker inspect bs_db

# install pheonix
mix archive.install hex phx_new

# create backend-only pheonix app
mix phx.new real_deal_api --no-install --app real_deal_api --database postgres --no-live --no-assets --no-html --no-dashboard --no-mailer --binary-id

# install deps
mix deps.get

# create db
mix ecto.create

# enter postgres shell (in docker terminal)
psql -U root bs_db

# run the app
mix phx.server

#generate a JSON controller called Accounts, module Account, db table account, that has email and hash_password columns of type string
mix phx.gen.json Accounts Account account email:string hash_password:string

To start your Phoenix server:

  • Run mix setup to install and setup dependencies
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Learn more

About

Learning Elixir and Pheonix Framework with the "Backend Stuff - Phoenix Framework" Youtube Tutorial.


Languages

Language:Elixir 100.0%