This project is a demo of how Ably's low latency, guaranteed Quality of Service (QoS), and presence features can be used to create a collaborative piano that allows multiple users to play together in real-time.
The following technologies were used to build this demo:
- Ably: A realtime messaging platform that provides low-latency pub/sub messaging, presence, and QoS guarantees.
- Next.js 13: A server-side rendering (SSR) React framework that allows for easy creation of complex web applications.
- Auth0: A platform that provides secure authentication and authorization services for web applications.
- WebAudio API: A high-level JavaScript API for processing and synthesizing audio in web applications.
- ToneJS: A JavaScript library for creating interactive music in the browser.
- Canvas2D: A 2D drawing API for HTML5 canvas that allows for the creation of graphical elements and animations.
To run this project locally, follow these steps:
- Clone the repository:
git clone https://github.com/NickLittman/ably-piano.git - Install dependencies:
pnpm install - Create a free account on Ably and get your API key.
- Create a free account on Auth0 and get your client ID and secret.
- Create a
.env.localfile in the root of your project with the following variables: - Run the development server:
npm run dev - Open your browser and go to
http://localhost:3000
AUTH0_SCOPE='openid profile email read:shows'
ABLY_AUTH_TOKEN=<your-ably-api-key>
AUTH0_CLIENT_SECRET=<your-auth0-client-secret>
AUTH0_DOMAIN=<your-auth0-domain>
NEXT_PUBLIC_DOMAIN=<your-auth0-domain>
NEXT_PUBLIC_CLIENT_ID=<your-auth0-client-id>
NEXT_PUBLIC_AUDIENCE=<your-auth0-audience>
NEXT_PUBLIC_APP_ORIGIN=<your-configured-auth0-app-origin>
This project is licensed under the MIT License. See the LICENSE file for more information.