ChatApp is a Stream Based API service used to create Chat Applications
Make sure you have Erlang, Elixir and PostgreSQL. The current versions of Erlang and Elixir are defined in .tool-versions.
Change into the chat_app/
directory and run the following commands:
cp config/dev.smple.exs config/dev.exs
mix deps.get
# sets up db and seeds sample data
mix ecto.reset
mix run --no-halt
Access on
http://localhost:4000
https://documenter.getpostman.com/view/3385291/UVXjJvdH
Login on /login
or register with /register
then use the auth_token
value as a authorization
header with subsequent API calls.
Web socket subscribes to POST: http://localhost:4000/ws/chat
{ "message" : "your message here" }
Check config/test.exs
for Test ENV config. To run test, run;
mix test
Given more time, I would have;
- Added more test coverage
- Added CI deployment script
- Figure out adding route scope macro for plug routes
- Check deeply into cowboy web sockets