Local development

Requirements

For macOS users, you can install them by Homebrew:

brew tap mongodb/brew
brew install node@18 [email protected] redis

For Windows users, you can install them by Chocolatey:

choco install nodejs --version=18.11.0 -y
choco install mongodb --version=4.4.29 -y
choco install redis-64 --version=3.0.501 -y

Environment variables

Server

Copy .env.example to .env.local file in packages/server directory. How to match .env? Refer to: Environment Variables

Webapp

Copy .env.example to .env.local file in packages/webapp directory. All of these environment variables are not necessary during webapp compiling, as the server will pass them when rendering the HTML.

NameTypeRequiredDescription
VITE_HOMEPAGE_URLStringHomepage URL (e.g. http://127.0.0.1:3000)
VITE_COOKIE_DOMAINStringCookie domain (e.g. 127.0.0.1)
VITE_STRIPE_PUBLISHABLE_KEYStringhttps://docs.stripe.com/keys
VITE_GEETEST_CAPTCHA_IDStringhttps://docs.geetest.com/captcha/overview/guide#Step-1-Get-your-captcha-ID-and-KEY
VITE_GOOGLE_RECAPTCHA_KEYStringhttps://cloud.google.com/recaptcha-enterprise/docs/create-key-website
VITE_DISABLE_LOGIN_WITH_GOOGLEBooleanIs it allowed to log in with Google?
VITE_DISABLE_LOGIN_WITH_APPLEBooleanIs it allowed to log in with Apple?
VITE_VERIFY_USER_EMAILBooleanWhether it is necessary to verify the email addresses of the new users

Setup

pnpm install
pnpm build:deps

# Migrate database
pnpm --filter ./packages/server migrate:seed

Run dev server

The NodeJS server will run on http://127.0.0.1:8000 and web app will run on http://127.0.0.1:3000.

pnpm dev