Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.
/ edi Public archive

Wholesaler EDI using Phoenix/Elixir

Notifications You must be signed in to change notification settings

rvcas/edi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EDI

I have a habit of keeping a docker-compose.yml in the repo to avoid having to install and configure postgres from scratch. If you do not/cannot use docker, skip the first step, then just install and configure postgres normally.

  • Start Postgres: docker-compose up -d
  • Install dependencies with: mix deps.get
  • Create and migrate the database with: mix ecto.create && mix ecto.migrate (bonus: use an alias from mix.exs)
  • Start Phoenix endpoint with mix phoenix.server

Now the endpoint (server) will be listening for requests at localhost:4000.

Testing

Elixir comes with ExUnit and phoenix provides some test helpers. Similar to rspec, the tests folder normally mimics the directory structure of your app and contains files of the same name with _test.exs appended to the end: file_name_test.exs.

Note: .exs vs. .ex (left is usually for scripting)

I have added some things to make testing a little cooler:

  • Bureaucrat (for autogenerating api-docs from tests)
  • ExMachina (easily create test data, kinda like factory girl)
  • Faker (generate fake data, pairs nice with exmachne)
  • credo (linting/code analysis, look at .credo.exs)
  • mix_test.watch (watchs files while testing, configured to run credo as well)
    • try this out with: mix test.watch (tests run and then credo runs, every file save)

BEAM

To much to explain in a little readme to I took some screenshots of the observer app that ships with erlang. This app looks much pretty on OSX but I was running linux at the time of the screenshot so the interface is only ok.

This is the application tree:

app process tree

These are some load charts:

load charts

This is just some system info:

system info

Releases

No releases published

Packages

No packages published

Languages