# Features — formulys_simpleflow_backend

Evidence date: 2026-10-14. Source: `git@bitbucket.org:overdrive/formulys_simpleflow_backend.git`, `master` at `c30ed2b` (2024-06-05).

Status words used here:

- **Current** — present on `master` at `c30ed2b` as source that describes the feature.
- **Stub** — schema, dependency, or handler exists, and nothing in this repo exercises a complete product path.
- **Broken** — present in source and prevents the documented start path from working as committed.
- **Not in git** — named by the task-creation scan or by a field in a config file, and no matching file exists at that path.

There are two commits and one branch. Nothing in git history is a removed product feature. No feature is marked in-development by a branch, ticket, or TODO comment in the tree.

## Current

### Repository and tooling scaffold

| Feature | Location | Notes |
|---|---|---|
| Default ignore list | `.gitignore` | Bitbucket example list from `bb640f4`. Header says to customize it. Not customized. Does not list `.env`. |
| npm package metadata | `package.json`, `package-lock.json` | Name `formulys_simpleflow_backend`, version `1.0.0`, license `ISC`, empty `description` / `author` / `keywords`. |
| Start script | `package.json` → `start` | `node server.js` |
| Dev script | `package.json` → `dev` | `nodemon server.js` |
| Environment file | `.env` | Key `MONGO_URI` committed in `c30ed2b`. Value not documented here. |

### HTTP and realtime server (source)

| Feature | Location | Notes |
|---|---|---|
| Express JSON body parsing | `server.js` | `app.use(express.json())` |
| Smoke route | `server.js` | `GET /` returns `Hello World` |
| MongoDB connect | `server.js` | `mongoose.connect(process.env.MONGO_URI, ...)` with connection logging |
| Listen port | `server.js` | `process.env.PORT \|\| 3000` |
| Inline Socket.io handlers | `server.js` | `connection`, `message` broadcast, `disconnect` log |
| Socket handler module | `socket_handlers/index.js` | Same `message` broadcast behaviour as the inline handlers |

### Data model

| Feature | Location | Notes |
|---|---|---|
| User schema | `models/User.js` | `username`, `password`, `tenantId`, `role` |

## Stub

| Feature | Location | Notes |
|---|---|---|
| Multi-tenant user roles | `models/User.js` | Enum values exist. No create/login/authorize path. |
| Tenant association | `User.tenantId` → `'Tenant'` | No `models/Tenant.js` or equivalent. |
| HTTP client capability | `axios` in `package.json` | Not imported by any tracked `.js` file. |
| dotenv loading | `server.js` | Loads `.env`; only `MONGO_URI` and optional `PORT` are referenced. |

## Broken

These are written in `server.js` and stop a clean `node server.js` run as committed.

| Feature | Location | Notes |
|---|---|---|
| Socket setup import | `require('./socket')` | There is no `socket.js` / `socket/index.js`. The only handler module is `socket_handlers/index.js`. |
| Early `socketSetup(io)` call | `server.js` before `const io = ...` | Uses `io` before it is declared. |
| Duplicate registration intent | `socketSetup` plus later `io.on('connection', ...)` | Even if wiring were fixed, handlers would be registered twice unless one path is removed. |

Provenance: **Implemented** defects in `server.js` relative to the tree at `c30ed2b`.

## Not in git

| Name | Why it is listed |
|---|---|
| `sonar-project.properties` | Task-creation scan of the scan-host tree. Absent from both commits. |
| `sonarqube_scan.bat` | Same scan listing. Absent from both commits. |
| `socket.js` / `./socket` | Required by `server.js`. Not committed. |
| `index.js` | Named as `package.json` `"main"`. Not committed. |
| `README.md` | Not committed. |
| Tests, Docker, CI, lint, TypeScript | Not committed. |
| Auth / CRUD routes | Suggested by the User model. Not committed. |
| `Tenant` model | Suggested by `ref: 'Tenant'`. Not committed. |

## Planned

No planned features are documented in the repository (no README roadmap, issues in-tree, or TODO comments that describe future product work).

**Unknown / Requires Confirmation** what the next feature set was meant to be.

## In development

No feature branches and no WIP markers. Status: none observed.

## Recently changed

Relative to empty history before `c30ed2b`, the entire application scaffold is the recent change (2024-06-05). There have been no commits since.

## Deprecated / removed

Git history does not show a removed feature. The initial commit only added `.gitignore`. Nothing was deleted in `c30ed2b`.

## Cross-document consistency

| Topic | features.md | prd.md / technical-documentation.md |
|---|---|---|
| Smoke route | Current | FR-003 / HTTP |
| User roles | Stub | FR-006 |
| Socket setup | Broken | Defects section |
| Sonar files | Not in git | Discrepancy with scan host |
