{"id":32994675,"url":"https://github.com/salaheddine-ghannouch/data_explorer_module","last_synced_at":"2026-05-14T13:33:32.206Z","repository":{"id":323548900,"uuid":"1093714360","full_name":"SalahEddine-Ghannouch/Data_explorer_module","owner":"SalahEddine-Ghannouch","description":"A custom Drupal module that visualizes and analyzes the database structure. It maps relationships between entity tables, field tables, and revisions in an interactive graph view. The tool lets developers search where specific data is stored and preview joined results directly in the admin UI.","archived":false,"fork":false,"pushed_at":"2025-11-10T18:39:18.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-10T20:29:58.113Z","etag":null,"topics":["cms","drupal","twig"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SalahEddine-Ghannouch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-10T18:34:50.000Z","updated_at":"2025-11-10T18:40:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/SalahEddine-Ghannouch/Data_explorer_module","commit_stats":null,"previous_names":["salaheddine-ghannouch/data_explorer_module"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/SalahEddine-Ghannouch/Data_explorer_module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalahEddine-Ghannouch%2FData_explorer_module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalahEddine-Ghannouch%2FData_explorer_module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalahEddine-Ghannouch%2FData_explorer_module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalahEddine-Ghannouch%2FData_explorer_module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SalahEddine-Ghannouch","download_url":"https://codeload.github.com/SalahEddine-Ghannouch/Data_explorer_module/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalahEddine-Ghannouch%2FData_explorer_module/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284202058,"owners_count":26964370,"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","status":"online","status_checked_at":"2025-11-13T02:00:06.582Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cms","drupal","twig"],"created_at":"2025-11-13T11:01:02.334Z","updated_at":"2025-11-13T11:01:08.078Z","avatar_url":"https://github.com/SalahEddine-Ghannouch.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Drupal Data Explorer Module\n\nA custom Drupal module that visualizes and analyzes the database structure. It maps relationships between entity tables, field tables, and revisions in an interactive graph view. The tool lets developers search where specific data is stored and preview joined results directly in the admin UI.\n\n## Features\n\n### 🔍 Schema Explorer\nAuto-scans Drupal tables (node__, taxonomy__, users__, etc.) and shows entity–field relationships.\n\n### 🕸️ Visual Relationship Graph\nInteractive graph view showing relationships between base tables and their field tables (like node_field_data → node__body, etc.).\n\n### 🧾 Smart Query Builder\nGUI that lets you pick an entity (e.g. Node → Article), choose fields, and auto-build SQL queries with JOINs.\n\n### 💾 Data Exporter\nExport joined results as CSV/JSON (useful for content migration or debugging).\n\n### 🧠 Search by Field or Value\nSearch \"where is this string stored?\" → the tool scans tables to find possible locations (like finding the field where \"Welcome to Inwi\" is saved).\n\n### ⚙️ Drupal Integration Mode\nWorks as a Drupal admin module (accessible at `/admin/tools/data-explorer`).\n\n## Installation\n\n1. Copy the `data_explorer` module to your Drupal installation:\n   ```\n   modules/custom/data_explorer/\n   ```\n\n2. Enable the module:\n   - Via Drush: `drush en data_explorer`\n   - Via Admin UI: Go to Extend (`/admin/modules`), find \"Data Explorer\" and enable it\n\n3. Grant permissions:\n   - Go to People → Permissions (`/admin/people/permissions`)\n   - Grant \"Access Data Explorer\" permission to appropriate roles\n\n## Usage\n\n### Accessing the Tool\n\nNavigate to `/admin/tools/data-explorer` in your Drupal site.\n\n### Schema Explorer Tab\n\n- Automatically displays all Drupal tables organized by entity type\n- Shows table types (base, data, field_data, revision, etc.)\n- Lists all columns for each table with their data types\n\n### Relationship Graph Tab\n\n- Visualizes relationships between:\n  - Base tables and data tables\n  - Entity tables and field tables\n  - Revision tables and revision data tables\n- Filter by entity type to focus on specific entities\n\n### Query Builder Tab\n\n1. Select an entity type (e.g., Node, User, Taxonomy Term)\n2. Optionally select a bundle (e.g., Article, Page)\n3. Choose fields to include in the query\n4. Click \"Build \u0026 Execute Query\" to see results\n5. Export results as CSV or JSON\n\n### Search Tab\n\n**Search by Value:**\n- Enter a search term (e.g., \"Welcome to Inwi\")\n- The tool searches across all string columns in all tables\n- Results show which tables contain the value and matching rows\n\n**Search by Field Name:**\n- Enter a field or table name\n- Results show matching tables and columns\n\n## API Endpoints\n\nThe module provides JSON API endpoints for programmatic access:\n\n- `GET /admin/tools/data-explorer/api/schema` - Get full database schema\n- `GET /admin/tools/data-explorer/api/relationships?entity_type=node\u0026bundle=article` - Get relationships\n- `GET /admin/tools/data-explorer/api/search?term=search_term\u0026type=value` - Search database\n- `POST /admin/tools/data-explorer/api/query` - Execute a query (body: `{\"query\": \"SELECT ...\"}`)\n\n## Security\n\n- Only users with \"Access Data Explorer\" permission can use the tool\n- Query execution only allows SELECT queries\n- Dangerous SQL keywords (DROP, DELETE, UPDATE, etc.) are blocked\n- All queries are executed through Drupal's database abstraction layer\n\n## Requirements\n\n- Drupal 9, 10, or 11\n- PHP 7.4 or higher\n\n## Development\n\n### File Structure\n\n```\ndata_explorer/\n├── data_explorer.info.yml          # Module definition\n├── data_explorer.module            # Module hooks\n├── data_explorer.routing.yml       # Routes\n├── data_explorer.services.yml      # Service definitions\n├── data_explorer.libraries.yml      # Asset libraries\n├── src/\n│   ├── Controller/\n│   │   ├── DataExplorerController.php      # Main page controller\n│   │   └── DataExplorerApiController.php   # API endpoints\n│   └── Service/\n│       ├── SchemaExplorerService.php       # Schema scanning\n│       ├── RelationshipMapperService.php   # Relationship mapping\n│       ├── QueryBuilderService.php         # Query building\n│       ├── DataExporterService.php         # Data export\n│       └── SearchService.php               # Search functionality\n├── css/\n│   └── data-explorer.css           # Styles\n└── js/\n    └── data-explorer.js            # Frontend JavaScript\n```\n\n### Extending the Module\n\nTo add a custom visualization library (e.g., D3.js or vis.js) for the relationship graph:\n\n1. Add the library to `data_explorer.libraries.yml`\n2. Update `js/data-explorer.js` in the `renderRelationshipGraph()` function\n3. Enhance the graph visualization with interactive features\n\n## Troubleshooting\n\n**Module not appearing in Extend list:**\n- Ensure the module is in `modules/custom/data_explorer/`\n- Clear Drupal cache: `drush cr`\n\n**Permission denied:**\n- Grant \"Access Data Explorer\" permission to your user role\n\n**No tables showing:**\n- Ensure you have entities in your Drupal site\n- Check database connection is working\n\n**Query errors:**\n- Only SELECT queries are allowed\n- Check that table names are correct\n- Ensure proper JOIN syntax\n\n## License\n\nThis is a custom module. Modify as needed for your project.\n\n## Support\n\nFor issues or questions, check the Drupal logs at `/admin/reports/dblog`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalaheddine-ghannouch%2Fdata_explorer_module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalaheddine-ghannouch%2Fdata_explorer_module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalaheddine-ghannouch%2Fdata_explorer_module/lists"}