# PRD — reactjs-nodejs-tutorial

Evidence date: 2026-10-05.

Source: `git@bitbucket.org:overdrive/reactjs-nodejs-tutorial.git`, `master` at `1500676cdcf9880c1f9369565bd6fe7683c3342e` (2020-04-20, JacquesOverdrive, "ini commit").

There is no prior PRD in Silicon Ark. The source `README.md` is the upstream [Serverless Node.js Starter](https://github.com/AnomalyInnovations/serverless-nodejs-starter) readme, not a requirements document for this Bitbucket repository. Requirements below are recovered from `handler.js`, `serverless.yml`, `tests/handler.test.js`, `package.json`, `env.example`, `.gitignore`, and `README.md`. Provenance is labelled.

The repository name contains "reactjs". No React code is present. That absence is recorded; it is not treated as a missing feature to invent.

## Product purpose

**Documented** in `README.md`: "A Serverless starter that adds ES7 syntax, serverless-offline, linting, environment variables, and unit test support." The same file says the project is part of the Serverless Stack guide and is maintained by Anomaly Innovations.

**Implemented** in this revision: an npm package named `notes-app-api` version `1.1.0`, a Serverless service of the same name, and one exported function `hello` that returns a fixed success message after one second.

**Inferred:** the Bitbucket repository is a copy of that starter, committed once, without a `functions` section that would deploy `hello`.

**Unknown / Requires Confirmation:** the product owner inside Overdrive, the intended user, and whether this snapshot was replaced by another service.

## Users and interactions

| Actor | Evidence | Status |
|---|---|---|
| Person running the Serverless CLI | README commands `serverless invoke local`, `serverless offline start`, `serverless deploy` | **Documented.** The CLI is not a dependency in `package.json` |
| Person running `npm test` | `package.json` script `test`: `serverless-bundle test` | **Documented** and **Implemented** as a script. The test run was not executed here |
| Caller of `hello(event, context)` | `export const hello` in `handler.js` | **Implemented** as a function. No API Gateway event is declared, so no HTTP caller is configured in this repo |
| Author of the only commit | `JacquesOverdrive <jacques@overdrive.co.za>` | **Implemented** in git history |
| Upstream maintainer named by the README | "maintained by Anomaly Innovations" | **Documented.** Not a git author on this repository |

No login, role, session, or admin screen exists.

## Systems the product talks to

1. AWS, as the Serverless provider: `provider.name: aws`, `runtime: nodejs12.x`, `stage: prod`, `region: us-east-1`. No function, no API id, and no account id are in git. A deploy was not run.
2. npm registry, via `package-lock.json` (`lockfileVersion` 1). Direct packages are listed in Technical documentation.
3. The README names a demo API: `https://z6pv80ao4l.execute-api.us-east-1.amazonaws.com/dev/hello`. That URL is **Documented** text. The stage in the URL is `dev`. `serverless.yml` sets `stage: prod`. This repository does not contain the id `z6pv80ao4l`. Whether the URL belongs to Overdrive is **Unknown / Requires Confirmation**.

No database, queue, mailer, file store, or HTTP client appears in `handler.js`. `aws-sdk` and `uuid` are dependencies and are not imported.

## Major workflows

### WF-1 — `hello` returns a fixed success body

**Implemented** in `handler.js`.

1. `hello` is an async function. Parameters are `event` and `context`. Neither is read.
2. It calls `message({ time: 1, copy: 'Your function executed successfully!' })`.
3. `message` returns a Promise. `setTimeout` resolves `` `${rest.copy} (with a delay)` `` after `time * 1000` milliseconds. Here that is 1000ms. The `reject` parameter is never called.
4. The resolved string is interpolated into `` `Go Serverless v1.0! ${...}` ``.
5. The function returns `{ statusCode: 200, body: JSON.stringify({ message }) }`. It sets no headers.

The body string produced by this code is:

```json
{"message":"Go Serverless v1.0! Your function executed successfully! (with a delay)"}
```

There is no branch for a bad event, a missing event, or a thrown error. A throw inside `message` would reject the async function. Nothing in `message` throws.

**Documented** difference: the README demo includes `input: event` in the JSON body. `handler.js` does not. The README demo is otherwise the same message and the same one-second delay.

### WF-2 — Local invoke and local API Gateway

**Documented** in `README.md`:

- `serverless invoke local --function hello`
- `serverless offline start`
- `serverless deploy`
- `serverless deploy function --function hello`

**Implemented** in `serverless.yml`: plugins `serverless-bundle`, `serverless-offline`, and `serverless-dotenv-plugin` are listed. `package.individually` is `true`. There is no `functions` key, so there is no function named `hello` for those commands to select, and no `http` event for offline to serve.

This investigation did not run the CLI. The result of those commands against this YAML is **Unknown**. The missing `functions` block is **Implemented**.

### WF-3 — Unit test

**Implemented** in `tests/handler.test.js`. **Documented** command: `npm test`, which runs `serverless-bundle test`. Jest is named in the README. Jest is not a direct `package.json` dependency; it would arrive through `serverless-bundle` if that package's dependency tree is installed. That install was not run.

The test:

1. Imports `* as handler` from `../handler`.
2. Builds a callback that expects `response.statusCode === 200` and `typeof response.body === "string"`.
3. `await handler.hello('event', 'context', callback)`.

`hello` declares two parameters and never calls a callback. The third argument is ignored. The `expect` calls sit only inside the callback, and the test does not set `expect.assertions`. The test does not read the returned object and does not check the message text or the delay.

The test was not executed. Whether `npm test` exits 0 on a current Node is **Unknown**. From the source, a passing run would not have executed those two `expect` calls.

### WF-4 — Environment variables

**Documented** in `README.md` and in comments in `env.example`:

1. Rename `env.example` to `.env`.
2. Put local-stage variables in `.env`.
3. Uncomment the `environment:` block in `serverless.yml` and reference `${env:MY_ENV_VAR}`.
4. Do not commit `.env`.

**Implemented:** `env.example` sets `SAMPLE_ENV_VAR=i-am-an-environment-variable`. `.gitignore` ignores `.env` and `env.yml`. `serverless.yml` loads `serverless-dotenv-plugin` and contains no `environment:` block, commented or otherwise. No source file reads `process.env`.

## Functional requirements

Recovered from the implementation and the README. Each one says what is actually true in this revision.

### FR-001 — Fixed hello response

**Requirement:** Calling `hello` with any `event` and `context` returns `statusCode` 200 and a JSON string body whose `message` is `Go Serverless v1.0! Your function executed successfully! (with a delay)`, after a one-second timer.

**Who:** Any caller that can import or invoke the function.

**Trigger:** A call to `hello`.

**Inputs:** `event`, `context`. Both are ignored.

**Output:** The object described above. No response headers.

**Validation:** None.

**Errors:** No error response is defined. The timer's `reject` is unused.

**Evidence:** `handler.js`.

**Implementation:** Implemented.

**Confidence:** High for the source behaviour. Not executed in this investigation.

### FR-002 — The handler is not a deployed route in this repo

**Requirement:** This revision does not declare a Lambda function, an HTTP path, or an authorizer.

**Evidence:** `serverless.yml` ends at the provider block. README commands refer to a function named `hello`.

**Implementation:** Implemented as an absence. The README still documents the commands.

**Confidence:** High that the YAML has no functions. Low on what a live AWS account contains.

### FR-003 — Service identity and provider

**Requirement:** The Serverless service is named `notes-app-api`, provider `aws`, runtime `nodejs12.x`, default stage `prod`, region `us-east-1`, and each function package is built individually when functions exist.

**Evidence:** `serverless.yml`, `package.json` `"name": "notes-app-api"`.

**Implementation:** Implemented as configuration. Packaging of zero functions was not run.

**Confidence:** High for the file contents.

### FR-004 — Test script exists

**Requirement:** `npm test` runs `serverless-bundle test`. One test file imports `hello`.

**Evidence:** `package.json` scripts, `tests/handler.test.js`.

**Implementation:** Implemented as files. See WF-3 for the callback gap.

**Confidence:** High for the files. Unknown for the command's exit code.

### FR-005 — Sample environment variable is not wired

**Requirement:** `SAMPLE_ENV_VAR` exists only in `env.example`. The handler and the Serverless provider do not read it.

**Evidence:** `env.example`, `serverless.yml`, `handler.js`.

**Implementation:** Implemented.

**Confidence:** High.

### FR-006 — `.env` is not committed

**Requirement:** A local `.env` and `env.yml` are gitignored. `env.example` is the tracked sample.

**Evidence:** `.gitignore`, `env.example`. README step 4 says not to commit `.env`.

**Provenance:** **Documented** and **Implemented** as ignore rules. Whether a `.env` was ever created on a developer machine is **Unknown**.

### FR-007 — Upstream demo and upgrade text

**Requirement:** The README tells a reader to install a new project from `https://github.com/AnomalyInnovations/serverless-nodejs-starter`, and links a v1-to-v2 upgrade note and a demo URL on API id `z6pv80ao4l`, stage `dev`.

**Evidence:** `README.md`. `package.json` `repository.url` is that same GitHub repository.

**Implementation:** Documented text. Not a behaviour of `handler.js`. The demo was not requested.

**Confidence:** High that the text is present. Unknown whether the demo is this codebase.

## Constraints

- Node runtime string in git is `nodejs12.x`. Acceptance of that runtime by AWS in 2026 was not checked.
- Serverless Framework and AWS CLI credentials are assumed by the README and are not stored in this repository.
- `package.json` `author` is an empty string. Licence is MIT (`LICENSE`, and `"license": "MIT"`).
- No CI file, Dockerfile, or Sonar project file is in git. The onboarding scan listed `sonar-project.properties` and `sonarqube_scan.bat`; they are not at `1500676`.

## Discrepancies

| Topic | README / name | Code at `1500676` |
|---|---|---|
| Repository name | `reactjs-nodejs-tutorial` | No React |
| Service name | `notes-app-api` | No notes resource |
| Function `hello` | Invoke, offline, and deploy commands | No `functions.hello` in `serverless.yml` |
| Response body | README sample includes `input: event` | `handler.js` returns only `message` |
| Stage | Demo URL path `/dev/` | YAML `stage: prod` |
| Environment block | "Uncomment `environment:`" | No such block exists to uncomment |
| Unit test | README says Jest checks the tests you write | The only test's expects are inside a callback the handler does not call |
| Maintainer | Anomaly Innovations | Git author is JacquesOverdrive |
