Skip to content

API that brings up the list of all health treatment units that currently seeks data that is publicly available on The Distribution Basic Health Units in Operation

Notifications You must be signed in to change notification settings

OvictorVieira/basic-health-units-api

Repository files navigation

Basic Health Units API

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.

Preparing the Development Environment

To install the Development Environment, access the Docker Readme and follow the instructions.

Database

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!

Logging into PGAdmin

  • Create a server and enter a name for it as shown below:

Server Creation in PGAdmin

  • In the Conections tab, create a connection as shown in the image below:

Connection Creation in PGAdmin

  • User: user
  • Password: BhU2020!

PS.: All passwords and users are for Local / Development use

Project Architecture

Technologies

  • 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

Code Architecture

In the code architecture, the following structure was used:

  • app/crons: There are files related to routines that will be executed via scheduling
  • app/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.

Gems used in the project

Production
  • 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 pagination
  • geocoder: It was used to perform data manipulation through geolocation
  • rack-cors: It was used to solve an external access problem in the API via Web App
Development/Test
  • 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.

Licence

The MIT License (MIT)

Copyright ©️ 2020 - Basic Health Units

About

API that brings up the list of all health treatment units that currently seeks data that is publicly available on The Distribution Basic Health Units in Operation

Resources

Stars

Watchers

Forks

Packages

No packages published