Code Reality Readme
This is work in progress...
Code Reality framework enables building networked extended reality (XR) experiences with A-Frame.
aframe-dataspace servers provide a shared space to store and transmit scene data between browsers.
Environments
Production:
Public test:
Browser support
Tested browsers (latest versions):
- Windows / Firefox
- Windows / Chrome
- macOS / Firefox
- macOS / Chrome
- macOS / Safari
- iOS / Safari
Tested devices:
- HTC Vive
- Oculus Go (Oculus Browser)
Build
npm run build:node npm run build:browser
Add to heroku
heroku create --region eu code-reality
git push heroku master
heroku logs -t
heroku logs -t --dyno=web
Run
Development mode
To run the node http server in development mode you need to run locally the following commands in separate terminals:
- npm run dev:node
- npm run dev:browser
Browse to: http://localhost:3001/
Access control
Authentication
Currently implemented authentication method is facebook authentication with express passport.
Authorization
Authorization to rest and web socket services are transmitted with JWT token. The trusted issuer public keys are listed in cluster configuration.
Generating key pair
RSA key pair can be generated as follows:
openssl genrsa -aes128 -out private.pem 2048
openssl rsa -in private.pem -outform PEM -pubout -out public.pem
openssl base64 -in private.pem -out private.base64
openssl base64 -in public.pem -out public.base64
Windows base64 encode:
certutil -encode public.pem tmp.b64; findstr /v /c:- tmp.b64 > public.b64; rm tmp.b64
certutil -encode private.pem tmp.b64; findstr /v /c:- tmp.b64 > private.b64; rm tmp.b64
Public test environment JWT signer RSA key pair:
-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApl9jOIkv7+MQpc3Y1UTz 9DNSXQeQJRI8IgkHoyKT2FXlaty+DBh42qLdcsRUWhT6BcTdV++3MI9mUluUA8zc 6s/oYR/Q3D8FJUi2Oe8VXhv1/edDQU2TguYaBvxiVZYXlXuDkjU05iKMYdiBcFp8 8t4FDFPUMRGgMNWpIDxGOeCxN0v8ott3OBkFHyokGdxMvu1q5KVS4Y60D8UgC/4i IGE3QCLqIzZ+jm0o8vAqgJG/rAL5UmufR+KnWdIIVfHyhZwxFjWuurfPZwKX23aj gcIDFjPf1XdeWdEViCGADeaiYfyrCk5E+I7x38Zj1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vc0xRcDhqaFY0TTg0VEpLS1g2YmN3ZUVsSzVDakJpVmE4MDNuSFp0SUd6c2N5UW9meDA1ejFWWHVIK1ZEcwova1hmTW1FenZ1RUdCK2t3MW9vbDJPczB2Q3FsV2hoQzlSTXB4KzRrbGlUbkhrbE1hcWpFc2hXQlloVVV3aG0rCkFqejMzWVUxTndtZXpDaENEYkxuQnkxeEFZR1c5TWtGUzRiYmZWSnN6cTRYYjdFYlg1K1NBU2N6c2RTcGZvc3UKL0Jxa2Y1K0xzc09vQVFqWER5cUJsb3VhcGptNDJZNk5peDl3ZGQ4NTdOMTB1cysvakd1ckt4bFJ1OVFsWE4rQwp3Q2VSUzZpemlPbXd4SVlGV25nSWZncGxaMDNVdWxENStDak1NQkV1eXZ3WnRnZUZMUkxJTnlmcGFvdGRBR3ExCldsVXRRVG9iaWFkT3dWQ29TV0M4SkkwbEUwSEVMYlIzNHJQZ0Mrck1BeTB2clpkd0FyKzd1aWpzWk5Md2dkQVYKT2luRnppajJ0bHlqN0E3cG1QK0tQTnNmYlZnbzJsMzR2SUp5UjhOR0docFk1Rkt4YnVYZHpBZ0szb0xFTlRIWQo3WGtPbWhqR2djdE4zSXJsVmZpekV5bDJkWVhCNndUVVZOa0lGVzlPeUE3RQotLS0tLUVORCBFTkNSWVBURUQgUFJJVkFURSBLRVktLS0tLQo=
Controllers
Controllers inputs are mapped to semantically meaningful buttons and sticks:
Buttons
- Trigger
- Grip
- Menu
- Left
- Right
- Up
- Down
Sticks
- Translate
- Rotate
Tools
Terms:
- Point - Entity is pointed by laser pointer.
- Hover - Entity is intersected or pointed by controller.
Movement Tool
Entity Tool
-
Grip Down - If entity hovered then hold else spawn and hold.
-
Grip Up - Release hold entity.
-
Trigger Down - Start laser pointer.
-
Trigger Up - Stop laser pointer.
-
Point - Increasing haptic feedback when entity is pointed until deleted after 3 seconds.
Publish package
First publish
npm publish --access public
Update
npm version patch
npm publish