Skip to content

Commit ab3ede5

Browse files
aboodmanarv
andauthored
Use external repos (#22)
* This has two _executables_: Next (server and client) ======================== Start this with `npm run dev` The code for this is located in `/src` Cloudlare Worker ================ Start this in dev mode with `npm start dev-worker` The code for this is in `/worker` Dependencies ============ This currently has tarbals for `reps-do` and `reps-client` `reps-client` will be moved into `replicache` proper eventually but `reps-do` will eventually become `reps`. * Take over rocicorp/reflect-draw#21 For some reason these .js extensions don't work for me. Also, remove unneeded declarations.d.ts file and update package-lock.json. * Update README Co-authored-by: Erik Arvidsson <[email protected]>
1 parent 36764ce commit ab3ede5

File tree

115 files changed

+3475
-15591
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+3475
-15591
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ yarn-error.log*
3232

3333
# vercel
3434
.vercel
35+
36+
$ CloudFlare worker
37+
.mf/
38+
tsconfig.tsbuildinfo

.jshintrc

-6
This file was deleted.

.npmrc

-1
This file was deleted.

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
out
2+
.next
3+
dist

README.md

+39-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,43 @@
33
A tiny Figma-like multiplayer graphics editor.
44

55
Built with [Replicache](https://replicache.dev), [Next.js](https://nextjs.org/),
6-
Postgres, and Heroku.
6+
and [Cloudflare Workers](https://workers.cloudflare.com/).
77

8-
Running live at [replidraw.herokuapp.com](https://replidraw.herokuapp.com/).
8+
Running live at [replidraw-do.vercel.com](https://replidraw-do.vercel.com/).
9+
10+
## Hacking Locally
11+
12+
The `dev-worker` command runs the worker using [Miniflare](https://miniflare.dev/), a really nice Cloudflare emulation environment. This is super convenient and doesn't require a CF account but doesn't give you a realistic view of performance.
13+
14+
```bash
15+
npm install
16+
17+
# start the backend
18+
npm run dev-worker &
19+
20+
# start the frontend
21+
NEXT_PUBLIC_WORKER_HOST=ws://localhost:8787 npm run dev
22+
```
23+
24+
## Publishing Worker to Cloudflare
25+
26+
1. Get an account at Cloudflare: https://workers.cloudflare.com/.
27+
2. Install the [Wrangler CLI tool](https://developers.cloudflare.com/workers/cli-wrangler/install-update)
28+
29+
Then:
30+
31+
```
32+
# publish to Cloudflare
33+
wrangler publish
34+
35+
# run frontend
36+
npm run dev
37+
```
38+
39+
## Using reps-do in your own project
40+
41+
1. Copy `reps-do-*.tgz` and `rep-client-*.tgz`
42+
2. Copy the `worker` directory to your project
43+
3. `npm add reps-do-*.tgz reps-client-*.tgz @cloudflare/workers-types esbuild miniflare`
44+
4. Copy the `dev-worker` and `build-worker` scripts from `package.json` into your project
45+
5. Have fun 😀.

app.json

-8
This file was deleted.

frontend/declarations.d.ts

-1
This file was deleted.

misc.d.ts

-1
This file was deleted.

0 commit comments

Comments
 (0)