The monorepo for the Illust Space marketplace and WebAR map webapp.
- Node 16
- Java (for the database emulator)
You may also want to install the current version of
brew install bash, to fix issues with running pre-commit hooks.
This monorepo uses Lerna and Yarn Workspaces to manage shared node packages. Most commands should be run from the root of the project. See the package.json for available commands, and Lerna for other useful commands.
Download a Service Account JSON file see docs). Then move it to packages/api/serviceAccountKey.json
Then copy over the
.runtimeconfig.jsonfiles to the matching
You can also manually generate keys from the different services:
Install npm dependencies for all packages. This uses Lerna and Yarn Workspaces, so most dependencies will be installed in the root
Generate TypeScript files and types for the marketplace contract ABIs.
To add a dependency to a particular package:
yarn lerna add dep-name --scope=@illust/package-name
Add a dependency to all packages:
yarn lerna add dep-name
Add a dev dependency to the root only:
yarn add dep-name --dev -M
If there's a problem with your node_modules and you need to delete them all and start over:
yarn lerna clean
When setting up the local project for the first time, you will need to build the API server:
And also run the following command to set the default firebase project:
yarn firebase use staging
After running those commands once, you can run the following command to start the firebase emulator for the cloud functions and webpack-dev-server for the marketplace and webar frontends:
marketplacewill run on localhost:3000,
pvnpon localhost:3003, and
apion localhost:5000. You can see the firebase function logs at localhost:4000.
You can also run these in separate terminals, which can make debugging easier:
Use flag --https for when needed. ex:
yarn start:webar --httpsUse a chrome flag
chrome://flags/#allow-insecure-localhostto remove https warnings
Note that in general you should set up your code editor to show eslint errors and to format with prettier. The pre-commit hooks also should catch any linting errors. But if you want to manually auto-format the codebase with
To check that everything is linted correctly and should pass CI:
We're using Husky and lint-staged to automatically format and lint files during a git commit. This should automatically install when you
yarn bootstrap, and will run
tsconly on changed files.
In general, you should rely on the Github Actions CI to build and deploy the apps. Merging to
developmentwill deploy to staging, and merging to
mainwill deploy to production.
You can manually build and deploy the
webarfrontend to Firebase.
yarn firebase deploy
When doing a release to production, you want to generate new version numbers on the
release/branch before merging to main. To do that on public packages that have changed since the last release, run: