A Turborepo monorepo for Populemetry, the market for entertainment popularity. This repository contains both the static marketing site and the dynamic waitlist application, sharing common components and utilities across both.
This monorepo uses Turborepo to manage two applications and a shared package:
apps/populemetry-web- A Gatsby static site for marketing pages (landing, contact, terms, privacy)apps/populemetry-app- A React SPA built with Vite for the waitlist and user dashboardpackages/shared- Shared React components, hooks, and utilities used across both apps
The separation makes sense: Gatsby handles the static, SEO-friendly marketing pages, while the React app powers the interactive waitlist and user flows. Both share UI components to keep design consistent.
- Monorepo: Turborepo with npm workspaces
- Frontend: React 18, TypeScript 5
- Styling: Tailwind CSS 3
- Static Site: Gatsby 5
- React App: Vite 5, React Router 6
- Package Manager: npm
You'll need Node.js 18.0.0 or higher. Verify your setup:
node --version # Should be >= 18.0.0
npm --version # Should be >= 8.0.0- Install dependencies from the root:
npm installThis installs dependencies for all workspaces (root, both apps, and the shared package).
- Build the shared package before running the apps:
cd packages/shared
npm run build
cd ../..The shared package needs to be built first since both apps depend on it.
Run both applications simultaneously:
npm run devThis starts:
- Gatsby site at
http://localhost:8000(GraphiQL athttp://localhost:8000/___graphql) - React app at
http://localhost:5173
Both apps support hot module replacement, so changes will reflect immediately in the browser.
Running apps individually:
# Gatsby only
cd apps/populemetry-web && npm run dev
# React app only
cd apps/populemetry-app && npm run devBuild everything:
npm run buildOr build individual apps:
# Gatsby
cd apps/populemetry-web && npm run build
# Output: apps/populemetry-web/public
# React app
cd apps/populemetry-app && npm run build
# Output: apps/populemetry-app/distTesting production builds:
# Gatsby
cd apps/populemetry-web && npm run serve
# Visit http://localhost:9000
# React app
cd apps/populemetry-app && npm run preview
# Visit http://localhost:4173populemetry/
├── apps/
│ ├── populemetry-web/ # Gatsby static site
│ │ ├── src/
│ │ │ ├── pages/ # Page components (index, contact, terms, privacy)
│ │ │ ├── components/ # App-specific components
│ │ │ ├── hooks/ # App-specific hooks
│ │ │ └── styles/ # Global styles
│ │ ├── gatsby-config.js # Gatsby configuration
│ │ └── tailwind.config.js # Tailwind config
│ │
│ └── populemetry-app/ # React SPA
│ ├── src/
│ │ ├── pages/ # Page components (Waitlist, Dashboard, etc.)
│ │ ├── App.tsx # Main app component with routing
│ │ ├── main.tsx # Entry point
│ │ └── index.css # Global styles
│ ├── vite.config.ts # Vite configuration
│ ├── tailwind.config.js # Tailwind config
│ └── index.html # HTML template
│
├── packages/
│ └── shared/ # Shared components and utilities
│ ├── src/
│ │ ├── components/ # Reusable components (Button, Input, Logo, Footer)
│ │ └── index.ts # Package exports
│ └── tsconfig.json # TypeScript config
│
├── turbo.json # Turborepo configuration
└── package.json # Root package.json with workspace scripts
/- Landing page/404- 404 error page/contact- Contact form/contact-confirmation- Contact confirmation/terms- Terms of Service/privacy- Privacy Policy
/- Waitlist registration/waitlist-confirmed- Waitlist confirmation/funding- Funding tier selection/confirm-funding- Funding confirmation/dashboard- User dashboard/referral-access- Referral link access
The packages/shared directory contains reusable components and utilities used across both applications:
Logo- Brand logo component (supports light/dark variants)Button- Reusable button component with variantsInput- Form input componentFooter- Site footer component
When working on shared components, you can watch for changes:
cd packages/shared
npm run dev # Watches for changes and rebuilds# Install all dependencies
npm install
# Run both apps in development
npm run dev
# Build everything
npm run build
# Clean build artifacts
npm run clean
# Build shared package
cd packages/shared && npm run build
# Watch shared package for changes
cd packages/shared && npm run devIf you see port conflicts, find and kill the process:
Gatsby (port 8000):
# Windows
netstat -ano | findstr :8000
taskkill /PID <PID> /F
# macOS/Linux
lsof -ti:8000 | xargs killReact app (port 5173):
# Windows
netstat -ano | findstr :5173
taskkill /PID <PID> /F
# macOS/Linux
lsof -ti:5173 | xargs killIf you see Cannot find module '@populemetry/shared', rebuild the shared package:
cd packages/shared
npm run buildIf Gatsby is showing stale content or behaving unexpectedly:
cd apps/populemetry-web
npm run clean
npm run devIf you're experiencing weird dependency problems, sometimes a clean slate helps:
# Remove all node_modules
rm -rf node_modules apps/*/node_modules packages/*/node_modules
# Remove lock file
rm package-lock.json
# Reinstall
npm install-
Hot Module Replacement: Both apps support HMR. Changes should reflect immediately without full page reloads.
-
Shared Components: When modifying shared components, run
npm run devin the shared package directory to watch for changes. The apps will pick up the rebuilt package. -
TypeScript: Both apps use strict TypeScript. Type errors will surface in your editor and during builds.
-
Tailwind CSS: Each app has its own
tailwind.config.js. The shared package doesn't include Tailwind since it's a component library, not a full app.
This monorepo is configured for deployment on Vercel with two separate projects:
The Gatsby static site should be deployed as the main landing page:
-
Create a new Vercel project for
populemetry-web -
Configure the project settings:
- Root Directory:
apps/populemetry-web - Framework Preset: Gatsby (auto-detected from
vercel.json) - Build Command:
npm run build(fromvercel.json) - Output Directory:
public(fromvercel.json) - Install Command:
cd ../.. && npm install && cd packages/shared && npm run build(fromvercel.json)
- Root Directory:
-
Assign your main domain to this project (e.g.,
populemetry.com)
The vercel.json file in apps/populemetry-web/ is already configured with these settings.
The React SPA should be deployed as a separate project:
-
Create a new Vercel project for
populemetry-app -
Configure the project settings:
- Root Directory:
apps/populemetry-app - Framework Preset: Vite (auto-detected from
vercel.json) - Build Command:
npm run build(fromvercel.json) - Output Directory:
dist(fromvercel.json) - Install Command:
cd ../.. && npm install && cd packages/shared && npm run build(fromvercel.json)
- Root Directory:
-
Assign a subdomain to this project (e.g.,
app.populemetry.comorwaitlist.populemetry.com)
The vercel.json file in apps/populemetry-app/ is already configured with these settings, including SPA routing rewrites.
- Both projects need to be connected to the same Git repository
- The shared package will be built automatically as part of the build process
- Make sure both apps have access to the
packages/shareddirectory - The Gatsby site should be your primary domain for SEO and marketing purposes
- The React app should be on a subdomain or subpath for user-facing functionality
Private - All Rights Reserved