To install our application, you can run docker-compose
to it:
# Start all applications
$ docker-compose up --build
To create a new user, you can send the parameters:
$ curl \
X POST "http://localhost:4000/users" \
-H "accept: application/json" \
-H "content-type: application/json" \
-d "{ \"birth_date\": \"1996-05-07\", \"city\": \"São Paulo\", \"country\": \"Brazil\", \"cpf\": \"08716310080\", \"email\": \"[email protected]\", \"password\": \"123456\", \"gender\": \"M\", \"name\": \"Alexandre de Souza\", \"state\": \"São Paulo\"}"
And it will generate the response:
{
"message": "User created successfully",
"referral_code": "44090390"
}
With this, you can create an user with indication like:
$ curl \
X POST "http://localhost:4000/users" \
-H "accept: application/json" \
-H "content-type: application/json" \
-d "{ \"birth_date\": \"1996-05-07\", \"city\": \"São Paulo\", \"country\": \"Brazil\", \"cpf\": \"08716310080\", \"email\": \"[email protected]\", \"password\": \"123456\", \"gender\": \"M\", \"name\": \"Alexandre de Souza\", \"state\": \"São Paulo\", \"referral_code\": \"44090390\"}"
You can access Swagger using the route http://localhost:4000/docs
, and before that you need to generate Swagger file.
Just run mix swagger
.
You need to define the environment variable DATABASE_URL
with yout database connection string for PostgreSQL:
$ export DATABASE_URL="postgres://bankex:bankex@database:5432/bankex"
$ iex -S mix phx.server
You can run all tests locally using the command:
$ mix setup # Create database
$ mix test --trace # Run all tests
$ mix test.watcher --trace # Run all tests with watcher
To contribute you need to:
- Fork this repo
- Create a new branch, i.e.:
feature/awesome-commit
- Push your code to your fork
- Create a pull-request to this repo
- Await to code review ✨