Local development

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.
Name
Type
Required
Description
VITE_HOMEPAGE_URL
String
Homepage URL (e.g. http://127.0.0.1:3000)
VITE_COOKIE_DOMAIN
String
Cookie domain (e.g. 127.0.0.1)
VITE_STRIPE_PUBLISHABLE_KEY
String
VITE_GEETEST_CAPTCHA_ID
String
VITE_GOOGLE_RECAPTCHA_KEY
String
VITE_DISABLE_LOGIN_WITH_GOOGLE
Boolean
Is it allowed to log in with Google?
VITE_DISABLE_LOGIN_WITH_APPLE
Boolean
Is it allowed to log in with Apple?
VITE_VERIFY_USER_EMAIL
Boolean
Whether 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