Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MMB-195] Rewrite spaces demo into React #92

Merged
merged 25 commits into from
Aug 7, 2023
Merged
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
1 change: 1 addition & 0 deletions demo/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ABLY_API_KEY=
20 changes: 20 additions & 0 deletions demo/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"env": {
"es6": true,
"node": true,
"browser": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
},
"plugins": ["import"],
"overrides": [
{
"files": ["**/*.{ts,tsx}"],
"rules": {
"import/extensions": ["off"]
}
}
]
}
20 changes: 0 additions & 20 deletions demo/.eslintrc.js

This file was deleted.

24 changes: 24 additions & 0 deletions demo/.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?
6 changes: 4 additions & 2 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ An app showcasing the usage of different multiplayer features enabled by the spa

First, create a `.env` file in this folder, based on the `.env.example`. You will need environment variables listed in there.

You will need [node.js](https://nodejs.org/en/) & the [netlify cli](https://docs.netlify.com/cli/get-started/) installed. The demo has separate dependencies to the library, you will need to run `npm install` in this folder as well as the root one.
You will need [node.js](https://nodejs.org/en/). The demo has separate dependencies to the library, you will need to run `npm install` in this folder as well as the root one.

To run the development server, do `npm run start`. This will start a Netlify dev server, and will make sure the auth endpoint in `api` works correctly locally.

## Deployment

To deploy, you will need access to the Ably Netlify account. If you have that, [login to Netlify on your machine with the CLI](https://docs.netlify.com/cli/get-started/#obtain-a-token-with-the-command-line). The run `npm run deploy` to deploy a test site and `npm run deploy:production` to deploy the production site.
To deploy, you will need access to the Ably Netlify account. Run `npx netlify login` to [login locally](https://docs.netlify.com/cli/get-started/#obtain-a-token-with-the-command-line).

We use Netlify [manual deploys](https://docs.netlify.com/site-deploys/create-deploys/), so do connect the repo to the github repo when prompted by the CLI. Run `npm run deploy` to deploy a test site and `npm run deploy:production` to deploy the production site.
2 changes: 1 addition & 1 deletion demo/api/ably-token-request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Please see README.md for more details on configuring your Ably API Key.`);
};
}

const clientId = event.queryStringParameters['clientId'] || process.env.DEFAULT_CLIENT_ID || 'NO_CLIENT_ID';
const clientId = event.queryStringParameters?.['clientId'] || process.env.DEFAULT_CLIENT_ID || 'NO_CLIENT_ID';
const client = new Ably.Rest(process.env.ABLY_API_KEY);
const tokenRequestData = await client.auth.createTokenRequest({ clientId: clientId });

Expand Down
2 changes: 1 addition & 1 deletion demo/api/ably-token-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "ably token request",
"main": "index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"serve": "netlify functions:serve"
},
"keywords": [
"netlify",
Expand Down
7 changes: 0 additions & 7 deletions demo/app/assets/svg/placeholder-slide-1.svg

This file was deleted.

6 changes: 0 additions & 6 deletions demo/app/assets/svg/placeholder-slide-2.svg

This file was deleted.

6 changes: 0 additions & 6 deletions demo/app/assets/svg/placeholder-slide-3.svg

This file was deleted.

140 changes: 0 additions & 140 deletions demo/app/components/avatar-stack.ts

This file was deleted.

111 changes: 0 additions & 111 deletions demo/app/components/cursors.ts

This file was deleted.

Loading
Loading