# TinyQC - Quality Control Management System A CodeIgniter 4 PHP application for quality control data management in laboratory settings. Built with Tailwind CSS, Alpine.js, and DaisyUI. ## Features - **Dictionary Management**: Maintain departments, tests, and control parameters - **Control Management**: Configure and manage quality control standards - **Daily Entries**: Record daily quality control test results - **Monthly Entries**: Aggregate and track monthly quality control data - **Comments System**: Add notes and comments to results - **Reporting**: Generate quality control reports and analysis ## Technology Stack | Layer | Technology | |-------|------------| | Backend | CodeIgniter 4 (PHP 8.1+) | | Database | SQL Server | | Frontend | TailwindCSS + Alpine.js + DaisyUI | | Icons | FontAwesome 7 | | Testing | PHPUnit | ## Requirements - PHP 8.1 or higher - SQL Server 2016+ - Composer - Web server (Apache/Nginx/IIS) ## Installation 1. **Clone the repository** ```bash git clone tinyqc cd tinyqc ``` 2. **Install dependencies** ```bash composer install ``` 3. **Configure environment** ```bash copy env .env ``` Edit `.env` with your database settings: ```env database.default.hostname = localhost database.default.port = 1433 database.default.database = tinyqc database.default.username = sa database.default.password = your_password database.default.DBDriver = SQLSRV ``` 4. **Set up database** - Create a new SQL Server database - Run migrations if applicable - Seed initial data if needed 5. **Configure web server** Point your web server to the `public` directory: ```apache ServerName tinyqc.local DocumentRoot "D:/data/www/tinyqc/public" AllowOverride All Require all granted ``` 6. **Access the application** Open http://localhost in your browser ## Project Structure ``` tinyqc/ ├── app/ │ ├── Config/ # Configuration files │ │ ├── Database.php # Database settings │ │ └── Routes.php # Route definitions │ ├── Controllers/ # Application controllers │ │ ├── Api/ # API controllers │ │ ├── Dashboard.php │ │ ├── Dept.php │ │ ├── Test.php │ │ ├── Control.php │ │ ├── Entry.php │ │ ├── PageController.php │ │ └── Report.php │ ├── Models/ # Database models │ │ ├── DictDeptModel.php │ │ ├── DictTestModel.php │ │ ├── DictControlModel.php │ │ ├── ControlModel.php │ │ ├── ControlTestModel.php │ │ ├── DailyResultModel.php │ │ └── ... │ └── Views/ # View templates │ ├── layout/ # Layout templates │ ├── dashboard.php │ ├── dept/ # Department views │ ├── test/ # Test views │ ├── control/ # Control views │ ├── entry/ # Entry views │ └── report/ # Report views ├── public/ # Web root ├── tests/ # Unit tests ├── writable/ # Writable directory ├── env # Environment template ├── composer.json └── phpunit.xml.dist ``` ## Usage ### Dashboard The main dashboard provides an overview of quality control status and quick access to all modules. ### Dictionary Management - **Departments**: Manage department/category entries - **Tests**: Maintain test parameters and specifications - **Controls**: Configure control standards and limits ### Data Entry - **Daily Entry**: Record daily QC test results - **Monthly Entry**: Aggregate monthly data and comments ### Reports Generate quality control reports based on: - Date ranges - Test types - Control parameters ## API Endpoints | Method | Endpoint | Description | |--------|----------|-------------| | GET | /api/dept | List departments | | GET | /api/dept/:id | Get department details | | POST | /api/dept | Create department | | PUT | /api/dept/:id | Update department | | DELETE | /api/dept/:id | Delete department | | GET | /api/test | List tests | | GET | /api/test/:id | Get test details | | POST | /api/test | Create test | | PUT | /api/test/:id | Update test | | DELETE | /api/test/:id | Delete test | | GET | /api/control | List controls | | GET | /api/control/:id | Get control details | | POST | /api/control | Create control | | PUT | /api/control/:id | Update control | | DELETE | /api/control/:id | Delete control | | GET | /api/entry/controls | Get controls for entry | | GET | /api/entry/tests | Get tests for entry | | POST | /api/entry/daily | Save daily result | | POST | /api/entry/monthly | Save monthly entry | | POST | /api/entry/comment | Save comment | ## Development ### Running Tests ```bash # Run all tests ./vendor/bin/phpunit # Run with coverage ./vendor/bin/phpunit --coverage-html coverage/ ``` ### Code Style Follow these guidelines: - PSR-12 coding standards - CamelCase for variables/functions - PascalCase for classes - snake_case for database tables/columns ### Adding New Features 1. Create model in `app/Models/` 2. Create API controller in `app/Controllers/Api/` 3. Add routes in `app/Config/Routes.php` 4. Create views in `app/Views/[module]/` 5. Add menu item in layout if needed ## Documentation - [agent1.md](agent1.md) - Complete development guide - [VIEWS_RULES.md](VIEWS_RULES.md) - View patterns and conventions ## License This project is proprietary software. ## Support For support, please contact the development team.