The 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.
graph TD
A["Start Synchronisation"] --> B["Validate CNPJ"]
B --> C["Send Request to ReceitaWS"]
C --> D["Receive Response from ReceitaWS"]
D --> E["Format Received Data"]
E --> F["Insert Data into Spreadsheet"]
F --> G["Mark Row as Processed"]
G --> H["Check Execution Time"]
H --> I["Wait for Next Batch"]
I --> J["Synchronization Complete"]
I --> K["Maximum Execution Time Reached"]
K --> L["Pause Synchronisation"]
L --> M["Resume Synchronisation"]
classDef start fill:#f9f,stroke:#333,stroke-width:2px;
classDef validate fill:#ffb,stroke:#333,stroke-width:2px;
classDef send fill:#bbf,stroke:#333,stroke-width:2px;
classDef receive fill:#bfb,stroke:#333,stroke-width:2px;
classDef format fill:#bff,stroke:#333,stroke-width:2px;
classDef insert fill:#fbf,stroke:#333,stroke-width:2px;
classDef mark fill:#f9f,stroke:#333,stroke-width:2px;
classDef check fill:#ffb,stroke:#333,stroke-width:2px;
classDef wait fill:#bbf,stroke:#333,stroke-width:2px;
classDef complete fill:#9f6,stroke:#333,stroke-width:2px;
classDef pause fill:#ff6,stroke:#333,stroke-width:2px;
classDef resume fill:#9f9,stroke:#333,stroke-width:2px;
class A start;
class B validate;
class C send;
class D receive;
class E format;
class F insert;
class G mark;
class H check;
class I wait;
class J complete;
class K check;
class L pause;
class M resume;
style A fill:#f9f,stroke:#333,stroke-width:2px;
style B fill:#ffb,stroke:#333,stroke-width:2px;
style C fill:#bbf,stroke:#333,stroke-width:2px;
style D fill:#bfb,stroke:#333,stroke-width:2px;
style E fill:#bff,stroke:#333,stroke-width:2px;
style F fill:#fbf,stroke:#333,stroke-width:2px;
style G fill:#f9f,stroke:#333,stroke-width:2px;
style H fill:#ffb,stroke:#333,stroke-width:2px;
style I fill:#bbf,stroke:#333,stroke-width:2px;
style J fill:#9f6,stroke:#333,stroke-width:2px;
style K fill:#ffb,stroke:#333,stroke-width:2px;
style L fill:#ff6,stroke:#333,stroke-width:2px;
style M fill:#9f9,stroke:#333,stroke-width:2px;
- Synchronise MEI Data: Automatically fetch and populate MEI data in Google Sheets.
- Rate Limiting: Built-in rate limiting to prevent overloading the API.
- Data Validation: Ensures valid CNPJ formats and handles errors gracefully.
- Logging: Comprehensive logging for monitoring and troubleshooting.
- Configurable: Easily set up and customise the spreadsheet.
- Node.js 14.17.0 or higher
- Google Apps Script environment for the Google Sheets add-on
- A valid API key from ReceitaWS
-
Clone the repository
git clone https://github.com/takk8is/sincromei.git cd sincromei
-
Install dependencies
npm install
-
Set up environment variables Create a
.env
file in the root directory and add your API key:API_PORT=8001 API_URL=your_api_url_here RECEITAWS_API_KEY=your_api_key_here
-
Start the server
npm start
-
Set up Google Apps Script
- Copy the contents of
Code.gs
into a new Google Apps Script project linked to your Google Sheets. - Deploy the script as a web app or execute functions directly from the Google Apps Script editor.
- Copy the contents of
- Open your Google Sheets
- Access the SincroMEI menu
- Configure your spreadsheet by selecting
Configurar Planilha
. - Start the synchronisation by selecting
Iniciar Sincronização
. - Pause the synchronisation by selecting
Pausar Sincronização
.
- Configure your spreadsheet by selecting
-
Health Check
GET /health
Check the health status of the API.
-
Fetch MEI Data
GET /sincromei/:cnpj
Fetch MEI data for a given CNPJ.
We welcome contributions! Please follow these steps:
- Fork the repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a Pull Request.
This project is licensed under the Creative Commons Attribution 4.0 International License. See the LICENSE file for more details.
If you have any questions or need support, please open an issue on GitHub.
Support the project with USDT (TRC-20):
TGpiWetnYK2VQpxNGPR27D9vfM6Mei5vNA
Feel free to adjust any sections to better fit the specific needs or style preferences of your repository.
Leading the Digital Revolution as the Pioneering 100% Artificial Intelligence Team.
- Copyright (c) Takk™ Innovate Studio
- Author: David C Cavalcante
- Email: say@takk.ag
- LinkedIn: https://www.linkedin.com/in/hellodav/
- Medium: https://medium.com/@davcavalcante/
- Website: https://takk.ag/
- Twitter: https://twitter.com/takk8is/
- Medium: https://takk8is.medium.com/