Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions collab/ai/usage-log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# AI Usage Log

## Date/Time:
2025-09-12 01:24
## Tool:
ChatGPT
## Prompt/Command:
create a template project for a yjs-codemirror application, with persistence on the serverside

## Output Summary:
Template code for
- `client/package.json`
- `client/src/editor.tsx`
- `client/src/App.tsx`

Additionally, it also generated instructions for project setup

## Action Taken:
- [X] Accepted as-is
- [ ] Modified
- [ ] Rejected
## Author Notes:
- Did not use package.json file
- Verified by reading code


## Date/Time:
2025-09-12 01:36
## Tool:
ChatGPT
## Prompt/Command:
Use docker to create a container for the server

## Output Summary:
Template code for
- `server/package.json`
- `server/Dockerfile`

Additionally, it also generated instructions for running the containers

## Action Taken:
- [X] Accepted as-is
- [ ] Modified
- [ ] Rejected
## Author Notes:
- Did not use package.json file
- Edited y-websocket version number. Verified by running the code

## Date/Time:
2025-09-12 01:43
## Tool:
ChatGPT
## Prompt/Command:
Use docker to create a container for the client

## Output Summary:
Template code for
- `client/Dockerfile`

Additionally, it also generated instructions for running the containers

## Action Taken:
- [X] Accepted as-is
- [ ] Modified
- [ ] Rejected
## Author Notes:
Verified by running the code

## Date/Time:
2025-09-12 01:49
## Tool:
ChatGPT
## Prompt/Command:
Generate the docker compose file for the server and client

## Output Summary:
Template code for
- `docker-compose.yml`

Additionally, it also generated instructions for running docker-compose

## Action Taken:
- [X] Accepted as-is
- [ ] Modified
- [ ] Rejected
## Author Notes:
Verified by running the code


## Date/Time:
2025-09-13 18:11
## Tool:
ChatGPT
## Prompt/Command:
setup a simple websocket server with YJS as a CRDT to simply receive and emit changes to clients

## Output Summary:
Template code for
- `server/server.js`

Additionally, it also generated instructions for project setup

## Action Taken:
- [X] Accepted as-is
- [ ] Modified
- [ ] Rejected
## Author Notes:
- Verified by testing code
24 changes: 24 additions & 0 deletions collab/client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
27 changes: 27 additions & 0 deletions collab/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# AI Assistance Disclosure:
# Tool: ChatGPT (model: GPT‑5) date: 2025‑09‑12
# Scope:
# - Generated template code
# Author review:
# - Verfied for correctness by running code

# Stage 1: Build the React app
FROM node:20-alpine AS build

WORKDIR /app
COPY . .
RUN npm install && npm run build

# Stage 2: Serve the built files with nginx
FROM nginx:alpine

# Copy build output to nginx public directory
COPY --from=build /app/dist /usr/share/nginx/html

# Copy configuration files
COPY nginx.conf /etc/nginx/conf.d/default.conf

# Expose port 80
EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
69 changes: 69 additions & 0 deletions collab/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

```js
export default tseslint.config([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...

// Remove tseslint.configs.recommended and replace with this
...tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
...tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
...tseslint.configs.stylisticTypeChecked,

// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```

You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:

```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default tseslint.config([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```
23 changes: 23 additions & 0 deletions collab/client/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { globalIgnores } from 'eslint/config'

export default tseslint.config([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs['recommended-latest'],
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
},
])
13 changes: 13 additions & 0 deletions collab/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions collab/client/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
server {
listen 80;
server_name localhost;

root /usr/share/nginx/html;
index index.html;

location / {
try_files $uri /index.html;
}

error_page 404 /index.html;
}
Loading