# Project plan — matchcentre.footprintapp.net

Evidence date: 2026-10-09.

Source repository: `git@bitbucket.org:overdrive/matchcentre.footprintapp.net.git`.

Inspected tree: local checkout `E:\backup\sonar_scan\repos\matchcentre.footprintapp.net`, branch `master`, commit `3bd3534` (2023-01-13, "Changes to styling"). That commit is also `origin/master` and `origin/HEAD`.

The task metadata named `~/projects/sonar_scan/repos/matchcentre.footprintapp.net`. That path was not present on this host. The tree above matches the origin remote and the recorded tip `3bd3534`.

`origin/dev-19-10-2022`, `origin/qa`, and `origin/prod` are ahead of `master`. `origin/prod` tip is `160e70b` (2023-02-08, "Merge branch 'qa' into prod"). Product behaviour that exists only on those branches is called out below as **Implemented on prod/qa, not on master**.

No `silicon_ark/matchcentre.footprintapp.net/` directory existed before this document set. The source repository has no README and no product requirements document.

Provenance labels used here: **Documented**, **Implemented**, **Inferred**, **Planned**, **Unknown**.

## Objectives

**Inferred from the implementation, not from a written objective.**

The running application is a public SA Rugby match centre. The default layout title is "SA Rugby - Official Home of the Springboks" and the header image is `/wp-content/FP-MatchCentre-Banner01.jpg` (`application/layouts/default.phtml`).

What the code does:

- List tournaments and open a tournament profile (log, matches, teams, stats).
- Show a match, its officials, line-up, commentary, and a downloadable match report.
- Cache tournament, log, squad, and result payloads as JSON under `public/archives`.
- Accept a Blue Card concussion consent submission and email the applicant plus union contacts.
- Expose a venue food-menu browser under the `menu` module.

A written product objective, owner, or success measure was not found. **Unknown / Requires Confirmation.**

## Scope

### In this repository

**Implemented** on `master`:

- Zend Framework 1 application (`library/Zend/Version.php` reports `1.11.10`).
- Modules under `application/modules`: `default`, `menu`, `bluecard`, `companiesold`, `companyonl`.
- MySQL access through `Zend_Db` (`application/configs/application.ini`).
- AWS CodeDeploy packaging for the `qa` and `prod` Bitbucket branches (`bitbucket-pipelines.yml`, `appspec.yml`, `codedeploy_deploy.py`).
- A second full tree at `website/` (15,545 tracked paths), including its own `application/` and `public/`. Relationship to the served site is **Unknown / Requires Confirmation**. The root `.htaccess` rewrites requests into `public/`, and `public/index.php` bootstraps the root `application/` tree.

### Not established

- Whether the site is still deployed or still receiving traffic. Last commit on `master` is 2023-01-13. Last commit on `origin/prod` is 2023-02-08.
- Which host name is live. The repository slug is `matchcentre.footprintapp.net`. CodeDeploy copies files to `/mnt/data/www/html/footprintapp.net/matchcenter.footprintapp.net/` (spelling `matchcenter`, one "e" in "center"). **Requires Confirmation** which spelling is the live vhost.
- A product roadmap. Nothing in the repository describes future work. Nothing in this document is **Planned**.

## System architecture

**Implemented.**

```text
Browser
  -> Apache httpd (CodeDeploy start_server runs `service httpd start`)
  -> root .htaccess rewrite into public/
  -> public/index.php (Zend_Application, env default production)
  -> application/modules/{module}/{controller}/{action}
  -> MySQL database named teamwizz_SARU on host localhost
  -> JSON and JPEG files under public/archives (UPDATE_PATH)
```

Parallel calls, where the action exists:

- Match-report PDF: server fetches HTML from `https://footprintapp.net/pdf/matchreport/id/{id}` and streams a DOMPDF file.
- Blue Card mail: `Zend_Mail` with PDF attachments read from `public/archives/bluecard/`.
- Accreditation queue (`CronController::queingAction`): HTTP POST to `https://fsrugby.appwizard.co.za/scripts/AppWiz.dll` when category `AC` is 14. The model classes that action constructs are not in `application/models`. See technical documentation.

Google Analytics tag `UA-125030318-1` is in the default layout.

## Major components

| Component | Role | Evidence | Status |
|---|---|---|---|
| `default` module | Public match centre: home, tournament, match, team, news, login, ajax refresh, cron | `application/modules/default` | **Implemented** |
| `bluecard` module | Concussion Blue Card consent form and email | `application/modules/bluecard` | **Implemented** |
| `menu` module | Venue food sessions, items, nutrition, allergens | `application/modules/menu` | **Implemented** |
| `companiesold`, `companyonl` | Company registration, permits, organisation profile, a second login | those module trees | **Implemented** as code. Product status **Unknown**. Layout files named after those modules are not in `application/layouts` |
| `website/` | Second Zend tree plus public assets, tracked in git | `git ls-files website` count 15,545 | **Implemented** as files. Serving role **Unknown** |
| Vendored Zend 1.11.10 and `library/PG` | Framework and local plugins (layout picker, mail layout, image upload, FPDF) | `library/Zend`, `library/PG` | **Implemented** |
| JSON archive cache | Tournament, log, squad, and result snapshots | `UPDATE_PATH` in `public/index.php`, gitignored `public/archives/` | **Implemented** |
| CodeDeploy pipeline | Zip repo and deploy on `qa` and `prod` pushes | `bitbucket-pipelines.yml` | **Implemented**. `master` has no pipeline step |

## Milestones

These are git facts, not a published plan.

| When | Commit / ref | What changed |
|---|---|---|
| 2022-07-05 | `80a080d`, `502c4db` | Two "Initial commit" revisions. Authors in history: Heinrich du Plessis and `heinrichoverdrive` |
| 2022-10-19 | `508d928`, `4bbe1d0`, `cd165ad` | Appspec path and `application.ini` updates on the early history |
| 2023-01-13 | `3bd3534` | `master` tip. Message: "Changes to styling" |
| 2023-01-13 to 2023-02-08 | `origin/dev-19-10-2022`, then merged to `qa` and `prod` | Header banner fix; tournament query changed to include competitions by end date; styling. Not contained in `master` |

## Implementation plan

No implementation plan is stored in the repository.

**Unknown / Requires Confirmation:** whether further development is expected, and whether `master` or `prod` is the branch operators treat as current.

Observed delivery path, **Implemented** for `qa` and `prod` only:

1. Push to branch `qa` or `prod`.
2. Bitbucket Pipelines (image `python:3.5.7`) installs `zip` and `boto3==1.3.0`, zips the working tree to `/tmp/artifact.zip`, and runs `codedeploy_deploy.py`.
3. The script uploads the zip to S3 and calls AWS CodeDeploy `create_deployment`.
4. On the instance, appspec hooks install httpd if needed, stop httpd, copy the tree, and start httpd.

`master` is not listed under `pipelines.branches`. A push to `master` does not run that pipeline.

## Known dependencies

| Dependency | Where stated | Provenance |
|---|---|---|
| PHP with the Zend Framework 1.11.10 tree vendored in-repo | `public/index.php`, `library/Zend/Version.php` | **Implemented**. Required PHP version is **Unknown** |
| Apache httpd | `scripts/install_dependencies`, `scripts/start_server`, `scripts/stop_server` | **Implemented** |
| MySQL, database name `teamwizz_SARU`, host `localhost` | `application/configs/application.ini` | **Implemented**. Username and password are in that tracked file and are intentionally omitted here |
| PDO MySQL (`pdo_mysql`) | same ini | **Implemented** |
| AWS CodeDeploy, S3, and pipeline variables `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_DEFAULT_REGION`, `APPLICATION_NAME`, `DEPLOYMENT_GROUP_NAME`, `S3_BUCKET` | `bitbucket-pipelines.yml` | **Implemented** as names. Values are not in the repo |
| DOMPDF under `public/dompdf` | `TournamentsController::getmatchreportAction`, `CronController::addtozip` | **Implemented** |
| `https://footprintapp.net` match-report HTML | `TournamentsController::getmatchreportAction` | **Implemented** |
| `https://fsrugby.appwizard.co.za/scripts/AppWiz.dll` | `CronController::senddata_to_Api` | **Implemented** call. Caller models missing from `application/models` |
| Google Fonts, Font Awesome CDN, Google Analytics | `application/layouts/default.phtml` | **Implemented** |
| SonarQube at `https://scan.appmonitor.co.za`, project key `overdrive_matchcentre_footprintapp_net` | `sonar-project.properties`, `sonarqube_scan.bat` | **Implemented** as scan config. Not part of the Bitbucket pipeline |

No `composer.json` and no `package.json` were found at the repository root.

## Current project status

**Implemented** repository state on 2026-10-09:

- `master` is the remote HEAD and is 7 commits behind `origin/prod` (`git log master..origin/prod`).
- The `master` home action forces the tournament year to 2019 (`date("2019")` in `IndexController::indexAction`) and prints that year into the response.
- On `origin/prod`, that force is commented out, the year defaults to the calendar year, and tournament selection uses an end-date window. Grouping uses the tournament `EndDate` year rather than `StartDate`.
- There is no automated product test suite. `test/` is a small static PHP/FastCGI/SSI sample, not application tests.
- Several controllers call classes that are not files under `application/models` (`Model_Credentials`, `Model_Assessments`, `Model_AccreditationsApplications`, `Model_AccreditationZone`, `Model_AccreditationQueing`, `Model_DbTable_Countries`). Those actions cannot complete unless the class is loaded from somewhere else. **Requires Confirmation.**

## Human confirmation

1. Is `origin/prod` (`160e70b`) or `master` (`3bd3534`) the branch that production serves?
2. Is the live host `matchcentre.footprintapp.net`, `matchcenter.footprintapp.net`, or another name?
3. Is `website/` served, archived, or unused?
4. Are the company modules and the accreditation cron still in use?
5. Should the plaintext database credentials in the tracked `application.ini` be rotated? Values are not copied into Silicon Ark.
