How jao-viquitor/intuitive works
Project Type & Purpose
• The project is a full-stack web application aimed at analyzing and visualizing public health operator (ANS) data.
• Its key functionalities include data preprocessing of CSV files (from ANS), a Flask-based REST API backend (with MySQL as the data store), and a Vue 3 Single-Page Application (SPA) frontend.
• Use cases include searching for operators, filtering by state, and displaying top operators based on health expenses.
Analyzing the File Structure
• Top-Level Directories:
• backend: Contains the Flask API (with files like api.py, config.py, db.py), utility scripts (preprocessamento.py), and API documentation via a Postman collection. This module handles business logic, data fetching, and database interactions.
• frontend: Holds the Vue 3 SPA with dedicated folders for components, pages, assets, routing, and services. Tailwind CSS and Vite configurations are utilized here.
• dados: Contains raw CSV data that are used for data processing.
• db: Contains SQL scripts to initialize schema and import data into MySQL.
• The separation of concerns (backend processing, frontend presentation, database setup, and data ingestion) is a key architectural element that must be clearly depicted.
Recommendations
a. Main Components:
• Frontend: Vue 3 SPA components, pages, routing (Vue Router) & services for API calls.
• Backend: Flask API handling endpoints, configuration and database connections, including pre-processing utilities.
• Database: MySQL database with its schema and import routines (SQL scripts).
• Data Ingestion: CSV files in 'dados/' that are preprocessed by a utility script (preprocessamento.py) before being loaded into the database.
• External Tools: Postman collection for testing API endpoints.
b. Relationships and Interactions:
• The Frontend interacts with the Backend via RESTful API calls (e.g., Axios is used in Vue services).
• The Backend communicates with MySQL using the connection parameters defined in configuration files, handling queries and updates.
• The Data Preprocessing module (found in backend/utils) ingests raw CSV files and prepares them for database import (executed prior to running the API).
• Interactions such as data flow from the data files (dados) → preprocessor → DB (MySQL) → API (Flask) → Frontend (Vue 3 SPA).
c. Architectural Patterns / Design Principles:
• Separation of concerns between backend and frontend.
• REST API principles in the Flask backend.
• SPA design in the Vue frontend that decouples UI rendering from business logic.
• Usage of modular design (components/ services in frontend; modular endpoints and configs in backend).
• Clear delineation of data processing pipelines from data ingestion to presentation.
d. Key Technologies and Frameworks:
• Backend: Python, Flask, MySQL, python-dotenv (for environment configuration), CORS for cross-domain requests.
• Frontend: Vue 3, Vite, Tailwind CSS, Axios, Vue Router.
• Data: CSV files from ANS, processed notably using Pandas (implied in preprocessamento.py).
• Utilities: Postman for API testing, environment management via .env files and virtual environments.
Elements
• Clear Labels: Every major component should be clearly labeled (such as "Vue 3 SPA", "Flask API", "MySQL Database", "Data Preprocessing", etc.).