Skip to content

Conversation

DevStarlight
Copy link
Contributor

This PR adds S3 support for collections, allowing them to be stored and served from AWS S3 (or S3-compatible services) instead of the local filesystem. This enhancement provides better scalability and distribution for collections, similar to how assets already work.

The implementation maintains full backward compatibility with existing local collections while adding the flexibility to use S3 storage.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes a component issue)
  • New component
  • Component enhancement
  • Breaking change (would cause existing worlds using this component to behave differently)
  • Documentation update

How Has This Been Tested?

Please describe your tests:

  • Component functionality tests
  • Integration tests with other Hyperfy components
  • World integration testing
  • Cross-browser testing

Test Configuration:

  • Hyperfy Version: Latest dev branch
  • Test world setup: Local development environment with both local and S3 collections
  • Browser(s): Chrome, Firefox
  • Node.js version: 18+

Checklist:

  • My code follows Hyperfy's component architecture
  • I have performed a self-review
  • I have documented the component's usage
  • I have tested the component in multiple scenarios
  • My changes maintain compatibility with existing worlds
  • I have updated the component documentation if needed

- Create CollectionsS3 class to load collections from S3
- Create CollectionsLocal class for local filesystem compatibility
- Add factory pattern to select between S3 and local collections
- Add environment variables COLLECTIONS and COLLECTIONS_S3_URI
- Update .env.example with new collection configuration options
- Maintain backward compatibility with existing local collections system

This allows collections to be stored and served from S3 similar to how
assets already work, providing better scalability and distribution.
- Add default port value (3000) when PORT env var is not set
- Remove PORT validation that was throwing error when not defined
- Improves server startup resilience following legacy code principles
@DevStarlight DevStarlight marked this pull request as ready for review September 23, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant