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

129 lines
4.0 KiB
Markdown

# 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
- [Project Overview](./project-overview.md) - Executive summary and technology stack
- [Architecture](./architecture.md) - Detailed architecture documentation
- [Source Tree Analysis](./source-tree-analysis.md) - Annotated directory structure
- [Development Guide](./development-guide.md) - Setup, development commands, and best practices
### Supplementary Documentation
- [README.md](../README.md) - Original project readme
---
## Documentation Guide
### For New Developers
1. Start with [Project Overview](./project-overview.md) to understand the system
2. Review [Architecture](./architecture.md) for component details
3. Read [Development Guide](./development-guide.md) for setup instructions
4. Use [Source Tree Analysis](./source-tree-analysis.md) for code navigation
### For Feature Development
1. Reference [Architecture](./architecture.md) for patterns and conventions
2. Check [Source Tree Analysis](./source-tree-analysis.md) for file locations
3. Follow [Development Guide](./development-guide.md) for implementation steps
### For API Development
1. Review [Architecture](./architecture.md) - API Design section
2. Check existing API controllers in `app/Controllers/Api/`
3. Follow naming conventions from [Development Guide](./development-guide.md)
---
## 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](./source-tree-analysis.md) |
| `app/Controllers/` | Request handlers | [Architecture](./architecture.md) |
| `app/Models/` | Data models | [Architecture](./architecture.md) |
| `app/Views/` | UI templates | [Architecture](./architecture.md) |
| `public/` | Web root | [Source Tree](./source-tree-analysis.md) |
| `tests/` | Unit tests | [Development Guide](./development-guide.md) |
---
## Common Tasks
| Task | Documentation |
|------|---------------|
| Setup development environment | [Development Guide - Installation](./development-guide.md#installation) |
| Add new feature | [Development Guide - Adding New Features](./development-guide.md#adding-new-features) |
| Run tests | [Development Guide - Running Tests](./development-guide.md#running-tests) |
| Database operations | [Development Guide - Database Operations](./development-guide.md#database-operations) |
| Debug application | [Development Guide - Debugging](./development-guide.md#debugging) |
| Deploy to production | [Development Guide - Deployment](./development-guide.md#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](./architecture.md) for detailed API documentation.
---
*Documentation generated on 2026-01-20*
*For updates, run the document-project workflow*