An (Elixir/Phoenix) proof of concept (POC), the purpose of which is to verify that certain functional concepts have the potential for real-world application.
To configure:
mix deps.get
mix ecto.create
ecto.migrate
mix test
To start your Phoenix app:
- Start Phoenix endpoint with
mix phoenix.server
- Now you can visit
localhost:4000
from your browser.
To pack this application:
- ./node_modules/brunch/bin/brunch b -p build’s your assets in production mode. More detail can be found in the Phoenix Static Asset Guide
- MIX_ENV=prod mix phoenix.digest To compress and tag your assets for proper caching. More detail can be found in the Phoenix Mix Task Guide
- mix release --env=prod To actually generate a release for a production environment
- Run
MIX_ENV=prod mix release --env=prod
. See Distillery for more information - Ready to run in production!
- check deployment guides.
To deploy on AWS:
scp -i ~/.ssh/MyKeyPair.pem package [email protected]:~\
To hack as DevOps on AWS:
ssh -i ~/.ssh/MyKeyPair.pem [email protected]
How this app was created:
- Create the app
mix phoenix.new pocapi
- Create a Database on Postgres
mix ecto.create
- I had to access the postgres
psql postgres
, and alter the roleALTER USER postgres SUPERUSER;
- It could be done with
createuser -s postgres
for creating and setting Superuser role. - Create a Database on Postgres
mix ecto.create
- Create a CRUD for Products
mix phoenix.gen.html Product products name:string description:string rating:integer price:float
- Run Database migration
mix ecto.migrate
- Official website: http://www.phoenixframework.org/
- Guides: http://phoenixframework.org/docs/overview
- Docs: https://hexdocs.pm/phoenix
- Mailing list: http://groups.google.com/group/phoenix-talk
- Source: https://github.com/phoenixframework/phoenix