How jotace5/hsn-org-chart-osv- works
Project Type and Purpose
• This is a full-stack web application designed to visually map and display the organizational structure of the Argentine National Congress. It provides an interactive organizational chart, search functionality, and automated data extraction to populate and update its database.
• The README outlines its features (hierarchical visualization, search, exports) while the file tree shows clear separations between the frontend, backend implementations, data processing tools, and documentation.
Directory Structure
a. Frontend:
• Folder “frontend” includes HTML (index.html, test.html) and CSS (styles.css) files.
• The “backend/build” folder contains “d3-org-chart.js” which implies that D3 (or a related library) is used to generate interactive charts.
b. Backend:
• The “hsn_orgchart” directory shows a Django project structure (manage.py, settings.py, urls.py, wsgi.py/asgi.py) with an app (“hsn_users”) that has templates, static assets (CSS, JavaScript), and migration files.
• Additional Node-based backend files exist (backend/app.js) which could either serve special API endpoints or handle separate chart rendering logic.
c. Data and ETL:
• The “data” directory contains Excel files, a database file (hsn_dosa_database.db), and ETL script “database_import.py”, indicating processes for extracting and importing data.
• The “scripts” folder includes a Jupyter Notebook (etl-excel_to_csv.ipynb) tied to ETL processes.
d. Documentation:
• The “docs” directory contains planning documents, feature clarifications, and other stakeholder-related documentation.
a. Main Components:
• User Interface (Frontend): Represented by the “frontend” folder and static assets, along with interactive D3 charts.
• Web Server / Application Backend: The Django project (“hsn_orgchart”) that handles business logic, API endpoints, and renders pages. Additionally, include the “hsn_users” app as a sub-component for user management and internal administrative functions.
• Data Processing/ETL Layer: Scripts and Python ETL tools in “data” and “scripts” that extract, transform, and load organization data into the database.
• Database: The SQLite database (hsn_dosa_database.db) where the organizational structure data reside.
• Optional/Additional API/Services: “backend/app.js” (potentially Node.js-based service) and the d3-org-chart build file indicate further support for data visualization or integration services.
b. Relationships and Interactions:
• The Frontend (web pages and D3 charts) interacts with the Django backend via HTTP requests/REST API calls.
• The Django backend (hsn_orgchart) processes user requests, querying or updating the Database.
• The ETL scripts periodically or on-demand extract data from Excel files, transform them, and load them into the Database.
• If the Node.js component (backend/app.js) is functioning as an additional microservice or a data pre-processor, then show its interaction with the Frontend and possibly the Database.
• Documentation and planning files provide context but are external to the deployment architecture.
c. Architectural Patterns and Technologies:
• MVC (Model-View-Controller) pattern is evident in the Django structure.
• ETL processes represent a data pipeline pattern.
• Use of D3 (or d3-org-chart) for interactive visualization is key in the frontend.
• The system emphasizes separation of concerns: presentation layer (frontend), application logic layer (backend via Django), and data/integration layer (ETL scripts and database).
• Frontend Web Client [HTML, CSS, JavaScript (D3 visualizations)] → communicates with → Django Web Server (hsn_orgchart, hsn_users)
• Django Web Server → interacts with → Database (hsn_dosa_database.db) using ORM
• ETL/Data Extraction Scripts → feed data → Database
• Optionally, Node.js backend components → support visualization services or serve specialized endpoints
• API endpoints, search features, and export functionalities are key interactions between the client and server.