# Auto-LLD QC **Auto-LLD QC** is a web-based spatial quality control (QC) tool designed to automate verification checks for fiber network designs. It connects to a PostGIS database and enables users to filter data by market and zone, then run various spatial QC checks via a clean map interface. ## πŸ—ΊοΈ What It Does - Allows users to select a **market** and **zone** from dropdowns to load relevant data. - Displays map data using **Leaflet.js** and **Turf.js**. - Enables multiple QC operations via user-triggered buttons: - **Graph connectivity** β€” ensures all segments are spatially connected. - **Single-span check** β€” validates that each segment has exactly two vertices. - **Underground termination check** β€” verifies underground segments end at a pole or handhole. - **Site presence and location** β€” confirms that sites exist and fall within the correct zone. ## 🧰 Tech Stack - **Frontend:** HTML, CSS, JavaScript, [Leaflet.js](https://leafletjs.com/), [Turf.js](https://turfjs.org/) - **Backend:** [Go (Golang)](https://golang.org/) with [Gin](https://github.com/gin-gonic/gin) - **Database:** PostgreSQL with PostGIS extension - **Deployment target:** Web application (self-hosted or internal use) --- ## πŸ“‚ Project Structure ```text auto-lld-qc/ β”œβ”€β”€ frontend/ β”‚ β”œβ”€β”€ index.html β”‚ β”œβ”€β”€ main.js β”‚ └── styles.css β”œβ”€β”€ backend/ β”‚ β”œβ”€β”€ main.go β”‚ β”œβ”€β”€ .env β”‚ β”œβ”€β”€ go.mod / go.sum β”‚ β”œβ”€β”€ models/ β”‚ β”‚ └── models.go β”‚ └── qc/ β”‚ β”œβ”€β”€ graph_connect.go β”‚ β”œβ”€β”€ handholes.go β”‚ └── segment_single_span.go βš™οΈ Setup & Usage Prerequisites Go 1.20+ PostgreSQL + PostGIS Node.js (optional, for frontend bundling or tooling) 1. Clone the repo bash Copy Edit git clone https://github.com/yourusername/auto-lld-qc.git cd auto-lld-qc 2. Configure environment In backend/.env, set the following variables: env Copy Edit DB_HOST=your-db-host DB_PORT=5432 DB_USER=your-user DB_PASSWORD=your-password DB_NAME=your-db 3. Run the backend bash Copy Edit cd backend go run main.go 4. Open the frontend Open frontend/index.html in a browser (or serve via a static file server like http-server or Gin). βœ… QC Features (Complete & Planned) Feature Status Graph connectivity check βœ… Done Segment single-span (2 vertices) βœ… Done Handhole/Pole connection check βœ… Done Site existence + zone inclusion ⏳ Planned Permit validation ⏳ Planned Access point location validation ⏳ Planned πŸ“Œ To-Do Complete remaining QC features (site checks, permits, access points) Add UI loading indicators and error handling Optionally dockerize for easier deployment Write unit tests for backend QC logic πŸ§‘β€πŸ’» Developer Notes Uses GORM for Go/Postgres ORM modeling. Turf.js handles spatial logic like intersections and geometry analysis on the frontend. Each QC module is implemented in a separate .go file under /qc, with a dedicated API route. Modular structure allows for easy addition of new QC checks. πŸ“ƒ License MIT License