The application can run with built-in fallback Firebase credentials, but it's recommended to use your own environment variables for better security:
-
Create the environment file: Run
npm run create-envto create an.envfile from the template. -
Configure Firebase credentials:
- Option A: Use the built-in fallback credentials (no action needed)
- Option B (recommended): Add your own Firebase credentials to the
.envfile
If you encounter a
Firebase: Error (auth/invalid-api-key)error, the application might be trying to use environment variables that aren't properly set. Either:- Make sure your
.envfile is properly configured with valid credentials - Or remove the
.envfile entirely to use the fallback values
Use terminal in the root of the project and run:
npm i
For a complete setup (create environment file and install dependencies):
npm run setup
Contains all the Micro frontends and shared code.
Contains the last 10 builds, these are use to grab the last 5 versions from for the build.
File ready for deployment to filebase hosting.
Each package can launch a dev environment
cd into /packages/{package-name} and run
npm run dev
There is a testing package that loads all the packages on a page. To run this
cd packages/testing
npm run dev
For unity development builds the unity webgl build should be built into into packages/testing/public/devBuilds/SpacesMetaverse_SDK
There is one setup for packages/webgl/public/devBuilds/SpacesMetaverse_SDK This is loaded in when you run a local dev environment for the webgl package.
Firebase has a webgl and space setup for this and will be looking for Build files here.
cd packages/testing
npm run dev
This is setup to load the SpacesMetaverse_SDK build using data from the firebase WebGlBuld record and space.
It gets the file paths from firebase (which are set to the local development url) and uses firebase user accounts, but loads the files from the local file system.
To run a full local build
Ensure you are in the root folder and run
npm run build
Ensure you are in the root folder and run
npm run deploy
Individual micro frontends (directly on firebase hosting): https://disruptive-metaverse.web.app/webgl https://disruptive-metaverse.web.app/header-auth-links
Other follow this format. https://disruptive-metaverse.web.app/{microframework-name}
WebFlow Test Page https://spaces.disruptive.live/spaces/spaces-master-build
The system uses Firebase user groups to manage permissions. By default, all new users are added to the 'users' group.
Spaces can be configured with different access levels:
- Public Access (Default): By default, spaces have
accessibleToAllUsersset totrue, allowing any user in the 'users' group to access them. - Restricted Access: When
accessibleToAllUsersis manually set tofalse, only users explicitly listed in the space'susersAllowed,usersAdmin, orusersModeratorsarrays can access it.
Space owners can manage accessibility settings through the Space Management modal:
- Open the main menu in a space
- Click "Manage Space"
- Go to the "Settings" tab
- Toggle the "Public Access" switch (on by default)
The project includes utility scripts for managing space accessibility:
scripts/checkSpacesAccessibility.js: Checks the current accessibility settings for all spacesscripts/setSpacesAccessible.js: Sets theaccessibleToAllUsersfield for all spaces
To run these scripts:
node scripts/checkSpacesAccessibility.js
node scripts/setSpacesAccessible.js
Note: You'll need to add your Firebase configuration to these scripts before running them.