Giter Club home page Giter Club logo

phoenix-chat-t3chfest's Introduction

Developing a step-by-step web chat with Elixir and Phoenix Framework

Developed live during a workshop at T3chFest 2019

Show me the step-by-step guide!

Bellow you will find the links explaining how I developed this application, you can follow the instructions:

  • Using a Docker image: an executable package with everything you need to run this application (Elixir + Phoenix Framework + PostgreSQL), develop and run this application
  • Doing a traditional instalation install on your computer everything you need (Elixir + Phoenix Framework + PostgreSQL), develop and run this application

I just want to run this application on my computer!

If you don't want to follow the step-by-step guide and you only want to run this application, keep reading

Prerequisities

  1. Install Elixir on your machine:

  2. Install Phoenix framework (mix utility will be available once you have installed Elixir), just execute: mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

  3. A PostgreSQL (Database Server) instance to save chat messages, two options: 3.1 Install it on your computer

    3.2 Use Docker to avoid installing more software on your computer

    • Install Docker and download this files from this repository: DockerFile and docker-compose.yml: this image will an executable package with everything you need to run an application (Elixir + Phoenix Framework + PostgreSQL)

Check if you have installed what that you need

Open a terminal and check:

  1. Elixir elixir - v: you should see a text explaining that Erlang and Elixir are running
  2. Phoenix Framework mix phx.new -v: this will show you the lastest Phoenix version
  3. Confirm PostgreSQL is running (ignore this step if you are going to use Docker, as indicated in 3.2)
Run it with Docker!
  1. Setup the web container: docker-compose build web
  2. Install dependencies: docker-compose run web mix deps.get
  3. Using ecto, create your database: docker-compose run web mix ecto.create and migrate your tables docker-compose run web mix ecto.migrate
  4. Install Node.js dependencies: docker-compose run web bash -c "cd assets; npm install"
  5. Start the application: docker-compose up
Run it without Docker (you have PostgreSQL installed on your computer)
  1. Install dependencies: mix deps.get
  2. Check PostgreSQL credentials at config directory (config/dev.exs), create and migrate your database with mix ecto.create && mix ecto.migrate
  3. Install Node.js dependencies with cd assets && npm install
  4. Start the appliation: mix phx.server

You can visit http://localhost:4000 to play with the chat, it's recommended open the app in two separate browser windows to try it (if your machine only has one browser try using an "incognito" tab).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.