Illust
MarketplaceGlobal Art MapBlogTwitter
  • Illust.space
  • .github
    • pull_request_template
  • docs
    • Illust Dev Docs
    • Packages
    • process
    • dev-workflow
      • Deployment
      • Development process
      • Visual Studio Code
    • libraries
      • Storybook
      • Act
      • Aframe
      • Chakra UI
      • Cypress
      • Hosting
      • React Three Fiber
        • Shadows
      • Firebase
        • Firestore
      • zustand
      • Firebase Url Shotener
    • Flows
      • User Sign In
      • Aframe AR Map
  • packages
    • Illust API
    • Illust Marketplace
    • Migrate DB
    • scraper
    • Illust Shared
    • Illust WebAR Discovery App
  • Illust Code Style Guide
    • JavaScript/TypeScript
    • Code Orgainzation
    • React
    • Testing
  • Knowledge Base
    • React
      • Hooks
Powered by GitBook
On this page
  • Local Development
  • Dev Environment
  • Lerna
  • Set up Credentials for Firebase Admin SDK
  • Add .env and other secret files.
  • Dependencies
  • Generate Contract types
  • Start the dev servers
  • Linting
  • Build & Deploy
  • Versioning

Was this helpful?

Illust.space

Next.github

Last updated 3 years ago

Was this helpful?

The monorepo for the Illust Space marketplace and WebAR map webapp.

Local Development

Dev Environment

Install:

  • Node 16

  • Yarn

  • Java (for the database emulator)

You can use to install the versions in the .tool-versions file.

You may also want to install the current version of bash with brew install bash, to fix issues with running pre-commit hooks.

Lerna

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 for available commands, and for other useful commands.

Set up Credentials for Firebase Admin SDK

Download a Service Account JSON file ). Then move it to

Add .env and other secret files.

Then copy over the .env and .runtimeconfig.json files to the matching packages/package-name directories.

You can also manually generate keys from the different services:

Firebase

https://console.firebase.google.com/project/illust-marketplace-staging/settings/general

Portis

https://dashboard.portis.io

Formatic

https://dashboard.fortmatic.com

Infura

https://infura.io/dashboard/ethereum

Dependencies

Install

Install npm dependencies for all packages. This uses Lerna and Yarn Workspaces, so most dependencies will be installed in the root node_modules:

yarn install
yarn bootstrap

Generate Contract types

Generate TypeScript files and types for the marketplace contract ABIs.

yarn contracts

Add

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

Rebuild node_modules

If there's a problem with your node_modules and you need to delete them all and start over:

yarn lerna clean
yarn bootstrap

Start the dev servers

When setting up the local project for the first time, you will need to build the API server:

yarn build:api

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:

yarn start

You can also run these in separate terminals, which can make debugging easier:

yarn start:api
yarn start:marketplace
yarn start:webar
yarn start:scraper

Use flag --https for when needed. ex: yarn start:webar --https Use a chrome flag chrome://flags/#allow-insecure-localhost to remove https warnings

Linting

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 eslint --fix and prettier:

yarn format

To check that everything is linted correctly and should pass CI:

yarn lint

Pre-commit hooks

Build & Deploy

You can manually build and deploy the api functions, marketplace frontend, and webar frontend to Firebase.

yarn build
yarn firebase deploy

Versioning

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:

yarn version:bump

Download the folders in .

marketplace will run on , webar on , scraper on , pvnp on , and api on . You can see the firebase function logs at .

We're using and to automatically format and lint files during a git commit. This should automatically install when you yarn bootstrap, and will run prettier, eslint, and tsc only on changed files.

In general, you should rely on the to build and deploy the apps. Merging to development will deploy to staging, and merging to main will deploy to production.

asdf
package.json
Lerna
see docs
packages/api/serviceAccountKey.json
Google Drive
localhost:3000
localhost:3001
localhost:3002
localhost:3003
localhost:5000
localhost:4000
Husky
lint-staged
Github Actions CI