WorldBuilder is a specialized platform that simplifies browser-based game development using Phaser.js(iteration 1) and AI assistance. Create, deploy, and share games with minimal coding knowledge through our streamlined multi-tenant architecture.
WorldBuilder allows anyone to:
- Describe your game idea in plain language
- Generate code and game design documents using AI
- Customize your game in an integrated development environment
- Deploy instantly to your personal subdomain (yourname.app.worldbuilder.space)
- Share your creation with others
- ✨ Key Features
- 🏗️ Architecture Overview
- 🚀 Getting Started
- 🛠️ Deployment Guide
- 🧩 Technical Details
- 🔒 Security Considerations
- 👥 Who Is This For?
- 📜 Roadmap
- 🤝 Contributing
- 📝 License
- AI Game Assistant: Describe your game idea in plain language - our AI creates the code
- Game Design Document Generation: Auto-generate detailed GDDs to guide your development
- Minimal Coding Required: Focus on game design while AI handles implementation details
- Real-time Preview: See your changes instantly as you develop
- Instant Deployment: One-click publishing to your own subdomain (yourname.app.worldbuilder.space)
- Zero Configuration: No need to set up servers or hosting infrastructure
- Reliable Infrastructure: Built on AWS CloudFront, Lambda@Edge, and S3
- Efficient Asset Handling: Upload game assets directly to your project
- All-in-One Interface: Code editor, design document, and preview in a single workspace
- Version Control: Track changes to your game over time
- Export Options: Download your game code or design documents
- Interactive Tutorials: Learn as you build with guided creation flows
WorldBuilder uses a multi-tenant architecture powered by AWS services:
graph TD;
Browser[🌐 User Browser] --> CF[🟠 AWS CloudFront]
CF --> |Viewer Request| ViewerLambda[λ Viewer Request Function]
ViewerLambda --> |Subdomain to Path| CF
CF --> |Origin Request| OriginLambda[λ Origin Router]
OriginLambda --> S3Tenant["📦 Tenant S3 Bucket (Static Websites)"]
CF --> DefaultOrigin["📁 Default S3 Origin"]
DynamoDB[🗄️ DynamoDB Subdomains] --> APIGW[🔹 API Gateway]
APIGW --> LambdaAPI[⚙️ Registration & Presigned URL API]
LambdaAPI --> DynamoDB
LambdaAPI --> S3Tenant
LambdaAPI --> CloudFrontInvalidate[🔄 CloudFront Invalidation]
- Node.js 16+ and npm
- AWS account (for deployment features)
- AWS CLI installed and configured (for deployment)
- Git
- Clone the repository
git clone https://github.com/your-org/worldbuilder.git
cd worldbuilder
- Install dependencies
npm install
- Set up environment variables
# Copy example environment file
cp dev.env .env.local
# Edit .env.local with your settings
# Required for AI features:
# - ANTHROPIC_API_KEY=your_api_key
# Required for deployment features:
# - AWS_ACCESS_KEY_ID=your_access_key
# - AWS_SECRET_ACCESS_KEY=your_secret_key
# - AWS_REGION=us-west-2
- Start the development server
npm run dev
-
Access the application Open http://localhost:3000 in your browser.
-
Creating your first game
- Click "New Project"
- Choose a Phaser.js template
- Describe your game idea in the AI assistant
- Customize the generated code
- Test in the preview panel
- AWS account with Administrator access
- AWS CLI installed and configured
- Domain registered (e.g.,
worldbuilder.space
) - Basic understanding of bash scripting
- Set up CloudFront Distribution
./deploy/prod/setup-cloudfront.sh
- Deploy Lambda@Edge Routing
./deploy/prod/setup-lambda-edge.sh
- Deploy Registration API
./deploy/prod/setup-register-api.sh
- Configure DNS (Route53)
Point domain/subdomains to CloudFront distribution:
Record type | Hostname | Points to |
---|---|---|
A or CNAME | app.worldbuilder.space |
CloudFront Domain |
CNAME | *.app.worldbuilder.space |
CloudFront Domain |
./deploy/prod/create-space.sh <subdomain> "<html_content>" [user_id]
# Example:
./deploy/prod/create-space.sh adventure '<h1>My Adventure</h1>' user42
./deploy/prod/update-content.sh <subdomain> <path> <file> [user_id]
# Example:
./deploy/prod/update-content.sh adventure index.html ./new-adventure.html user42
./deploy/prod/upload-files.sh <subdomain> <user_id> <file1> [file2] [file3] ...
# Example:
./deploy/prod/upload-files.sh adventure user42 index.html style.css game.js
worldbuilder/
├── deploy/ # Deployment scripts and AWS configuration
│ ├── lambda/ # Lambda function source code
│ └── prod/ # Production deployment scripts
├── src/
│ ├── app/ # Next.js app router components
│ ├── components/ # React components
│ │ ├── Assets/ # Asset management UI
│ │ ├── Chat/ # AI chat interface
│ │ ├── Editor/ # Code editor components
│ │ ├── GameDesign/ # Game design document UI
│ │ ├── Preview/ # Game preview components
│ │ └── ui/ # Reusable UI components
│ ├── contexts/ # React context providers
│ ├── data/ # Static data and templates
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Next.js page components and API routes
│ ├── styles/ # CSS modules and global styles
│ ├── templates/ # Game template files
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Utility functions
└── public/ # Static assets
- Framework: Next.js & React
- Editor: Monaco Editor (VS Code-like editor)
- Game Engine: Phaser.js (version 3.55+)
- AI Integration: Anthropic Claude API
- Styling: CSS Modules & Tailwind CSS
- AWS CloudFront: Content delivery and routing
- AWS Lambda@Edge: Dynamic routing based on subdomains
- AWS S3: Game hosting and asset storage
- AWS API Gateway: API endpoints for game management
- AWS DynamoDB: Subdomain and user data storage
- Implement AWS Cognito for user authentication
- Use AWS WAF to protect API endpoints
- Regularly review IAM roles and policies
- Enable AWS CloudTrail for audit logging
- Set presigned URL expiration to minimum required duration
- Beginner Game Developers: Create games without extensive programming knowledge
- Game Design Students: Learn game development concepts with immediate results
- Educators: Create interactive educational games for teaching
- Game Jam Participants: Rapidly prototype and publish game ideas
- Hobbyists: Bring your game ideas to life without technical barriers
- Single-player Phaser.js Games
- Beginner-Friendly Experience
- Streamlined Hosting
- Multiplayer Support
- Discord Integration
- Enhanced Templates
- Community Features
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin amazing-feature
- Open a Pull Request
Created with ❤️ for WorldBuilder