Skip to content

Commit 3c5f722

Browse files
authored
revamp readme (#78)
1 parent 198b766 commit 3c5f722

File tree

7 files changed

+60
-80
lines changed

7 files changed

+60
-80
lines changed

CONTRIBUTING.md

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,21 @@ The signing process has been automated by [CLA Assistant][cla-assistant] during
7979

8080
## Common tasks
8181

82-
We use [yarn](https://yarnpkg.com/) to run common tasks in the project.
82+
We use [yarn](https://yarnpkg.com/) to manage dependencies and do common tasks.
83+
84+
### Installing dependencies
85+
86+
Setup git submodules: `git submodule update --init --recursive`
87+
88+
Run `yarn install` in the _root_ project directory.
89+
90+
Install LFS: `git lfs install`
91+
92+
### Running for development
93+
94+
```
95+
yarn run dev
96+
```
8397

8498
### Testing
8599

@@ -106,8 +120,39 @@ yarn run lint
106120

107121
### Adding dependencies
108122

109-
This project uses [yarn](https://yarnpkg.com/) for managing dependencies.
110-
111123
```sh
112124
yarn add <package>
113125
```
126+
127+
### Updating wasm dependencies
128+
129+
The project contains prebuilt WASM files for versions of both SpiceDB and zed. To update the versions, edit the [wasm-config.json] file with the desired tag/commit hash and then run from the project root:
130+
131+
`yarn run update:spicedb`
132+
133+
`yarn run update:zed`
134+
135+
> ℹ️ [jq] is required and must be installed.
136+
137+
[wasm-config.json]: https://github.com/authzed/playground/blob/main/spicedb-common/wasm-config.json
138+
[jq]: https://jqlang.github.io/jq/
139+
140+
### Updating the generated protobuf code
141+
142+
This project uses generated gRPC code to talk to the download API. To regenerate:
143+
144+
1. Install [buf](https://buf.build/docs/installation/) if you haven't already
145+
1. Run `yarn run buf:generate`
146+
1. Commit the changes
147+
148+
### Building the Docker Container
149+
150+
```
151+
docker build . -t tag-for-playground-image
152+
```
153+
154+
Build args can be specified for the build-time environment variables:
155+
156+
```
157+
docker build --build-arg VITE_SHARE_API_ENDPOINT=https://my.playground.endpoint . -t tag-for-playground-image
158+
```

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ COPY . .
77
ENV YARN_CACHE_FOLDER=/tmp/yarn_cache
88

99
# Environment variables for build time.
10-
ARG VITE_AUTHZED_DEVELOPER_GATEWAY_ENDPOINT=""
1110
ARG VITE_GOOGLE_ANALYTICS_MEASUREMENT_ID=""
1211

1312
ARG VITE_DISCORD_CHANNEL_ID=""

README.md

Lines changed: 12 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77

88
# Playground
99

10-
The SpiceDB Playground is an interactive app for building a [SpiceDB] schema, interacting with test relationships, and quickly iterating with test assertions.
10+
The [SpiceDB] Playground is an interactive app for building a [SpiceDB] schema, interacting with test relationships, and quickly iterating with test assertions.
1111

1212
Whether you're just getting started learning SpiceDB concepts or need to develop a new permissions system schema for your application, the SpiceDB playground has functionality to help.
1313

14-
SpiceDB Playground features include:
14+
![screenshot](./img/playground_screen.png)
15+
16+
Features include:
1517

1618
- Rich text editor with syntax highlighting and tooltips
1719
- Visual relationship editor with support for defining caveat context data
@@ -27,11 +29,15 @@ SpiceDB is a graph database purpose-built for storing and evaluating access cont
2729

2830
As of 2021, broken access control became the #1 threat to the web. With SpiceDB, developers finally have the solution to stopping this threat the same way as the hyperscalers.
2931

30-
Learn more about [SpiceDB]
31-
3232
[SpiceDB]: https://authzed.com/spicedb
3333

34-
## Getting Started
34+
# Getting Started
35+
36+
## Run locally
37+
38+
```command
39+
yarn add global serve && yarn build && cd build && serve
40+
```
3541

3642
## Deploying
3743

@@ -84,35 +90,7 @@ To enable the sharing functionality on Vercel, you need to configure the followi
8490
- `VITE_DISCORD_SERVER_ID` - Discord server ID
8591
- `VITE_DISCORD_INVITE_URL` - Discord invite URL (defaults to https://authzed.com/discord)
8692

87-
You can set these environment variables in the Vercel dashboard under your project's Settings > Environment Variables.
88-
89-
### NodeJS
90-
91-
The `build` directory in the project root directory after running `yarn build` will contain an optimized production React application that can be served using your preferred NodeJS hosting method.
92-
93-
> ℹ️ Node v18.x is required.
94-
95-
For example:
96-
97-
```command
98-
yarn global install serve
99-
cd build
100-
serve
101-
```
102-
103-
## Installing dependencies
104-
105-
Setup git submodules: `git submodule update --init --recursive`
106-
107-
Run `yarn install` in the _root_ project directory.
108-
109-
Install LFS: `git lfs install`
110-
111-
## Running for development
112-
113-
```
114-
yarn run dev
115-
```
93+
You can set these environment variables in the Vercel dashboard under your project's _Settings > Environment Variables_.
11694

11795
### Running for development with sharing enabled
11896

@@ -122,39 +100,6 @@ The `vercel` CLI can be used to run locally with sharing enabled:
122100
VITE_SHARE_API_ENDPOINT=http://localhost:3000 SHARE_SALT=... AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... S3_ENDPOINT=... S3_BUCKET=... vercel dev
123101
```
124102

125-
## Updating wasm dependencies
126-
127-
The project contains prebuilt WASM files for versions of both SpiceDB and zed. To update the versions, edit the [wasm-config.json] file with the desired tag/commit hash and then run from the project root:
128-
129-
`yarn run update:spicedb`
130-
131-
`yarn run update:zed`
132-
133-
> ℹ️ [jq] is required and must be installed.
134-
135-
[wasm-config.json]: https://github.com/authzed/playground/blob/main/spicedb-common/wasm-config.json
136-
[jq]: https://jqlang.github.io/jq/
137-
138-
## Updating the generated protobuf code
139-
140-
This project uses generated gRPC code to talk to the download API. To regenerate:
141-
142-
1. Install [buf](https://buf.build/docs/installation/) if you haven't already
143-
1. Run `buf generate`
144-
1. Commit the changes
145-
146-
## Building the Docker Container
147-
148-
```
149-
docker build . -t tag-for-playground-image
150-
```
151-
152-
Build args can be specified for the build-time environment variables:
153-
154-
```
155-
docker build --build-arg VITE_SHARE_API_ENDPOINT=https://my.playground.endpoint . -t tag-for-playground-image
156-
```
157-
158103
## Developing your own schema
159104

160105
You can try both [SpiceDB](https://github.com/authzed/spicedb) and [zed](https://github.com/authzed/zed) entirely in your browser on a SpiceDB Playground deployment thanks to the power of [WebAssembly](https://authzed.com/blog/some-assembly-required).

TODO.md

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

img/playground_screen.png

186 KB
Loading

placeholder.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# You can copy this file to .env and set these locally.
22
# Otherwise we set envs at the vercel level.
3-
VITE_AUTHZED_DEVELOPER_GATEWAY_ENDPOINT=
43
VITE_GOOGLE_ANALYTICS_MEASUREMENT_ID=
54

65
VITE_DISCORD_CHANNEL_ID=

src/vite-env.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/// <reference types="vite/client" />
22

33
interface ImportMetaEnv {
4-
readonly VITE_AUTHZED_DEVELOPER_GATEWAY_ENDPOINT?: string | undefined | null;
54
readonly VITE_GOOGLE_ANALYTICS_MEASUREMENT_ID?: string;
65

76
readonly VITE_DISCORD_CHANNEL_ID?: string;

0 commit comments

Comments
 (0)