Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions frontend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_SERVER=https://tools.kenarnold.org/api
1 change: 1 addition & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_SERVER=http://localhost:8000/api
36 changes: 36 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# Writing Prototypes (Frontend)

This is a TypeScript/React rewrite of the original Python/Streamlit prototype based on `app.py`.

## Setup

1. Make sure you have Node.js installed.
2. Install dependencies:
```bash
npm install
```

## Running

1. Start the development server:
```bash
npm run dev
```
2. Open your browser at `http://localhost:5173`.

## Backend

This frontend is configured to communicate with the existing backend at `https://tools.kenarnold.org/api`.
If you want to run the local backend (`custom_llm.py`), you need to:
1. Run the python backend (with GPU if available):
```bash
python custom_llm.py --gpu
```
2. Update `src/api.ts` to point to `http://localhost:8000` (or whatever port FastAPI runs on, usually 8000).

## Components

- `Rewrite`: Corresponding to `rewrite_with_predictions` in python.
- `Highlights`: Corresponding to `highlight_edits` or `get_highlights` in python.
- `TypeAssistant`: Corresponding to `type_assistant_response` in python.
214 changes: 214 additions & 0 deletions frontend/dist/assets/index-B2v2C2Gn.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/dist/assets/index-CjT_FbIS.css

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions frontend/dist/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" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Writing Prototypes</title>
<script type="module" crossorigin src="/assets/index-B2v2C2Gn.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CjT_FbIS.css">
</head>
<body>
<div id="root"></div>
</body>
</html>
Expand Down
12 changes: 12 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Writing Prototypes</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions frontend/node_modules/.bin/autoprefixer

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions frontend/node_modules/.bin/autoprefixer.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions frontend/node_modules/.bin/autoprefixer.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions frontend/node_modules/.bin/baseline-browser-mapping

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions frontend/node_modules/.bin/baseline-browser-mapping.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions frontend/node_modules/.bin/baseline-browser-mapping.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions frontend/node_modules/.bin/browserslist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions frontend/node_modules/.bin/browserslist.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions frontend/node_modules/.bin/browserslist.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions frontend/node_modules/.bin/cssesc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions frontend/node_modules/.bin/cssesc.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions frontend/node_modules/.bin/cssesc.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions frontend/node_modules/.bin/esbuild

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions frontend/node_modules/.bin/esbuild.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions frontend/node_modules/.bin/esbuild.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading