Giter Site home page Giter Site logo

cepsearch's Introduction

CEPSEARCH

API developed for consumption of BrasilAPI. In it, OpenFeign was used to integrate REST Clients. An in-memory database for caching, Redis, was also used. Along with other technologies like Docker and the docker-compose plugin. The API also relies on swagger-ui for documentation and easy visualization of how the API works. It also uses Actuator and Prometheus, which integrate with Grafana to view metrics and reports in graphs. Was developed to practice programming and to study. Everything was integrated with the github workflow, to generate the docker image build and send them to dockerhub

You can access the API in production through the endpoint https://cepsearch.up.railway.app/api/cep/{any-postalcode}

Technologies

Practices adopted

  • SOLID
  • API REST
  • Dependency Injection
  • Automated tests
  • Containerization with docker
  • Data Caching
  • Error response handling
  • Full API monitoring
  • Automatic Swagger Generation with OpenAPI 3

Screenshot

swagger_screenshot

Requirements

  1. Docker
  2. Docker-compose

Get started

  1. Clone git repository

     git clone https://github.com/WeversonL/cepsearch.git
     cd cepsearch
    

Running the application with docker-compose

  1. Start with docker-compose

     docker-compose up -d
    
  2. If you want to view the interactive swagger, access the url below in your browser

     http://localhost:8080/api/swagger-ui/index.html#/
    
  3. Make a search by sending the desired zip code as QueryParam, in your desired client. Below I leave an example curl

     curl --location --request GET 'localhost:8080/api/cep/17560-246'
    

Monitoring

With Grafana

graphana_screenshot

  1. To monitor using Grafana, you can access the URL below. Using admin/admin credentials. [They can be changed after the first login]

     http://localhost:3000/
    
  2. By developer settings, there are no profiles created or dashboards created. For this, you can configure it manually by following below. Getting started with database setup

     Menu -> Connections -> Data Sources -> Add new data source -> Prometheus
    
     Prometheus server URL: http://prometheus:9090/
    
     Save & test
    
  3. Add a dashboard. You can create your own, or use created dashboards. Recommend this

     Menu -> Dashboards -> New -> Import
    
     Add this URL: https://grafana.com/grafana/dashboards/4701-jvm-micrometer/
    
     Load
    

With Prometheus

prometheus_screenshot

  1. To monitor using Prometheus, you can access the URL below.

     http://localhost:9090/
    

With Actuator

  1. To get information with actuator, make a request to the following endpoint

     http://localhost:8080/api/actuator
    

Other information

  1. To terminate and destroy the containers, you can run

     docker-compose down
    

โš ๏ธ Still in development

License

cepsearch is MIT licensed.

cepsearch's People

Contributors

weversonl avatar

Watchers

 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.