8.5 KiB
8.5 KiB
Technology Stack
Analysis Date: 2026-04-21
Languages
Primary:
- PHP >= 7.4 - Server-side application code (all
application/andaddons/) - JavaScript (ES5) - Frontend client code (
public/assets/js/)
Secondary:
- HTML/Think Template - View templates (
application/*/view/)
Runtime
Environment:
- PHP >= 7.4.0 (required by
composer.json) - Required extensions:
ext-json,ext-curl,ext-pdo,ext-bcmath
Package Manager:
- Composer - PHP dependency management; lockfile
composer.lockpresent - npm - Frontend dependency management;
node_modules/present - Lockfiles:
composer.lock(present),package-lock.json(not detected)
Frameworks
Core:
- ThinkPHP 5.x (dev-master from
https://gitee.com/fastadminnet/framework.git) - PHP MVC framework, the foundation of the entire application - FastAdmin 1.6.1 - Admin backend framework built on ThinkPHP + Bootstrap; actual internal version
1.6.2.20260323(fromapplication/config.phpfastadmin.version)
Frontend:
- RequireJS 2.x - AMD module loader for JavaScript (
public/assets/js/require-backend.js,require-frontend.js) - Bootstrap 3.4.1 (via
fastadmin-bootstrap) - UI component framework - jQuery 3.7.1 - DOM manipulation and AJAX
- AdminLTE - Admin dashboard theme (referenced in
require-backend.jspaths)
Testing:
- Not detected - No test framework configured (no PHPUnit, no
tests/directory)
Build/Dev:
- Grunt 1.5.3 - Task runner for frontend asset build
- requirejs optimizer (r.js) - JS/CSS minification via custom
application/admin/command/Min/r - uglify - JavaScript minification
- parse-config-file + jsonminify - RequireJS config parsing during build
Key Dependencies
Critical:
topthink/frameworkdev-master - ThinkPHP core framework (Gitee mirror)topthink/think-captcha^1.0.9 - CAPTCHA image generationtopthink/think-queue1.1.6 - Redis-backed job queue systemtopthink/think-helper^1.0.7 - ThinkPHP utility helpersfastadminnet/fastadmin-addons~1.4.0 - Plugin/addon systemfastadminnet/fastadmin-mailer^2.0.0 - Email sending
Infrastructure:
guzzlehttp/guzzle^7.10 - HTTP client for external API requests (used inapplication/index/controller/Index.phpto scrapemacaumarksix.com)overtrue/pinyin^3.0 - Chinese Pinyin conversionovertrue/wechat^4.6 - WeChat SDK integrationphpoffice/phpspreadsheet^1.29.1 - Excel/CSV import-export (used inapplication/admin/library/traits/Backend.phpimport()method)
Frontend Libraries (via npm):
fastadmin-bootstraptable^1.11.12 - Data table with search/sort/paginationfastadmin-layer^3.5.6 - Modal/overlay dialogsfastadmin-selectpage^1.1.1 - Select with autocompletefastadmin-nicevalidator^1.1.6 - Form validationeonasdan-bootstrap-datetimepicker^4.17.49 - Date/time pickerbootstrap-daterangepicker~2.1.25 - Date range pickerbootstrap-select^1.13.18 - Enhanced select dropdownjstree~3.3.2 - Tree view componentfont-awesome^4.6.1 - Icon fontmoment^2.10 - Date manipulationart-template(via fastadmin-arttemplate) ^3.1.4 - Template enginetoastr~2.1.3 - Notification toastsjquery-slimscroll~1.3.8 - Custom scrollbarjquery.cookie~1.4.1 - Cookie utilitysortablejs^1.12.0 - Drag and drop sortingfastadmin-dragsort^1.0.5 - Drag sort pluginfastadmin-addtabs^1.0.8 - Multi-tab navigationfastadmin-citypicker^1.3.6 - City selectorfastadmin-cxselect^1.4.0 - Cascading selectbootstrap-slider^11.0.2 - Range slidertableexport.jquery.plugin^1.20 - Table export to Excel/CSV/PDFrequire-css~0.1.8 - CSS loading via RequireJS
Configuration
Environment:
- Configuration via PHP arrays in
application/config.php,application/database.php,application/extra/*.php - Environment variable override via
think\Envclass (e.g.,Env::get('database.hostname', '127.0.0.1')) .envfile present for environment-specific overrides (secrets not inspected)- Key configs:
site.php(site settings, email SMTP),upload.php(file upload rules),queue.php(Redis connection),addons.php(plugin hooks/routes)
Build:
Gruntfile.js- Build orchestration- Build tasks:
deploy(copy libs from node_modules topublic/assets/libs/),frontend:js,backend:js,frontend:css,backend:css(RequireJS r.js optimization) - Default task:
grunt=['deploy', 'frontend:js', 'backend:js', 'frontend:css', 'backend:css'] - Output:
public/assets/js/require-backend.min.js,require-frontend.min.js, etc.
Platform Requirements
Development:
- PHP >= 7.4 with extensions: json, curl, pdo, bcmath
- MySQL database (utf8mb4 charset)
- Redis (for queue system)
- Node.js + npm (for frontend dependencies and Grunt build)
- Composer (for PHP dependencies)
.envfile configured with database credentials
Production:
- Self-hosted PHP deployment (no Docker detected)
- Apache or Nginx web server (with URL rewriting for ThinkPHP PATH_INFO)
- MySQL database with
fa_table prefix - Redis for queue processing (
think-queue) public/directory as web rootapplication/admin/command/Install/install.lockpresent - indicates installation completed
Module Structure
The application uses ThinkPHP multi-module architecture:
| Module | Purpose | Location |
|---|---|---|
admin |
Backend admin panel | application/admin/ |
index |
Frontend website | application/index/ |
api |
REST API endpoints | application/api/ |
common |
Shared code | application/common/ |
Recently Added Components
Num Controller/Model - New "数字波色" (number color/wave) feature:
- Controller:
D:\code\php\amlhc\application\admin\controller\Num.php- Returns number-to-color mapping viagetColorMap()API endpoint - Model:
D:\code\php\amlhc\application\admin\model\Num.php- Simple model forfa_numtable, no timestamp fields - Used by
history.jsfrontend to render colored number balls in lottery result tables
Command Controller/Model - Online CLI command management:
- Controller:
D:\code\php\amlhc\application\admin\controller\Command.php- CRUD for CLI commands (crud/menu/min/api generation and execution) - Model:
D:\code\php\amlhc\application\admin\model\Command.php- Tracks command execution history with integer timestamps, status tracking - Validate:
D:\code\php\amlhc\application\admin\validate\Command.php- Empty validation rules - Addon:
D:\code\php\amlhc\addons\command\- Plugin wrapper with menu installation viaaddons\command\Command.php - Output library:
D:\code\php\amlhc\addons\command\library\Output.php- Extends\think\console\Outputto capture command output - Frontend:
D:\code\php\amlhc\public\assets\js\backend\command.js- Complex UI with dynamic form, table field selection, relation config
History Controller/Model - Lottery history records:
- Controller:
D:\code\php\amlhc\application\admin\controller\History.php- Standard CRUD (inherits Backend trait) - Model:
D:\code\php\amlhc\application\admin\model\History.php- Simple model forfa_historytable, no timestamp fields - Validate:
D:\code\php\amlhc\application\admin\validate\History.php- Empty validation rules - Frontend:
D:\code\php\amlhc\public\assets\js\backend\history.js- Custom colored ball rendering, loads color map from Num API atnum/getColorMap - Index controller:
D:\code\php\amlhc\application\index\controller\Index.php-get_history()scrapeshttps://history.macaumarksix.com/history/macaujc2/y/2026using Guzzle
SQL Schema: D:\code\php\amlhc\sql\macaujc_history.sql - Defines macaujc_history table with full lottery record fields (expect, open_code, wave, zodiac, odd_even, big_small, etc.)
CLI Commands
Registered in application/command.php:
Crud- Code generator for CRUD operations (app\admin\command\Crud)Menu- Menu generator (app\admin\command\Menu)Install- Installation wizard (app\admin\command\Install)Min- Asset minification (app\admin\command\Min)Addon- Addon management (app\admin\command\Addon)Api- API documentation generator (app\admin\command\Api)
Custom Extensions (extend/fast/)
Located in extend/fast/:
Auth.php- Authentication and permission libraryDate.php- Date/time utilitiesForm.php- Form builder/generator (largest utility)Http.php- HTTP request utilitiesPinyin.php- Chinese pinyin wrapperRandom.php- Random string generationRsa.php- RSA encryption utilitiesTree.php- Tree data structure utilitiesVersion.php- Version comparison utilities
Stack analysis: 2026-04-21