Banking is a project that was built to test my skills, and a opportunity to use and test the latest dependencies(or packages) on Elixir ecosystem.
The project consists of a Banking Account service, accept the creation of accounts, deposit, withdrawal among other features
as described on Features
section.
The project was created under a Elixir Umbrella application, using Postgres to store the balance events, accounts and transactions, with Phoenix providing the Rest API structure and Docker as a container that can be used on development.
- Authentication
- Account Operations
- Account Creation
- Deposit, Withdrawal and Transference between accounts
- Statement and Balance
- Back Office Operations
- Daily, Monthly, Yearly and Total report (for Back Office)
- Email service integration
- Error and Logging service integration
- Continuous Integration
- Docker image for development
- Erlang/OTP 21 [erts-10.3]+
- Elixir 1.8.1+ (compiled with OTP 21)
- PostgreSQL 10.7+
(not tested on OTP 20 or others versions of elixir, but should work fine using the latest versions)
Guardian
(for accounts) andBasicAuth
(for backoffice) authenticationPhoenix
for theapi
Timber
for error and logging serviceEcto
for database wrapperBamboo
for email service- Circle CI for continuous integration
The project was created using umbrella and consist into 5 apps with distinct's functions
-
Model
Contains the database operations like read and write, the schema definitions, database migrations, changeset with validations and logic for change of the balance
-
Accounts
Logic segregation of bank account and their operations, serves as a bridge between the API and Model
-
Backoffice
Logic segregation of Back office and their operations, serves as a bridge between the API and Model
-
Email
Email Service Integration and email implementation
-
API
The Rest API, it calls functions from Accounts and Backoffice apps and not deal directly with Model or Email
- Documentations can be found at Docs
The test's are made using Ex_Unit, also using useful libraries like Faker
and ExMachina
- Install dependencies
$ mix deps.get
- Setup database (creation & migrations)
$ mix ecto.create
$ mix ecto.migrate
- Run application
$ mix phx.server
- Application are running on localhost:4000
-
Move into banking directory
-
Run docker-compose
$ docker-compose build
$ docker-compose up
- Application are running on localhost:4000
- Create database
$ MIX_ENV=test mix ecto.create
$ MIX_ENV=test mix ecto.migrate
- Execute the test
$ mix test
Dialyzer Dialyzer is a static analysis tool that identifies software discrepancies Dialyxir
$ mix dialyzer
Credo Credo is a static code analysis tool for the Elixir language with a focus on teaching and code consistency.
$ mix credo
-
Move into banking directory
-
Run
$ mix docs
- Html docs on
doc
folder
see API
Page