Skip to content

Commit bf112b9

Browse files
authored
Remove the migrated v1 app from main (#3)
* Remove the migrated v1 app from main Production has served from the v2 base directory since the storage migration finished, so the flat app at the root was a full second copy of the site doing nothing: byte-identical stylesheet, parallel functions, its own test suite doubling CI. It is preserved at the v1-final tag. The migration guard and its checklist went with it since the migration it protected is complete. Dependabot now targets v2 only, and the README describes the current layout. * chore: keep one set of project docs at the root The v2 copies of CONTRIBUTING, SECURITY, LICENSE and the dotfiles duplicated the root set with small drifts. The root files now carry the stricter v2 wording (context packs, audience separation, current contact address) and the duplicates are gone. * chore: delete the unreachable context import and clear functions No rendered template or click handler ever wired importContext or clearContext; the admin screen intentionally says the pack cannot be changed from the deployed site. * docs: match the privacy notes to the locked-down context workflow * ci: validate the deployed v2 app * Finish the v1 cleanup documentation --------- Co-authored-by: Jamie Parr <JamieP-205@users.noreply.github.com>
1 parent 3d005b5 commit bf112b9

34 files changed

Lines changed: 34 additions & 3263 deletions

.env.example

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22
updates:
33
- package-ecosystem: npm
4-
directory: /
4+
directory: /v2
55
schedule:
66
interval: monthly
77
open-pull-requests-limit: 5

.github/workflows/ci.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,7 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
validate-current:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v4
16-
- uses: actions/setup-node@v4
17-
with:
18-
node-version: 22
19-
cache: npm
20-
- run: npm ci
21-
- run: npm test
22-
23-
validate-v2:
12+
validate:
2413
runs-on: ubuntu-latest
2514
defaults:
2615
run:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ node_modules/
99
npm-debug.log*
1010
.DS_Store
1111
Thumbs.db
12+
private-context/
13+
*.context-pack.json

404.html

Lines changed: 0 additions & 26 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
This application handles account and conversation data. Keep changes small, reviewable, and privacy-conscious.
44

55
1. Create a branch from `main`.
6-
2. Install dependencies with `npm ci`.
6+
2. Work in `v2/` and install dependencies there with `npm ci`.
77
3. Run `npm test`.
88
4. Test authentication, guest access, chat persistence, blocking, deletion, and admin-only routes with `netlify dev`.
9-
5. Never commit deployment tokens, AI keys, Blobs credentials, user exports, or conversation data.
9+
5. Never commit deployment tokens, AI keys, Blobs credentials, generated context packs, user exports, or conversation data.
1010

11-
Security-sensitive changes require a clear threat model in the pull request.
11+
Security-sensitive changes require a clear threat model in the pull request. Context changes must also test public/admin audience separation.

MIGRATION.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

PRIVACY.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The public experiment is available at [talkwithjamie.netlify.app](https://talkwi
88

99
## Status
1010

11-
**Experimental, active development** this is a personal AI chat experiment. Features and privacy controls continue to evolve.
11+
**Experimental, active development** - this is a personal AI chat experiment. Features and privacy controls continue to evolve.
1212

1313
## Summary
1414

@@ -19,17 +19,16 @@ workspace and is not available through public chat.
1919

2020
### Active codebase
2121

22-
[`v2/`](v2/) is the active deployment and the place for new development. The root application is
23-
kept for migration history and compatibility notes; its version-specific setup and privacy details
24-
are in [`v2/README.md`](v2/README.md).
22+
[`v2/`](v2/) is the whole application: Netlify builds with `v2` as the base directory. The
23+
original flat app that previously served production was removed once the migration finished;
24+
it is still readable at the [`v1-final`](https://github.com/JamieP-205/talk-with-jamie/tree/v1-final) tag. Setup, context-pack and
25+
privacy details live in [`v2/README.md`](v2/README.md).
2526

2627
## Architecture overview
2728

2829
The app uses a static frontend served by Netlify alongside a serverless backend. Authenticated and guest users interact with Netlify Functions through signed `HttpOnly` cookies. Persistent users, conversations and rate limits are stored in Netlify Blobs. The owner workspace can use a protected context pack, while public chat stays limited to approved general information. The configured AI provider generates responses from selected context rather than exposing source material.
2930

30-
| Talk With Jamie architecture |
31-
| --- |
32-
| ![Talk With Jamie architecture](talk-architecture.svg) |
31+
![Talk With Jamie architecture](talk-architecture.svg)
3332

3433
## Privacy first design choices
3534

@@ -50,21 +49,25 @@ The app uses a static frontend served by Netlify alongside a serverless backend.
5049
- A private drafting workspace for contact-specific reply ideas
5150
- Configurable OpenAI-compatible or Cohere model providers
5251
- Request size limits, input cleaning, same-origin checks and route-specific rate limits
53-
- Automated unit, syntax, deployment-guard and site-structure tests
52+
- Automated unit, integration, syntax and site-structure tests
5453

5554
## Key files
5655

57-
- `index.html` - frontend shell and metadata
58-
- `styles.css` - responsive public and admin interface styles
59-
- `app.js` - client state, rendering and API requests
60-
- `netlify/functions/api.js` - Netlify Function entry point
61-
- `netlify/functions/_lib.js` - authentication, storage, validation, provider and route logic
62-
- `test/` - unit tests for security-sensitive helpers and deployment controls
63-
- `tools/` - site validation and production migration guard
56+
- `v2/index.html` - frontend shell and metadata
57+
- `v2/styles.css` - responsive public and admin interface styles
58+
- `v2/app.js` - client state, rendering and API requests
59+
- `v2/netlify/functions/api.js` - Netlify Function entry point
60+
- `v2/netlify/functions/_lib.js` - authentication, storage, validation, provider and route logic
61+
- `v2/test/` - unit and integration tests for the security and context boundaries
62+
- `v2/tools/` - site validation and the local private context-pack builder
6463

6564
## Technical approach
6665

67-
The frontend is a lightweight static site that communicates with a single Netlify Function. Authentication is handled via signed, same-site cookies; passwords use scrypt. The function uses a modular library for storage, validation and provider logic. Conversations and user records live in Netlify Blobs. A locally generated, redacted context pack helps the model produce replies that reflect my tone without exposing raw messages. The project is tested with unit and integration tests and guarded with a production migration flag to prevent accidental data loss.
66+
The frontend is a lightweight static site that communicates with a single Netlify Function. Authentication is handled via signed, same-site cookies; passwords use scrypt. The function uses a modular library for storage, validation and provider logic. Conversations and user records live in Netlify Blobs. A locally generated, redacted context pack helps the model produce replies that reflect my tone without exposing raw messages. The project is tested with unit and integration tests covering the security and privacy boundaries.
67+
68+
## Development note
69+
70+
I used AI-assisted coding tools as a pair-programming and review aid for parts of the security-sensitive backend, particularly signed sessions, password hashing, same-origin checks and tests around the public/private context boundary. The automated tests document the expected behaviour, and I remain responsible for the code I deploy.
6871

6972
## Deployment
7073

@@ -78,16 +81,17 @@ changes.
7881
## Local development
7982

8083
```bash
84+
cd v2
8185
npm ci
8286
npm test
8387
npx netlify dev
8488
```
8589

86-
The test suite checks authentication helpers, password hashing, signed sessions, username rules, message cleaning, frontend syntax, site structure and the production migration guard.
90+
The test suite checks authentication helpers, password hashing, signed sessions, username rules, message cleaning, context boundaries, frontend syntax and site structure.
8791

8892
## Privacy & safety notes
8993

90-
Chats are stored and visible to the administrator. The application warns users not to submit sensitive information, and chat content is sent to the configured model provider when generating a response. Credentials, user exports, conversations and production data must never be committed. Review [PRIVACY.md](PRIVACY.md) and [SECURITY.md](SECURITY.md) before deploying a backend change.
94+
Chats are stored and visible to the administrator. The application warns users not to submit sensitive information, and chat content is sent to the configured model provider when generating a response. Credentials, user exports, conversations and production data must never be committed. Review [v2/PRIVACY.md](v2/PRIVACY.md) and [SECURITY.md](SECURITY.md) before deploying a backend change.
9195

9296
## What I learned
9397

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Security Policy
22

3-
Report vulnerabilities privately to `jamieparr05@hotmail.com`. Do not open a public issue for authentication bypasses, setup takeover, stored conversation exposure, account blocking failures, provider-key exposure, or session weaknesses.
3+
Report vulnerabilities privately to `jamieparr205@gmail.com`. Do not open a public issue for authentication bypasses, setup takeover, stored conversation exposure, context-pack exposure, account blocking failures, provider-key exposure, or session weaknesses.
44

5-
Do not include live credentials or real user conversations in a report. Only the current `main` branch is supported.
5+
Do not include live credentials, context packs, exports, or real user conversations in a report. Only the current `main` branch is supported.

0 commit comments

Comments
 (0)