{"id":17781586,"url":"https://github.com/aadmaquino/partner-sync","last_synced_at":"2026-05-05T12:32:53.786Z","repository":{"id":259024175,"uuid":"871700941","full_name":"aadmaquino/partner-sync","owner":"aadmaquino","description":"A tool for bulk updating internal partner data via CSV uploads, streamlining data management and saving time.","archived":false,"fork":false,"pushed_at":"2024-10-21T13:00:33.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T13:15:15.469Z","etag":null,"topics":["csv","csv-parser","docker","docker-compose","elixir","phoenix"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aadmaquino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-12T17:39:24.000Z","updated_at":"2024-10-21T13:00:39.000Z","dependencies_parsed_at":"2024-10-22T15:47:56.318Z","dependency_job_id":null,"html_url":"https://github.com/aadmaquino/partner-sync","commit_stats":null,"previous_names":["aadmaquino/partner-sync"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadmaquino%2Fpartner-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadmaquino%2Fpartner-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadmaquino%2Fpartner-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadmaquino%2Fpartner-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aadmaquino","download_url":"https://codeload.github.com/aadmaquino/partner-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246705987,"owners_count":20820783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","csv-parser","docker","docker-compose","elixir","phoenix"],"created_at":"2024-10-27T04:03:34.351Z","updated_at":"2026-05-05T12:32:48.760Z","avatar_url":"https://github.com/aadmaquino.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Partner Sync\n\nThe **Partner Sync** project aims to streamline the updating of internal partner data. By allowing bulk updates through CSV file uploads, we can reduce the time and effort spent on manual data entry, enhancing overall efficiency.\n\n## Table of Contents\n\n- [Technologies Used](#technologies-used)\n- [Getting Started](#getting-started)\n  - [Running with Docker](#running-with-docker)\n  - [Running locally with ASDF](#running-locally-with-asdf)\n- [API Endpoints](#api-endpoints)\n- [Libraries Used](#libraries-used)\n- [Code Quality](#code-quality)\n- [Tests and Coverage Report](#tests-and-coverage-report)\n\n## Technologies Used\n\n* Elixir 1.14.2\n* Phoenix 1.6.15\n* Erlang 25.1.2\n* PostgreSQL 14\n\n## Getting Started\n\nThere are two ways to run the application: using [Docker](https://www.docker.com/) or running it locally with [ASDF](https://asdf-vm.com/).\n\n### Running with Docker\n\n**1-** Download and install Docker: https://docs.docker.com/get-docker/\n\n**2-** Once the installation is complete, verify that Docker is running. Open your preferred terminal and execute the commands below:\n\n```bash\n$ docker -v\n# Docker version 20.10.21, build baeda1f\n\n$ docker-compose -v\n# docker-compose version 1.29.2, build unknown\n```\n\nIf the version information appear, you're ready to proceed. If not, you'll need to install Docker using an alternative method. Below are some commands for different operating systems:\n\n```bash\nmacOS:\n$ brew update\n$ brew install docker \u0026\u0026 brew install docker-compose\n\nLinux (Ubuntu):\n$ sudo apt-get update\n$ sudo apt-get install docker docker-compose\n```\n\n**3-** In the terminal, with Docker running, navigate to the project root directory:\n\n```bash\n$ cd ~/partner_sync/\n```\n\n**4-** Run the command below to start the application and wait for it to initialize:\n\n```bash\n$ docker-compose up --build\n```\n\n**5-** That's it! The application is now accessible at the following URL: http://localhost:4000/\n\n### Running locally with ASDF\n\n**1-** Download and install ASDF: https://asdf-vm.com/guide/getting-started.html\n\n**2-** Once the installation is complete, verify that ASDF is running. Open your preferred terminal and execute the command below:\n\n```bash\n$ asdf --version\n# v0.10.2-7e7a1fa\n```\n\nIf the command above didn't work, check if the `asdf` command is present in your system's environment variables.\n\n**3-** In the terminal, navigate to the project root directory:\n\n```bash\n$ cd ~/partner_sync/\n```\n\n**4-** Add the plugins for [Erlang](https://github.com/asdf-vm/asdf-erlang.git) and [Elixir](https://github.com/asdf-vm/asdf-elixir.git) by following the provided instructions.\n\n\u003e [!WARNING]\n\u003e Please read the README files of these 2 repositories carefully! There are dependencies that need to be installed, which vary depending on the operating system.\n\nRun the commands below:\n\n```bash\n$ asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git\n$ asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git\n```\n\n**5-** Install the versions of Erlang and Elixir using the commands below:\n\n```bash\n$ asdf install erlang 25.1.2\n$ asdf install elixir 1.14.2\n```\n\n**6-** To verify that both have been installed, use the following command:\n\n```bash\n$ asdf current\n# elixir          1.14.2          /path/partner_sync/.tool-versions\n# erlang          25.1.2          /path/partner_sync/.tool-versions\n```\n\nNow that ASDF is properly configured, the next step is to install the database.\n\n**7-** Download and install PostgreSQL 14: https://www.postgresql.org/download/ or use one of the commands below:\n\n```bash\nmacOS:\n$ brew install postgresql\n\nLinux (Ubuntu):\n$ sudo apt-get install postgresql\n```\n\n\u003e [!TIP]\n\u003e You can also use ASDF to install PostgreSQL 14:\n\u003e\n\u003e ```bash\n\u003e $ asdf plugin add postgres https://github.com/smashedtoatoms/asdf-postgres.git\n\u003e $ asdf install postgres 14.6\n\u003e $ asdf global postgres 14.6\n\u003e ```\n\n**8-** Configure the database username and password by following this [tutorial](https://chartio.com/resources/tutorials/how-to-set-the-default-user-password-in-postgresql/). The default value are both `postgres`.\n\n**9-** Your environment is ready to run the application. To get started, execute the following commands in the project directory:\n\n```bash\n$ mix deps.get # Installs the project's dependencies\n$ mix ecto.setup # Creates the project's database\n$ mix phx.server # Starts the Phoenix Endpoint (without debug)\n$ iex -S mix phx.server # Starts the Phoenix Endpoint with debugging\n```\n\n**10-** That's it! The application is now accessible at the following URL: http://localhost:4000/\n\n## API Endpoints\n\nMethod | Endpoint | Description | Parameters / Body\n-------|----------|-----------|-----------\nGET | /api/v1/addresses | Lists all addresses |\nGET | /api/v1/addresses/:cep | Shows an address by ZIP Code |\nGET | /api/v1/partners | Lists all partners |\nGET | /api/v1/partners/:cnpj | Shows a partner by CNPJ |\nPOST | /api/v1/partners | Imports a CSV file ([See template](https://github.com/aadmaquino/partner_sync/blob/main/template.csv)) and inserts/updates each valid record | `csv (file)`\nGET | /dev/mailbox | Provides access to the default email interface for viewing emails sent during development |\n\n\u003e [!NOTE]\n\u003e To set up the request `POST - /api/v1/partners` in Postman, [click here](https://www.postman.com/postman/workspace/postman-answers/documentation/13455110-00378d5c-5b08-4813-98da-bc47a2e6021d) for detailed instructions.\n\u003e\n\u003e ![image](https://user-images.githubusercontent.com/20209857/204148564-3eac1208-23f8-4bfc-be42-526c95113a22.png)\n\n## Libraries Used\n\n* [Credo](https://github.com/rrrene/credo): A static code analysis tool that ensures code follows best practices and recommended standards.\n* [Excoveralls](https://github.com/parroty/excoveralls): Generates detailed test coverage reports, with easy integration into CI tools.\n* [CSV](https://github.com/beatrichartz/csv): A library for parsing and generating CSV files efficiently in Elixir.\n* [HTTPoison](https://github.com/edgurgel/httpoison): A simple and flexible HTTP client for making HTTP requests in Elixir applications.\n* [Brcpfcnpj](https://github.com/williamgueiros/Brcpfcnpj): Provides functions for validating and formatting Brazilian CPF and CNPJ numbers.\n* [Oban](https://github.com/sorentwo/oban): A robust background job processing framework with support for distributed queues and persistence via PostgreSQL.\n\n## Code Quality\n\nTo run the analysis, execute:\n\n```bash\n$ mix credo --strict\n```\n\n## Tests and Coverage Report\n\nTo run the tests, execute:\n\n```bash\n$ mix test\n```\n\nTo generate an HTML coverage report, execute:\n\n```bash\n$ mix coveralls.html\n```\n\nThe report will be saved at: `~/partner_sync/cover/excoveralls.html`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faadmaquino%2Fpartner-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faadmaquino%2Fpartner-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faadmaquino%2Fpartner-sync/lists"}