Coder Social home page Coder Social logo

rocketpay's Introduction

rocketpay

Back-end project created with Elixir for the Next Level Week fourth edition of Rocketseat.

This project was created using the following command

mix phx.new rocketpay --no-webpack --no-html

The project divide its layers in folders referencing the project's name, for example under ./lib:

  • rocketpay (Domain layer)
  • rocketpay_web (Application/Host layer)

Restore project on local machine

In order to restore the project run: mix deps.get

Keep our postgres server running with Docker using

# First time
docker run --name postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres

# After the first time the container is created, then you just need to run
docker start postgres

Running the project

In order to execute the project run

mix phx.server

The command above will run the Phoenix server.

Access the running service on page http://localhost:4000/dashboard/

If you want to execute your modules on terminal run iex -S mix, this will open an iex with all your modules loaded. User recompile each time you change your modules.

NOTE: Phoenix server does not require to be stopped after each change since we have hot reload enabled, you just need to restart the server if you change dependencies or any other compilation configuration.

Running migrations

With the DB up and running use mix ecto.migrate to run the migrations.

Creating a new migration to be used with a new schema and changeset:

mix ecto.gen.migration migration_name
# Example
mix ecto.gen.migration create_users_table

After a new migration is created and defined we should run

mix ecto.migrate

Running unit tests

We has unit tests and integration tests that use DB in sandbox mode, preventing test data from being stored on our DB of tests

# Run tests
mix test

# Run tests with coverage statistics
mix test --cover
# Or use
mix coveralls.html
# The line above will create a html on ./cover/excoverall.html that will show the relevant code to test

Debugging

For debug abuse of IO.inspect() it won't change your operations and will print on the shell you values

# Example:
response = run_something()
IO.inspect(response)

Dependencies

Elixir 1.11.3 (compiled with Erlang/OTP 21)

Phoenix Framework:

mix archive.install hex phx_new 1.5.7

Roadmap

We have planned some improvements:

  • Fix Deposit and Withdraw actions to display updated account after operation. Currently the account shows the old status before the operation.
  • Fix Operation module error message that displays "Invalid deposit value!" but should deal with deposit and withdraw messages

rocketpay's People

Contributors

adrianokerber avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.