Back-end API written in Ruby on Rails to serve data for the Basic Health Units Plataform
The API documentation is available by Clicking here.
To install the Development Environment, access the Docker Readme and follow the instructions.
The application uses the Postgres database, so to use the project it is necessary the creation of a Server in PgAdmin, for this follow the commands below:
- Access the local Pgadmin;
- To access, use the data below:
- User: user@gmailcom
- Password: BhU2020!
- Create a server and enter a name for it as shown below:
- In the Conections tab, create a connection as shown in the image below:
- User: user
- Password: BhU2020!
PS.: All passwords and users are for Local / Development use
- Linguagem: Ruby 2.6.0
- Framework: Ruby on Rails 6.0.2.1
- Conteinerização: Docker
- Multiple Container Handling Tool: Docker Compose
- Relational database: PostgreSQL
In the code architecture, the following structure was used:
app/crons
: There are files related to routines that will be executed via schedulingapp/policies
: There are the files related to the System Policies (business rules)app/serializers
: There are files related to the data serialization classes that will be returned in the API.app/services
: There are files related to communication with services external to the application, such as third party APIs.app/utils
: There are files related to modules useful for the system.app/workers
: Are the files related to the classes of the Workers that will be used to process in Sidekiq
The use of Docker and Docker-compose was adopted in the development environment because it streamlines the development process and keeps the developer's machine integrated.
active_model_serializers
: It was used to serialize the data on the return of the API.sidekiq
: It was used to use Queues and Background processes.httparty
: It was used to make REST requests.devise
: It was used to authenticate users in the API.simple_token_authentication
: It was used to work with Devise, performing user authentication in the API.kaminari
: It was used to perform data paginationgeocoder
: It was used to perform data manipulation through geolocationrack-cors
: It was used to solve an external access problem in the API via Web App
factory_bot_rails
: It was used to create Mocks in the tests.faker
: It was used to create fictitious data in the Tests.webmock
: It was used to create request mocks in tests.vcr
: It was used to create Mocks of requests, not to perform them after creating the mocks.
The MIT License (MIT)
Copyright ©️ 2020 - Basic Health Units