{"id":22111598,"url":"https://github.com/takk8is/sincromei","last_synced_at":"2025-03-24T04:33:48.071Z","repository":{"id":249323594,"uuid":"831200949","full_name":"Takk8IS/SincroMEI","owner":"Takk8IS","description":"SincroMEI is an automated tool designed to synchronise MEI (Microempreendedor Individual) data from the Brazilian Federal Revenue Service website with Google Sheets.","archived":false,"fork":false,"pushed_at":"2024-07-26T12:13:19.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T10:33:23.810Z","etag":null,"topics":["brasil","brazil","cnpj","cnpj-validator","cpf","cpf-cnpj","cpf-validador","davidccavalcante","excel","google","google-sheets","google-spreadsheet","mei","microempreendedor","microsoft","microsoft-excel","takk-ag","takk-design","takk8is"],"latest_commit_sha":null,"homepage":"https://takk.ag","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Takk8IS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null},"funding":"If you have any questions or need support, please open an issue."},"created_at":"2024-07-19T22:57:36.000Z","updated_at":"2024-07-26T12:13:23.000Z","dependencies_parsed_at":"2024-12-01T10:49:28.731Z","dependency_job_id":null,"html_url":"https://github.com/Takk8IS/SincroMEI","commit_stats":null,"previous_names":["takk8is/sincromei"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Takk8IS%2FSincroMEI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Takk8IS%2FSincroMEI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Takk8IS%2FSincroMEI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Takk8IS%2FSincroMEI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Takk8IS","download_url":"https://codeload.github.com/Takk8IS/SincroMEI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245211803,"owners_count":20578436,"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":["brasil","brazil","cnpj","cnpj-validator","cpf","cpf-cnpj","cpf-validador","davidccavalcante","excel","google","google-sheets","google-spreadsheet","mei","microempreendedor","microsoft","microsoft-excel","takk-ag","takk-design","takk8is"],"created_at":"2024-12-01T10:49:25.221Z","updated_at":"2025-03-24T04:33:48.048Z","avatar_url":"https://github.com/Takk8IS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SincroMEI Google Sheets Add-on\n\n![version](https://img.shields.io/badge/version-1.0.0-blue.svg)\n![license](https://img.shields.io/badge/license-CC--BY--4.0-lightgrey.svg)\n![node.js](https://img.shields.io/badge/node.js-14.17.0-blue.svg)\n![express](https://img.shields.io/badge/express-4.19.2-green.svg)\n![dotenv](https://img.shields.io/badge/dotenv-16.4.5-orange.svg)\n\n## Overview\n\nThe **SincroMEI Google Sheets Add-on** allows you to synchronise data from the SincroMEI API directly into Google Sheets. This tool is designed to streamline the integration and management of MEI data from the Brazilian Federal Revenue Service.\n\n```mermaid\ngraph TD\n    A[\"Start Synchronisation\"] --\u003e B[\"Validate CNPJ\"]\n    B --\u003e C[\"Send Request to ReceitaWS\"]\n    C --\u003e D[\"Receive Response from ReceitaWS\"]\n    D --\u003e E[\"Format Received Data\"]\n    E --\u003e F[\"Insert Data into Spreadsheet\"]\n    F --\u003e G[\"Mark Row as Processed\"]\n    G --\u003e H[\"Check Execution Time\"]\n    H --\u003e I[\"Wait for Next Batch\"]\n\n    I --\u003e J[\"Synchronization Complete\"]\n    I --\u003e K[\"Maximum Execution Time Reached\"]\n    K --\u003e L[\"Pause Synchronisation\"]\n    L --\u003e M[\"Resume Synchronisation\"]\n\n    classDef start fill:#f9f,stroke:#333,stroke-width:2px;\n    classDef validate fill:#ffb,stroke:#333,stroke-width:2px;\n    classDef send fill:#bbf,stroke:#333,stroke-width:2px;\n    classDef receive fill:#bfb,stroke:#333,stroke-width:2px;\n    classDef format fill:#bff,stroke:#333,stroke-width:2px;\n    classDef insert fill:#fbf,stroke:#333,stroke-width:2px;\n    classDef mark fill:#f9f,stroke:#333,stroke-width:2px;\n    classDef check fill:#ffb,stroke:#333,stroke-width:2px;\n    classDef wait fill:#bbf,stroke:#333,stroke-width:2px;\n    classDef complete fill:#9f6,stroke:#333,stroke-width:2px;\n    classDef pause fill:#ff6,stroke:#333,stroke-width:2px;\n    classDef resume fill:#9f9,stroke:#333,stroke-width:2px;\n\n    class A start;\n    class B validate;\n    class C send;\n    class D receive;\n    class E format;\n    class F insert;\n    class G mark;\n    class H check;\n    class I wait;\n    class J complete;\n    class K check;\n    class L pause;\n    class M resume;\n\n    style A fill:#f9f,stroke:#333,stroke-width:2px;\n    style B fill:#ffb,stroke:#333,stroke-width:2px;\n    style C fill:#bbf,stroke:#333,stroke-width:2px;\n    style D fill:#bfb,stroke:#333,stroke-width:2px;\n    style E fill:#bff,stroke:#333,stroke-width:2px;\n    style F fill:#fbf,stroke:#333,stroke-width:2px;\n    style G fill:#f9f,stroke:#333,stroke-width:2px;\n    style H fill:#ffb,stroke:#333,stroke-width:2px;\n    style I fill:#bbf,stroke:#333,stroke-width:2px;\n    style J fill:#9f6,stroke:#333,stroke-width:2px;\n    style K fill:#ffb,stroke:#333,stroke-width:2px;\n    style L fill:#ff6,stroke:#333,stroke-width:2px;\n    style M fill:#9f9,stroke:#333,stroke-width:2px;\n```\n\n## Features\n\n-   **Synchronise MEI Data**: Automatically fetch and populate MEI data in Google Sheets.\n-   **Rate Limiting**: Built-in rate limiting to prevent overloading the API.\n-   **Data Validation**: Ensures valid CNPJ formats and handles errors gracefully.\n-   **Logging**: Comprehensive logging for monitoring and troubleshooting.\n-   **Configurable**: Easily set up and customise the spreadsheet.\n\n## Installation\n\n### Prerequisites\n\n-   Node.js 14.17.0 or higher\n-   Google Apps Script environment for the Google Sheets add-on\n-   A valid API key from ReceitaWS\n\n### Steps\n\n1. **Clone the repository**\n\n    ```bash\n    git clone https://github.com/takk8is/sincromei.git\n    cd sincromei\n    ```\n\n2. **Install dependencies**\n\n    ```bash\n    npm install\n    ```\n\n3. **Set up environment variables**\n   Create a `.env` file in the root directory and add your API key:\n\n    ```\n    API_PORT=8001\n    API_URL=your_api_url_here\n    RECEITAWS_API_KEY=your_api_key_here\n    ```\n\n4. **Start the server**\n\n    ```bash\n    npm start\n    ```\n\n5. **Set up Google Apps Script**\n    - Copy the contents of `Code.gs` into a new Google Apps Script project linked to your Google Sheets.\n    - Deploy the script as a web app or execute functions directly from the Google Apps Script editor.\n\n## Usage\n\n### Google Sheets Add-on\n\n1. **Open your Google Sheets**\n2. **Access the SincroMEI menu**\n    - Configure your spreadsheet by selecting `Configurar Planilha`.\n    - Start the synchronisation by selecting `Iniciar Sincronização`.\n    - Pause the synchronisation by selecting `Pausar Sincronização`.\n\n### API Endpoints\n\n-   **Health Check**\n\n    ```http\n    GET /health\n    ```\n\n    Check the health status of the API.\n\n-   **Fetch MEI Data**\n    ```http\n    GET /sincromei/:cnpj\n    ```\n    Fetch MEI data for a given CNPJ.\n\n## Contributing\n\nWe welcome contributions! Please follow these steps:\n\n1. Fork the repository.\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`).\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`).\n4. Push to the branch (`git push origin feature/AmazingFeature`).\n5. Open a Pull Request.\n\n## License\n\nThis project is licensed under the Creative Commons Attribution 4.0 International License. See the [LICENSE](LICENSE) file for more details.\n\n## Support\n\nIf you have any questions or need support, please open an issue on [GitHub](https://github.com/takk8is/sincromei/issues).\n\n## Donate\n\nSupport the project with USDT (TRC-20):\n\n```\nTGpiWetnYK2VQpxNGPR27D9vfM6Mei5vNA\n```\n\nFeel free to adjust any sections to better fit the specific needs or style preferences of your repository.\n\n## About Takk™ Innovate Studio\n\nLeading the Digital Revolution as the Pioneering 100% Artificial Intelligence Team.\n\n-   Copyright (c) Takk™ Innovate Studio\n-   Author: David C Cavalcante\n-   Email: say@takk.ag\n-   LinkedIn: https://www.linkedin.com/in/hellodav/\n-   Medium: https://medium.com/@davcavalcante/\n-   Website: https://takk.ag/\n-   Twitter: https://twitter.com/takk8is/\n-   Medium: https://takk8is.medium.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakk8is%2Fsincromei","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakk8is%2Fsincromei","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakk8is%2Fsincromei/lists"}