Skip to content

rafayet-monon/elixir_search_extractor

Repository files navigation

Search Extractor

This is and Elixir app that takes some keyword and searches to google and stores some important information.

Project Setup

Erlang & Elixir

Demo

Development

  • Install Docker for Mac

  • Setup and boot the Docker containers:

    make docker_setup
  • Install Elixir dependencies:

    mix deps.get
  • Install Node dependencies:

    npm install --prefix assets
  • Setup the databases:

    mix ecto.setup
  • Start the Phoenix app

    iex -S mix phx.server
  • Run all tests:

    mix test
  • Run all lint:

    mix codebase
  • Test coverage:

    mix coverage

Production

  • Build Docker image

    docker-compose build

CI/CD

We are using heroku to deploy our staging and production app. There are few steps that needs to be followd to deploy app successfully to Heroku -

  • Create two apps in heroku. One for staging and one for production.

  • Add below secrets to github -

    Secrets Description
    HEROKU_API_KEY Can be found under Account settings
    HEROKU_STAGING_APP The heroku app name created for staging environment
    HEROKU_PRODUCTION_APP The heroku app name created for production environment
  • Add a PostgreSql Database add-on to heroku app.

  • Add below environment variables to heroku app -

    Environment Variable Description
    DATABASE_URL Will be added automatically after adding the database add-on to the Heroku app
    HOST_URL The URL host, e.g. acme.herokuapp.com
    SECRET_KEY_BASE The value generated by running the command mix phx.gen.secret
  • Push to development branch will deploy to staging and push to main branch will deploy to production.