To start your Phoenix server:
- Install dependencies with
mix deps.get
- Create and migrate your database with (only the first time)
mix ecto.reset
- Start Phoenix endpoint with
mix phx.server
Now you can visit localhost:4000
from your browser.
Ready to run in production? Please check our deployment guides.
- 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
- Make sure you have
node
andnpm
installed - Go to
assets
folder - Run
npm install
to download the dependencies (node_modules
folder andpackage-lock.json
will be created in theassets
folder)
-
For
Development
: inassets
folder runnpm run ssr:watch
. This will first clear thestatic
folder, then copy the rendering server and finally will build both the server side and the client side bundles and stay inwatch
mode to rebuild the bundles on saving a file change. To open the application:in a different console
start thenode server
in theassets
folder by running thenpm run serverssr
. Thenin a third console
start thePhoenix
server by running themix phx.server
command in the root directory. Open the browser athttp://localhost:4000
. -
For
Production
inassets
folder runnpm run ssr
and provide environment variables. Get the static folder and copy it to the corresponding folder on the production server. Then you must start thenode server
.
To pass environmental variables, set them after the script's name like in this example: npm run develop --port=8081 --host=http://localhost --apiurl=http://localhost:4000/
. If not provided, default values will be used (set in webpack config files)
- Node: https://nodejs.org/en/
- Webpack: https://webpack.js.org/
- Vue.js: https://vuejs.org/
- Vuex: https://vuex.vuejs.org/en/
- Vue.js Server Side Rendering: https://vuejs.org/v2/guide/ssr.html
- apollo-client: https://www.npmjs.com/package/apollo-client
- axios: https://github.com/mzabriskie/axios
- SCSS: http://sass-lang.com/