Galaxy Browser offers an alternative way to organize and share knowledge — think Obsidian meets Chrome on a shared three-dimensional canvas with spreadsheet-inspired powerful macros. Article
Galaxy Browser v2 currently in development, join whitelist now.
After installing the Galaxy Browser desktop app, you can easily replicate the above scene:
- Create and select a new frame.
- Click "Open Macro".
- Paste this link:
galaxy://5ERMmhn6tWtbSX6HspQcztkHbpaYKiZHfiouDBDXgSnMhxU6/oct6-second
- The "input" variable magically references one element the arrow is pointing from.
- Any remote modules are resolved and built on the fly.
- The "input" element's value acts as the prompt.
- The result of the completion is displayed in the "output" element that the arrow points to.
- Version: v18 or later
- Download Node.js
- Check version with:
node --version
- Version: v1.36 or later
- Install Deno
- Check version with:
deno --version
- Install with:
npm install -g pnpm
- Check version with:
pnpm --version
- Download Docker
- Check version with:
docker --version
- Install with:
cargo install --force --locked cargo-contract
- Check version with:
cargo contract --version
These instructions will help you set up the project on your local machine for development and testing purposes.
git clone https://github.com/7flash/galaxy-polkadot.git
cd galaxy-polkadot
git checkout milestone2
git submodule update --init --recursive
pnpm install
To run the unit tests for the project, follow these steps:
- Start the frontend development server:
pnpm dev-frontend
- In a new terminal tab, run the tests:
pnpm test-frontend
Upon executing, you should observe an output resembling:
PASS tests/Galaxy.test.js (28.307 s)
Galaxy Macros Engine
✓ JS Macros (4340 ms)
✓ Deno macros (4270 ms)
✓ Python macros (5137 ms)
✓ Open Macro (4846 ms)
✓ Publish Macro (4805 ms)
✓ Save Macro (3877 ms)
Test Suites: 1 passed, 1 total
Tests: 6 passed, 6 total
Snapshots: 0 total
Time: 28.367 s
When focusing on the backend aspect of the project (specifically the main.ts
), follow these steps:
- Update submodules:
Since git submodules are always pointing to specific commit, its' important to ensure you have all of them synchronized to the recent main branch, before running backend:
pnpm pull-submodules
- Start the backend development server:
pnpm dev-deno
If you made modifications in the frontend while working on the backend, you'll need to rebuild both together to reflect the frontend changes:
- Rebuild both frontend and backend together:
pnpm dev-desktop
In production mode, backend will load recent frontend build from public repository, and then spawn a browser window.
In development mode, instead it will read frontend build locally from ./dist submodule folder.
In case, after running dev-desktop, it does not produce excalidraw-assets in ./dist folder as expected, run the following command to copy it manually from recent release:
cp ./node_modules/@galaxydo/excalidraw/dist/excalidraw-assets ./dist
Accordingly, if you made changes in excalidraw submodule, make sure to rebuild it.
cd excalidraw/src/packages/excalidraw && yarn build:umd
Then publish a new release to registry, and update dependency in package.json to your version.
In production mode, deno-webui package loads static library webui from public a repository, resolving to the file corresponding to the target platform.
In development mode, local library path must be specified in main.ts
In case, the path of webui compiled library on your platform differs from default path, you must compile it manually (make sure to have cpp installed) and then update libPath parameter above.
cd desktop/webui && make
To release the project, execute the following commands in sequence:
- Build for release:
pnpm release-first
- Compile for macOS:
pnpm release-second
- Run the build script:
pnpm release-third
Executing these commands in order ensures that the project is built, compiled, and prepared for release appropriately.
Docker Limitations:
Docker image only suitable for running and testing frontend app. It also allows to define and execute frontend-side JS macros, including "publish" macro which invokes wallet transaction to publish layer.
But since backend is designed to launch a default user browser installed on local machine, docker is not suitable for running backend app.
In case of testing backend-side Deno macros, such as "save" macro to save layers in persistent local database, please either follow instructions above to run full app locally, or simply install recent release build, which already includes deno engine (but does not include chromium and still depends on user default browser and its default profile with installed wallet extension)
Build Image:
docker build -t galaxy:latest .
Run Application:
docker run -d -p 8080:80 galaxy:latest
Open http://localhost:8080 in your browser.
Ensure the latest version:
cd contract
git pull && git checkout main
Compile source to galaxy.wasm
cargo contract build
The Galaxy Contract has been deployed on the Rococo testnet.
- Contract Address:
5E1zfVZmokEX29W9xVzMYJAzvwnXWE7AVcP3d1rXzWhC4sxi
After new deployment, ensure to update the address in GalaxyAPI.ts.
Layers padding When loading a scene into a new frame, notice that all elements coordinates are adjusted to fit into the frame, adjusting the frame size as well if needed, also clipping an empty space surronding elements in the original frame. In case if its' crucial to maintain the padding, make sure to draw an additional rectangle container around the elements inside of the frame with needed padding when publishing.
This project is licensed under the MIT License.