Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Trending hashtags and what people are tweeting about them

Notifications You must be signed in to change notification settings

robinsalehjan/trendinghashtaggraph

Repository files navigation

TrendingHashtagGraph

Alt Text

Run with Docker

  1. Clone the repository: git clone https://github.com/robinsalehjan/trendinghashtaggraph.git && cd trendinghashtaggraph

  2. Make sure to create a env.list file with the contents of:

PORT=8080
REPLACE_OS_VARS=true
PHOENIX_SECRET_KEY_BASE=...
TWITTER_CONSUMER_KEY=...
TWITTER_CONSUMER_SECRET=...
TWITTER_ACCESS_TOKEN=...
TWITTER_ACCESS_TOKEN_SECRET=...

Where you replace ... with the value of your Phoenix secret and Twitter API credentials:

  1. Build the image: docker build -t trendinghashtaggraph .

  2. Run the image: docker run -d -p 8080:8080 --env-file env.list --rm trendinghashtaggraph and open localhost:8080 in your browser

Terminology & Architecture

In Elixir, all code runs inside processes. Processes are isolated from each other, run concurrent to one another and communicate via message passing. Processes are not only the basis for concurrency in Elixir, but they also provide the means for building distributed and fault-tolerant programs.

Elixir’s processes should not be confused with operating system processes. Processes in Elixir are extremely lightweight in terms of memory and CPU (even compared to threads as used in many other programming languages). Because of this, it is not uncommon to have tens or even hundreds of thousands of processes running simultaneously. [1]

Supervision strategies:

  • :one_for_one - if a child process terminates, only that process is restarted.
  • :one_for_all - if a child process terminates, all other child processes are terminated and then all child processes (including the terminated one) are restarted.
  • :rest_for_one - if a child process terminates, the terminated child process and the rest of the children started after it, are terminated and restarted.

architecture