# Project plan — calendar-module

Evidence date: 2026-10-19.

Source repository: `git@bitbucket.org:overdrive/calendar-module.git`.

Inspected revision: `master` at `88c9d8d` (2020-10-07 17:33 +0200, Uriel Balela, "Calendar"). That commit is `origin/HEAD`. The scan-host path `~/projects/sonar_scan/repos/calendar-module` was not on this machine. The tree below was read from a clone of that git revision.

`npm` `package.json` names the package `calendar` version `0.1.0` and marks it `private`. The Create React App README, `public/index.html`, and `public/manifest.json` still say "React App". No other product name is written down.

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

## Product

A browser calendar can show a month, week, or day grid. Choosing a date opens a title form. Submitting that form adds an event on the grid and posts the title and range to a PHP script. A second PHP script reads every row from an `event` table and is passed to FullCalendar as the event source.

Provenance: **Implemented** in `src/Components/Calendar.js`, `src/Components/Modal.js`, `php/addEvent.php`, and `php/fetchEvent.php`. **Documented** product text does not exist. `README.md` is the stock Create React App script list. Whether this module belongs to a larger product is **Unknown / Requires Confirmation**.

## Branch reality

| Line | Tip | Date | What it is |
|---|---|---|---|
| `master` (default; `origin/HEAD`) | `88c9d8d` | 2020-10-07 | Only branch. Two commits, both on 2020-10-07 |

No other local or remote branches were present at inspection. Nothing in git is dated after 2020-10-07. Whether anyone still runs this application is **Unknown / Requires Confirmation**.

Authors on the commits:

- Jaco Brits (`jaco@overdrive.co.za`) — `5fdec4c` "Initial commit", 2020-10-07 14:59 UTC. That commit adds only `.gitignore`.
- Uriel Balela (`uriel@overdrive.co.za`) — `88c9d8d` "Calendar", 2020-10-07 17:33 +0200. That commit adds the React app, the PHP scripts, the SQL dump, both lockfiles, and the Create React App README.

No commit subject cites a ticket number.

## Objectives

No objective is written in the repository. The behaviour that was committed the same day is the only objective that can be recovered:

1. Show a FullCalendar month view, with week and day views in the toolbar.
2. Let a person type an event title for a selected range.
3. Store that title and range in MySQL/MariaDB and read the rows back.

Provenance: **Inferred** from the files added in `88c9d8d`. There is no plan, ticket export, or earlier Silicon Ark set.

## Scope

### In scope of `master`

1. Create React App 3.4.3 shell: `public/`, `src/index.js`, `src/App.js`, `src/serviceWorker.js`, `src/App.test.js`, `src/setupTests.js`.
2. Calendar screen `src/Components/Calendar.js` and title dialog `src/Components/Modal.js`.
3. PHP under `php/`: `addEvent.php`, `fetchEvent.php`, `header.php`, `functions.php`, `db_connection.php`, and dump `fullcalender.sql`.
4. `package.json`, `package-lock.json` (lockfileVersion 1), and `yarn.lock`.
5. Empty Prettier config `.prettierrc.json` (`{}`).
6. `.gitignore`, which is the generic Atlassian example list (it ignores `node_modules/` and `dist/`).

28 files are tracked.

### Out of scope / not in this repository

- A product README, user guide, or statement of who the calendar is for.
- Web-server or virtual-host config that would publish `php/` at `http://localhost/php-react/`. The React code calls that origin. The PHP files live in `php/`.
- A file named `dbconnect.php`. `addEvent.php`, `fetchEvent.php`, and `functions.php` `require` or `include` that name. The connection file that is tracked is `db_connection.php`, and nothing includes it.
- Login, sessions, users, or an `index.php`. `functions.php` still contains user-table helpers and a redirect to `../index.php`. Those helpers are not called by the calendar scripts.
- Update and delete endpoints. A delete-on-click handler in `Calendar.js` is commented out.
- Docker, Bitbucket Pipelines, environment files, queues, workers, and monitoring.
- `sonar-project.properties` and `sonarqube_scan.bat`. The onboarding scan listed both at the repository root. Neither file is in git history. Provenance: **Unknown** — they may have been untracked files on the scan host.

## What the committed code actually does

| Expected from the file names | What `master` contains |
|---|---|
| Add an event | `Modal.js` calls FullCalendar `addEvent` when the title is non-empty. FullCalendar then runs `eventAdd`, which POSTs JSON to `http://localhost/php-react/addEvent.php`. |
| Load events | `events={fetchEvent}` GETs `http://localhost/php-react/fetchEvent.php`. That function returns the Axios body and does not call a FullCalendar success callback. Whether version 5.3 paints those events is **Unknown / Requires Confirmation** (the app was not executed). |
| Persist a connection | Scripts ask PHP for `dbconnect.php`. Git contains `db_connection.php`, which connects to database `login` on `localhost` as `root` with an empty password. The SQL comment names database `fullcalender` and the dump has no `CREATE DATABASE` and no `USE`. |
| Store time and description | Columns exist. `addEvent.php` always inserts an empty string for both. The modal has no time or description field. |
| Edit or delete | The grid is `editable`. No handler writes a move back to PHP. Delete is commented out. |

## System architecture

```text
Browser (Create React App, yarn start → port 3000)
  src/index.js
    App
      Calendar.js          FullCalendar 5 (dayGrid, timeGrid, interaction)
        Modal.js           styled-components overlay; title only
        axios POST         http://localhost/php-react/addEvent.php
        axios GET          http://localhost/php-react/fetchEvent.php

PHP (expected on port 80, path /php-react/; not configured in git)
  header.php               CORS * ; POST, OPTIONS
  addEvent.php             JSON body → Insertdata('event', ...)
  fetchEvent.php           SELECT * FROM event → JSON title/start/end
  functions.php            generic INSERT plus unused user helpers
  db_connection.php        mysqli to localhost / login (file is not included)

MariaDB / MySQL
  table event              dump header: MariaDB 10.4.11, phpMyAdmin 5.0.1, PHP 7.2.0
```

The React dev server does not execute PHP. The two origins are separate. That split is why `header.php` sends `Access-Control-Allow-Origin: *`.

## Major components

| Piece | Role |
|---|---|
| `src/Components/Calendar.js` | Grid, date click, select, fetch, and the POST after an event is added |
| `src/Components/Modal.js` | Title capture. Calls `calendarApi.addEvent` |
| `php/addEvent.php` | Decode JSON, insert one `event` row, `var_dump` the payload, `print_r` the SQL |
| `php/fetchEvent.php` | Return every event as `{title, start, end}` |
| `php/functions.php` | `Insertdata` is the insert used by add. The other functions target a `user` table |
| `php/fullcalender.sql` | `event` table plus 13 sample rows dumped 2020-10-07 16:41 |
| Create React App scripts | `yarn start`, `yarn test`, `yarn build`, `yarn eject` as written in the README |

## Milestones

| When | Evidence | Result |
|---|---|---|
| 2020-10-07 14:59 UTC | `5fdec4c` | Repository created with `.gitignore` only |
| 2020-10-07 16:41 | `php/fullcalender.sql` header | phpMyAdmin dump of `event`, including rows already inserted that afternoon |
| 2020-10-07 17:33 +0200 | `88c9d8d` | React calendar, PHP, dump, and lockfiles land in one commit |

No later milestone is in git.

## Implementation plan

There is no forward plan in the repository. Comments inside the code name unfinished work, and they refer to the user helpers, not to a calendar backlog:

- `functions.php`: "email function still need to be added".
- `updatetUser`: "this must be changed !!!".
- `UpdateTable`: "not implemented yet". The function builds a SQL string and does not execute it.
- `SelectData`: "works but not implement yet".
- `Calendar.js`: the delete-on-click function is commented out.

Provenance: **Documented** only as those comments. No owner or date is attached to them.

## Known dependencies

Runtime libraries pinned in `package-lock.json` (the same commit also adds `yarn.lock`):

- `react` and `react-dom` 16.13.1
- `react-scripts` 3.4.3
- `@fullcalendar/react` 5.3.1, `@fullcalendar/daygrid` 5.3.2, `@fullcalendar/timegrid` 5.3.1, `@fullcalendar/interaction` 5.3.1, `@fullcalendar/list` 5.3.1
- `axios` 0.20.0
- `styled-components` 5.2.0
- `react-bootstrap` 1.3.0 (declared; no source file imports it)
- `cors` 2.8.5 (declared; no Node server imports it)

PHP side, from the scripts and the dump header: `mysqli`, MariaDB 10.4.11, and a PHP that can run the scripts. The dump was generated with PHP 7.2.0. The scripts do not declare a minimum PHP version.

## Current project status

**Implemented, and last changed on 2020-10-07.** One feature commit on top of an empty initial commit. The calendar UI, the insert script, the fetch script, and a SQL dump are present. The connection include name does not match the connection file. The React app and the PHP app are not wired by any config in git. Update, delete, auth, and description/time capture were not built.

Status label: a short-lived module snapshot, not an active codebase. Whether it was abandoned or copied into another repository is **Unknown / Requires Confirmation**.
