tinyqc/docs/index.md
mahdahar 14baa6b758 docs: add comprehensive documentation and refactor API structure
This commit introduces a complete documentation suite, refactors the API layer for
better consistency, and updates the database schema and seeding logic.

Key Changes:
- Documentation:
  - Added `CLAUDE.md` with development guidelines and architecture overview.
  - Created `docs/` directory with detailed guides for architecture, development,
    and source tree analysis.
- Database & Migrations:
  - Implemented `RenameMasterColumns` migration to standardize column naming
    (e.g., `name` -> `dept_name`, `name` -> `control_name`).
  - Added `CmodQcSeeder` to populate the system with realistic sample data
    for depts, controls, tests, and results.
- Backend API:
  - Created `DashboardApiController` with `getRecent()` for dashboard stats.
  - Created `ReportApiController` for managed reporting access.
  - Updated `app/Config/Routes.php` with new API groupings and documentation routes.
- Frontend & Views:
  - Refactored master data views (`dept`, `test`, `control`) to use Alpine.js
    and the updated API structure.
  - Modernized `dashboard.php` and `main_layout.php` with improved UI/UX.
- Infrastructure:
  - Updated `.gitignore` to exclude development-specific artifacts (`_bmad/`, `.claude/`).
2026-01-20 14:44:46 +07:00

4.0 KiB

Project Documentation Index - TinyQC

Project Overview

  • Type: Monolith (single cohesive codebase)
  • Primary Language: PHP 8.1+
  • Architecture: MVC (Model-View-Controller)
  • Framework: CodeIgniter 4
  • Database: SQL Server 2016+

Quick Reference

  • Tech Stack: PHP 8.1, CodeIgniter 4, SQL Server, TailwindCSS, Alpine.js, DaisyUI
  • Entry Point: public/index.php
  • Architecture Pattern: Model-View-Controller (MVC)

Generated Documentation

Core Documentation

Supplementary Documentation


Documentation Guide

For New Developers

  1. Start with Project Overview to understand the system
  2. Review Architecture for component details
  3. Read Development Guide for setup instructions
  4. Use Source Tree Analysis for code navigation

For Feature Development

  1. Reference Architecture for patterns and conventions
  2. Check Source Tree Analysis for file locations
  3. Follow Development Guide for implementation steps

For API Development

  1. Review Architecture - API Design section
  2. Check existing API controllers in app/Controllers/Api/
  3. Follow naming conventions from Development Guide

Technology Stack Reference

Layer Technology
Backend PHP 8.1+
Framework CodeIgniter 4
Database SQL Server
Frontend TailwindCSS + Alpine.js + DaisyUI
Icons FontAwesome 7
Testing PHPUnit

Key Directories

Directory Purpose Documentation
app/Config/ Configuration files Source Tree
app/Controllers/ Request handlers Architecture
app/Models/ Data models Architecture
app/Views/ UI templates Architecture
public/ Web root Source Tree
tests/ Unit tests Development Guide

Common Tasks

Task Documentation
Setup development environment Development Guide - Installation
Add new feature Development Guide - Adding New Features
Run tests Development Guide - Running Tests
Database operations Development Guide - Database Operations
Debug application Development Guide - Debugging
Deploy to production Development Guide - Deployment

Module Documentation

Dictionary Management

  • Manage departments, tests, and control parameters
  • Controllers: Dept.php, Test.php, Control.php
  • API: DeptApiController.php, TestApiController.php, ControlApiController.php

Data Entry

  • Record daily and monthly QC results
  • Controller: Entry.php
  • API: EntryApiController.php

Reporting

  • Generate quality control reports
  • Controller: Report.php

API Endpoints Quick Reference

Endpoint Description
/api/dept Department CRUD
/api/test Test CRUD
/api/control Control CRUD
/api/entry/* Entry operations

See Architecture for detailed API documentation.


Documentation generated on 2026-01-20 For updates, run the document-project workflow