Multi-Project Architecture
Learn how to leverage Weaverse’s Multi-Project Architecture to build sophisticated storefronts supporting multiple markets, run A/B tests, and manage multiple brands from a single Shopify store.Overview
Multi-Project Architecture allows you to create and manage multiple independent Weaverse projects, each with its own theme settings, content, and page structures, while sharing the same Shopify data source and codebase.What is Multi-Project Architecture?
Instead of managing all content in a single Weaverse project, you can create separate projects for different:- Markets & Locales - Sweden (mystore.se), France (mystore.fr), Germany (mystore.de)
- A/B Test Variants - Test different themes, layouts, or content strategies
- Brands - Multiple brands from one Shopify store with distinct identities
- Environments - Separate dev, staging, and production projects
Key Benefits
Independent Themes
Each project has completely different colors, fonts, layouts, and branding
Market-Specific Content
Unique page structures, navigation, and content tailored per market
A/B Testing
Run experiments with different designs and track performance
Brand Separation
Multiple brands with distinct identities from one Shopify store
Team Isolation
Different teams manage their projects independently
Flexible Routing
Support any URL structure: domains, subdomains, paths, or custom logic
When to Use Multi-Project
Use Multi-Project Architecture When:
Different branding per market - Each locale needs unique colors, fonts, layouts
Top-level domains or subdomains - mystore.se, mystore.fr, se.mystore.com
A/B testing is important - Testing themes, layouts, content strategies
Market-specific pages - Different navigation, page types per locale
Multiple brands - Sub-brands with distinct identities
Team isolation needed - Separate teams per market without conflicts
Staged rollouts - Launch features to specific markets first
Use Single-Project Architecture When:
Content translation only - Same branding across all locales
Centralized management - One team manages all markets
Path-based URLs -
/en-us, /fr-ca URL structureLimited budget/team - Smaller operation with simpler needs
Shared theme settings - All markets use identical styling
Core Concepts
The projectId Parameter
The projectId is the unique identifier for each Weaverse project. You can configure it at two levels:
1. Client-Level (WeaverseClient)
Set the default project for all routes:2. Route-Level (loadPage)
Override the project for specific routes:When to use which approach:
- Client-level: Use for global routing logic (domain-based, subdomain-based, cookie-based)
- Route-level: Use for specific pages that need different projects (special campaigns, featured collections, testing specific routes)
Project Routing Flow
- User makes request to your storefront (e.g.,
mystore.se/products/shoe) - Route loader executes and calls
weaverse.loadPage() - Project determination:
- If route specifies
projectIdparameter → use that project - Otherwise, WeaverseClient evaluates its
projectIdfunction → use returned project
- If route specifies
- Weaverse loads content from the determined project
- Page renders with project’s theme settings and content
Project Lifecycle in Studio
1
Create Base Project
Develop your primary storefront in Weaverse Studio. This becomes your template for other projects.
2
Duplicate Project
In Studio, duplicate your base project for each market, variant, or brand. Each gets a unique project ID.
3
Customize Independently
Modify each project’s theme settings, content, pages, and navigation without affecting other projects.
4
Implement Routing
Add
projectId routing logic to your codebase to direct traffic to the correct project.Use Case 1: Multi-Market Localization
Build a global storefront with different domains per country, each with market-specific branding and content.Business Case
Scenario: You operate in Sweden, France, and Germany with:- Different domains:
mystore.se,mystore.fr,mystore.de - Market-specific branding (colors, logos)
- Localized content and navigation
- Regional promotions and campaigns
Studio Workflow
1. Create Sweden Project (Base)- Build your primary storefront for Sweden
- Set Swedish theme settings (blue/yellow colors, Swedish fonts)
- Create content and navigation in Swedish
- In Studio: Click project menu → “Duplicate Project”
- Name: “France Market”
- Project ID:
project-france-456(auto-generated)
- Update theme settings (blue/white/red colors, French fonts)
- Translate content to French
- Adjust navigation for French market
- Add France-specific promotions
- Duplicate base project
- Customize for German market (black/red/yellow, German content)
Technical Implementation
WeaverseClient Setup
Environment Variables
Server Entry Point
Route Usage
DNS & Deployment Setup
1. Domain Configuration (Shopify Domains) For each market, add custom domains in your Shopify admin:- Go to Settings → Domains in Shopify admin
- Click Connect existing domain for each market domain
- Configure DNS according to Shopify’s instructions:
- Go to Settings → Hydrogen
- Select your storefront
- Add environment variables under Environment variables
Testing
Complete Example
Use Case 2: A/B Testing & Experimentation
Run experiments with different themes, layouts, or content strategies to optimize conversions.Business Case
Scenario: You want to test:- Control (A): Current theme with blue color scheme
- Variant (B): New theme with green color scheme and different layout
A/B Testing Fundamentals
Key Concepts:- Control: Original version (baseline)
- Variant: New version being tested
- Traffic Split: How you divide users (50/50, 80/20, etc.)
- Consistency: Same user sees same variant across sessions
- Tracking: Measure performance metrics for each variant
Studio Workflow
1. Create Control Project (A)- Your existing production project
- Project ID:
project-control-123
- Duplicate control project in Studio
- Name: “Green Theme Experiment”
- Project ID:
project-variant-456
- Change theme colors to green
- Modify homepage layout
- Update CTA buttons
- Adjust product page design
- Document changes made in variant
- Note start date and goals
- Plan when to end experiment
Technical Implementation: Cookie-Based Routing
WeaverseClient with A/B Testing
Root Route with Cookie Setting
Advanced: 80/20 Split
Analytics Integration
Track experiment performance with your analytics provider:Complete A/B Testing Example
Route-Level A/B Testing
For testing specific pages or routes without affecting the entire site:- Test product page layouts without changing homepage
- Experiment with collection page designs
- Test checkout flow variations
- Try different landing page versions for campaigns
A/B Testing Best Practices
Run Experiments Long Enough
Run Experiments Long Enough
Minimum Duration: 2 weeks to account for weekday/weekend variationsSample Size: Ensure enough traffic for statistical significanceAvoid: Ending tests too early based on initial results
Test One Variable at a Time
Test One Variable at a Time
Good: Test color scheme OR layout separatelyBad: Change colors AND layout AND copy simultaneouslyWhy: Isolate what drives performance differences
Ensure Consistent Experience
Ensure Consistent Experience
Critical: Same user always sees same variantImplementation: Use cookies with long expiry (30 days)Avoid: Random assignment on every page load
Monitor Technical Metrics
Monitor Technical Metrics
Track:
- Page load time per variant
- Error rates
- Bounce rates
Use Case 3: Multi-Brand Storefronts
Manage multiple brands with distinct identities from a single Shopify store.Business Case
Scenario: You operate two brands from one Shopify store:- Brand A (Premium) -
brand-a.mystore.com- Luxury positioning, dark theme - Brand B (Affordable) -
brand-b.mystore.com- Value positioning, bright theme
- Completely different branding and themes
- Separate navigation and content
- Shared product catalog (same Shopify store)
- Independent marketing campaigns
Studio Workflow
1. Create Brand A Project- Build premium brand theme (dark colors, elegant fonts)
- Curate product collections for Brand A
- Create luxury-focused content and navigation
- Duplicate Brand A project
- Complete theme redesign (bright colors, friendly fonts)
- Adjust product presentation for value positioning
- Create different content and messaging
Technical Implementation: Subdomain Routing
Environment Variables
Brand-Specific Product Filtering
DNS Configuration (Shopify)
Configure custom domains in Shopify admin for each brand:- Go to Settings → Domains in Shopify admin
- Add each subdomain as a custom domain
- Follow Shopify’s DNS configuration instructions
Complete Multi-Brand Example
Technical Implementation Deep Dive
WeaverseClient Configuration
Static Project ID
Function-Based Project ID
Route-Level Project Override
Override the default project for specific routes using theprojectId parameter in loadPage():
Basic Route Override
Conditional Route Override
Dynamic Route Override Based on Parameters
Campaign Landing Pages
Use dedicated projects for seasonal campaigns, sales events, or promotional pages
Featured Collections
Highlight special collections with unique designs and layouts
Beta Features
Test new features on specific routes before rolling out site-wide
VIP/Premium Content
Special experiences for premium products or VIP customer segments
Advanced Routing Patterns
Path-Based Routing
Query Parameter Routing
Header-Based Routing
Combined Routing Strategy
Performance Considerations
Caching Strategies
CDN Configuration
Ensure your CDN caches correctly per project:Migration Guide
Step-by-step guide to migrate from single-project to multi-project architecture.Phase 1: Planning (1-2 days)
1
Assess Current Setup
Audit your current implementation:
- Current project ID and environment variables
- Number of markets/brands you need
- URL structure requirements (domains, subdomains, paths)
- Team structure and responsibilities
- List of projects needed
- Project IDs (will get from Studio)
- Routing logic requirements
2
Define Project Structure
Decide on:
- How many projects you need
- Naming convention for projects
- Which project will be your “base” template
- URL routing strategy
3
Plan Routing Strategy
Choose routing method:
- Domain-based (recommended for markets)
- Subdomain-based (good for brands)
- Path-based (simpler but less isolated)
- Hybrid approach
Phase 2: Studio Setup (2-4 hours)
1
Identify Base Project
Your existing project becomes the template.Note down:
- Current project ID (find in Studio settings)
- Theme settings to replicate
- Key pages and sections
2
Duplicate Projects
For each market/brand:
- Open your project in Weaverse Studio
- Click project menu → “Duplicate Project”
- Name: “Sweden Market” (or similar)
- Copy project ID from Studio (e.g.,
project-sweden-456) - Repeat for all projects needed
3
Initial Customization
For each new project:
- Update theme settings (colors, fonts if needed)
- Test that project loads in Studio
- Don’t do full customization yet (do after code is deployed)
Phase 3: Code Implementation (4-8 hours)
1
Update Environment Variables
Add new project IDs to Update deployment environment:
.env:- Add secrets to Fly.io, Vercel, or your hosting provider
- Test that all variables are accessible
2
Create WeaverseClient Factory
Create or update
app/lib/weaverse/weaverse.server.ts:3
Update Server Entry Point
Modify
app/entry.server.tsx or server.ts:4
Test in Development
Test routing logic:Verify:
- Correct project loads for each domain
- No errors in console
- Pages render correctly
Phase 4: Content Customization (Variable time)
1
Customize Each Project
For each market/brand project:
-
Theme Settings
- Update colors, fonts, layouts per market
- Adjust logo and branding elements
- Configure market-specific settings
-
Content Translation
- Translate all text content
- Localize navigation menus
- Adjust imagery for market
-
Page Customization
- Modify page layouts if needed
- Add market-specific sections
- Configure regional promotions
2
Content Sync Strategy
For shared content:
- Use Weaverse Import/Export to sync base content
- Update components in base project, export, import to others
- Establish workflow for keeping projects aligned
- Create market-specific pages directly in each project
- Document what’s shared vs unique
Phase 5: Deployment (2-4 hours)
1
Configure DNS
For each domain:SSL Certificates:
- Ensure SSL for all domains in hosting provider
- Test HTTPS access for each domain
2
Deploy to Staging
Deploy code with multi-project logic:Test staging:
- Access each domain in staging
- Verify correct project loads
- Check all pages work correctly
3
Gradual Production Rollout
Option A: All at once
- Deploy to production
- Update DNS for all domains
- Monitor for issues
- Deploy code to production (with fallback to default project)
- Update DNS for one domain (e.g., mystore.se)
- Monitor for 24-48 hours
- Update DNS for remaining domains
- Full cutover complete
Phase 6: Verification & Monitoring (Ongoing)
1
Test Each Market
For each domain:
- ✅ Homepage loads with correct project
- ✅ Product pages show correct theme
- ✅ Navigation works properly
- ✅ Search functions correctly
- ✅ Cart and checkout work
- ✅ All images load
- ✅ Forms submit successfully
2
Monitor Performance
Track metrics:
- Page load times per project
- Error rates by project
- Cache hit rates
- User experience metrics
- Google Analytics (segment by domain/project)
- Performance monitoring (New Relic, Datadog)
- Error tracking (Sentry)
3
Document for Team
Create documentation:
- Which project serves which domain
- How to customize each project in Studio
- Routing logic explanation
- Troubleshooting guide
- Contact for questions
Migration Checklist
Use this checklist to track your migration progress:-
Planning Phase
- Current setup audited
- Projects defined and documented
- Routing strategy chosen
- Team briefed on migration plan
-
Studio Setup
- Base project identified
- Projects duplicated in Studio
- Project IDs documented
- Initial customization done
-
Code Implementation
- Environment variables updated
- WeaverseClient factory created
- Server entry point updated
- Development testing complete
-
Content Customization
- Theme settings updated per project
- Content translated/customized
- Market-specific pages created
- Content sync workflow established
-
Deployment
- DNS configured
- SSL certificates valid
- Staging deployment successful
- Production deployment complete
-
Verification
- All domains tested
- Performance monitored
- Team documentation created
- Success metrics tracked
Best Practices & Patterns
Project Organization
Naming Conventions:Content Synchronization
When to sync:- Base component updates
- Global section changes
- Navigation structure updates
- Theme variable additions
- Market-specific content
- Localized text
- Regional promotions
- Market-unique pages
- Make changes in base project
- Export affected sections/pages
- Import into other projects
- Customize as needed per market
Team Collaboration
Access Control:- Assign team members to specific projects
- Sweden team → Sweden project access
- France team → France project access
- Document which team owns which project
- Establish process for cross-project changes
- Regular sync meetings for global updates
- Track code changes with git
- Document Studio changes in changelog
- Coordinate code deploys with content updates
Cost Optimization
Cache Aggressively:- Cache per-project content at edge
- Vary cache by hostname
- Use stale-while-revalidate
- Share build artifacts between projects when possible
- Optimize images per project
- Monitor bundle sizes
Troubleshooting
Wrong Project Loading
Symptom: Domain shows incorrect project content Debug:- Environment variable not set
- Typo in domain mapping
- DNS not pointing to correct server
- Cache serving old content
- Verify environment variables with
console.log - Check domain in
projectMapmatches exactly - Clear CDN cache
- Test with cache-busting query param:
?t=123
Content Not Syncing
Symptom: Updates in one project don’t appear in others Expected Behavior: Projects are independent by design. Content doesn’t auto-sync. Solutions:- Use Import/Export in Studio to sync manually
- Update content in each project separately
- Consider if single-project with localization would be better
Performance Issues
Symptom: Slow page loads, high response times Debug:- No caching configured
- Too many API calls
- Large page data
- Network latency
- Implement caching strategy
- Use CDN for static assets
- Optimize images
- Consider edge caching
A/B Test Cookie Issues
Symptom: Users see different variants on each page load Debug:- Cookie not being set in response
- Cookie domain mismatch
- httpOnly/secure flags incorrect
- SameSite policy blocking cookie
- Verify
Set-Cookieheader in response - Check cookie domain matches request domain
- Adjust httpOnly/secure/sameSite settings
- Test in incognito to verify behavior
Route-Level Override Not Working
Symptom: PassingprojectId to loadPage() doesn’t override the default project
Debug:
projectIdvariable isundefined- Environment variable not set
- Typo in parameter name
- Using wrong parameter syntax
- Verify environment variable exists:
console.log(process.env.WEAVERSE_PROJECT_CAMPAIGN) - Ensure projectId is not undefined before passing
- Check spelling: it’s
projectIdnotproject_idorprojectID - Use optional chaining:
projectId: myProjectId || undefined
Advanced Topics
Dynamic Project Selection
Based on User Attributes:Hybrid Approaches
Combine Single and Multi-Project:Feature Flags
Gradual Feature Rollouts:API Reference
projectId Parameter
The projectId parameter can be configured at two levels with different types and behaviors:
Client-Level Configuration
Location:WeaverseClient constructor
Type: string | (() => string)
Description: Sets the default project for all routes. Function is evaluated once per request.
Route-Level Override
Location:weaverse.loadPage() method
Type: string | undefined
Description: Overrides the client-level project for a specific page load. Takes precedence over client configuration.
projectId > Client-level projectId > WEAVERSE_PROJECT_ID env var
Environment Variables
Required:WEAVERSE_PROJECT_ID- Default/fallback project ID
WEAVERSE_PROJECT_SWEDEN- Sweden market projectWEAVERSE_PROJECT_FRANCE- France market projectWEAVERSE_PROJECT_VARIANT_B- A/B test variantWEAVERSE_PROJECT_BRAND_A- Brand A project- etc.
Summary
Multi-Project Architecture is a powerful feature for:- ✅ Multi-market storefronts with different domains and branding
- ✅ A/B testing to optimize conversions
- ✅ Multi-brand experiences from one Shopify store
- Configure
projectIdat two levels: client-level for global routing, route-level for specific pages - Client-level: Use
projectIdfunction in WeaverseClient for domain/subdomain/cookie-based routing - Route-level: Pass
projectIdtoloadPage()for campaign pages, featured collections, or experiments - Duplicate projects in Studio for each market/variant/brand
- Test thoroughly before production deployment
- Monitor performance and user experience per project
- Localization Guide - Combine with locale features
- Custom Routing - Advanced URL patterns
- API Reference - Complete API documentation