Local radio and video news feed for Amazon (and friends, eventually), build with Elixir.
Exercises:
- Elixir language
- Phoenix Framework as API server and CORS proxy
- Phenix LiveView for UI with live search and media playback
- Pow for user authentication, integrated with LiveView, REST API and GraphQL API
- Absinthe for GraphQL
- Floki HTML parser for web scraping
- News feed generation for Amazon Alexa
- Docker with Multi-stage build
- Phoenix Swagger for API documentation
mix deps.get
mix phx.swagger.generate
Note: when LiveView version is updated we need to update the assets as well
cd assets && npm install phoenix_live_view --force
docker build -t flashfeed-elixir:latest .
mix run --no-halt
Needs network and user access to a Postgres DB.
export FLASHFEED_DB_DATABASE="flashfeed"
export FLASHFEED_DB_USERNAME="postgres"
export FLASHFEED_DB_PASSWORD="postgres"
export FLASHFEED_DB_HOSTNAME="database"
export FLASHFEED_DB_PORT="5432"
export FLASHFEED_HOST_FOLDER_MNESIA="$(pwd)/tmp/docker/mnesia"
mkdir -p $FLASHFEED_HOST_FOLDER_MNESIA
docker stop flashfeed-elixir
docker run -e FLASHFEED_DB_DATABASE \
-e FLASHFEED_DB_USERNAME \
-e FLASHFEED_DB_PASSWORD \
-e FLASHFEED_DB_HOSTNAME \
-e FLASHFEED_DB_PORT \
--volume ${FLASHFEED_HOST_FOLDER_MNESIA}:/mnt/mnesia \
--name flashfeed-elixir \
--rm \
-p 41384:41384 \
-t flashfeed-elixir:latest
curl -X GET http://localhost:41384/api/v1/feed/amazon_alexa/rainews/rainews/it/fvg/gr