# Project plan — react-php-tutorial

Evidence date: 2026-10-05.

Source repository: `git@bitbucket.org:overdrive/react-php-tutorial.git`.

Inspected revision: `master` at `d10301a` (2020-04-29, Uriel Balela, "add user, delete user"). The scan-host path `~/projects/sonar_scan/repos/react-php-tutorial` was not on this machine. The tree below was read from that git revision.

This plan describes what the repository contains. It does not decide what the product should become.

There is no README, project plan, or requirements document in the source repository, and there was no `react-php-tutorial/` directory in Silicon Ark before this set.

## Product

A small browser UI and a set of PHP scripts that create, sign in, list, and delete rows in a MySQL table named `user`. The navbar brand in `srcHooks/App.js` is the text `React-php`. The repository name is `react-php-tutorial`.

Provenance: **Implemented**. No product statement is **Documented**.

The React tree is a partial Create React App layout (`index.js`, `serviceWorker.js`, `setupTests.js`, `App.test.js`) using function components and hooks. The PHP tree is procedural `mysqli` scripts. Nothing in git wires the two folders together except hardcoded `http://localhost/php-react/` URLs in the JavaScript.

## Branch reality

| Line | Tip | Date | What it is |
|---|---|---|---|
| `master` (only branch; matches `origin/master`) | `d10301a` | 2020-04-29 | Five commits, all by Uriel Balela `<uriel@overdrive.co.za>` |

No other local or remote branches were present at inspection. The last commit is also the task-creation snapshot.

History:

| Commit | Date | Message | What landed |
|---|---|---|---|
| `fb5512c` | 2020-04-21 | first commit | Gitlink `react` at `5d85bc329cb5920e6135ff2dd78d826b8dc85920`. No `.gitmodules` file. |
| `a6be51c` | 2020-04-21 | sign in ,sign up | `php/db_connection.php`, `php/functions.php`, `php/signIn.php`, `php/signUp.php` |
| `53906de` | 2020-04-22 | bootsraptable, react hooks: signUp signIn | Removed the `react` gitlink. Added `srcHooks/`, `php/header.php`, `php/listView.php` |
| `d8dc00b` | 2020-04-24 | actions (1/2) | `php/delete.php`, empty `php/update.php`, list-table edit/delete/checkbox columns |
| `d10301a` | 2020-04-29 | add user, delete user | `AddUserModal.js`, `EditUserModal.js`. List table actions removed. `delete.php` still present |

**Discrepancy:** the task-creation scan listed `sonar-project.properties` and `sonarqube_scan.bat` at the repository root. Neither file is in git history. Provenance: **Unknown** — they may have been untracked files on the scan host.

## Objectives (inferred from the commits and the code, not from a written plan)

- Show a React sign-up form and a React sign-in form.
- Store people in MySQL and reject a second row with the same username or email.
- Record a login attempt string in `tblloginuser` and stamp `last_loggedin`.
- Show the user rows in a Bootstrap table.
- Add and delete a user. The latest commit message says this. The latest UI does not call delete, and edit does not call an API.

## Scope

### In scope of `master` at `d10301a`

1. PHP scripts under `php/` for connection, sign-in, sign-up, list, delete, and an empty update file.
2. Helper functions in `php/functions.php`, including several that no endpoint calls.
3. React function components under `srcHooks/` for the shell, sign-in, sign-up, a user table, and two modals.
4. Create React App boilerplate: service worker (unregistered), Jest DOM setup, and one test that still expects the CRA starter text.

### Out of scope / not in this repository

- `package.json`, `package-lock.json`, `public/index.html`, and `node_modules`. The React imports cannot be installed from this tree alone.
- `composer.json` and a PHP version pin.
- SQL `CREATE TABLE` or seed scripts.
- `index.php`, which `redirectToLoginPage()` would send the browser to.
- A README, licence, `.gitignore`, Docker file, pipeline, or environment sample.
- The contents of the removed `react` gitlink. The URL was not stored in this repository.
- Sessions, password hashing, and an email sender. Comments in `php/functions.php` and `php/signIn.php` mention them. The live sign-in path leaves `session_start()` commented out. A comment says "email function still need to be added".

## System shape

```text
Browser
  srcHooks/App.js routes /signIn and /signUp only
  SignIn, SignUp, AddUserModal  --POST-->  http://localhost/php-react/*.php
  ListView (not routed)         --GET--->  http://localhost/php-react/listView.php
        |
        v
PHP scripts in php/   (folder name in git is php, URL path is php-react)
        |
        v
MySQL database "login" on localhost, account root, empty password
  tables referenced by SQL: user, tblloginuser, loguser
```

The mapping from the git folder `php/` to the URL path `php-react` is **Inferred** from the hardcoded URLs. It is not configured in this repository.

## Major components

| Component | Path | Role at `d10301a` |
|---|---|---|
| App shell | `srcHooks/App.js` | Navbar and two routes |
| Sign in | `srcHooks/Components/SignIn.js` | Form posted to `signIn.php` |
| Sign up | `srcHooks/Components/SignUp.js` | Form posted to `signUp.php` |
| User table | `srcHooks/Components/ListView.js` | Loads `listView.php`. Not imported by `App.js` |
| Add user modal | `srcHooks/Components/AddUserModal.js` | Posts to `signUp.php`. Not imported by `App.js` |
| Edit user modal | `srcHooks/Components/EditUserModal.js` | Local state only. Not imported by `App.js` |
| Sign-in API | `php/signIn.php` | Plaintext password match, login log, `last_loggedin` |
| Sign-up API | `php/signUp.php` | Duplicate check, insert, `date_created` |
| List API | `php/listView.php` | JSON array of users |
| Delete API | `php/delete.php` | `DELETE` by `id` query parameter. No current JS caller |
| Update API | `php/update.php` | Empty file |
| Shared SQL helpers | `php/functions.php` | Insert, update-date, unused update/select/log helpers |
| DB connect | `php/db_connection.php` | `mysqli_connect` |

## Milestones

There is no written milestone plan. The commits are the only sequence:

1. 2020-04-21 — submodule pointer, then PHP sign-in and sign-up.
2. 2020-04-22 — React hooks UI, Bootstrap table, list endpoint. Submodule pointer removed.
3. 2020-04-24 — delete endpoint and table action buttons. Commit message says "actions (1/2)", so a second actions commit was expected. It was not made under that message.
4. 2020-04-29 — add-user and edit-user modals. Table action buttons removed in the same commit. No commit after this date.

## Known dependencies

Declared in imports and PHP calls. Versions are **Unknown** because there is no lockfile.

| Dependency | Evidence |
|---|---|
| React and ReactDOM | `srcHooks/index.js` |
| react-router-dom with `BrowserRouter`, `Switch`, `Route`, `Link` | `srcHooks/App.js` (React Router v5 API) |
| axios | Sign-in, sign-up, add-user modal |
| react-bootstrap `Modal`, `Button`, `Row`, `Col`, `Form` | Add and edit modals |
| bootstrap CSS from `node_modules/bootstrap` | `App.js`, `ListView.js` |
| react-bootstrap-table-next | `ListView.js` |
| @testing-library/react and @testing-library/jest-dom | `App.test.js`, `setupTests.js` |
| Font Awesome class names (`fas fa-user`, `fa-lock`, `fa-envelope`) | Sign-in and sign-up markup. No stylesheet import is in git |
| PHP `mysqli` extension | every PHP script that queries |
| MySQL database named `login` | `php/db_connection.php` |

## Current project status

**Inactive in git since 2020-04-29.** The tree is a tutorial snapshot, not a buildable application: the React project manifest and the HTML shell are absent, `update.php` is empty, and the list, add, and edit components are not on a route.

`master` is the only line of work. Whether anyone still runs the PHP scripts against a local `login` database is **Unknown / Requires Confirmation**.

## Open questions

- Who the audience was, and whether the tutorial is still wanted.
- The URL and contents of gitlink `react` @ `5d85bc329cb5920e6135ff2dd78d826b8dc85920`.
- How `http://localhost/php-react/` was mapped to the `php/` directory.
- The real `CREATE TABLE` statements for `user`, `tblloginuser`, and `loguser`.
- Which PHP version the author ran. `signUp.php` calls `Insertdata` with four arguments; the function declares three. Extra arguments are a warning on PHP 7 and an `ArgumentCountError` on PHP 8.
- Why `sonar-project.properties` and `sonarqube_scan.bat` appeared on the scan host and not in git.
