Giter Club home page Giter Club logo

crafthead's Introduction

Crafthead

Crafthead is a highly scalable, serverless Minecraft avatar rendering solution built on Cloudflare Workers. It runs on any of Cloudflare's 200+ datacenters worldwide with minimal latency.

Note: if you're a causal browser and wound up here, you probably want to go to Crafthead.net, the public instance of Crafthead I run.

Features

  • Extremely fast:
    • Avatar generation at 300px in ~50ms (compare to 68ms for Minotar and 65ms for Crafatar)
    • Avatar generation at 64px in ~23ms (compare to 54ms for Minotar and 57ms for Crafatar)
    • Most of the benefit can be given to the fact Craftheads runs near the user
    • Note: the skin the avatar was generated from was always in cache
  • Supports UUID fetching (dashed or not dashed) and username lookups
  • Renders avatars from 8px to 300px

Rolling your own

Step 1: Don't.

Use the public instance I've made available. You don't have to pay a single dime for it. I pick up all the costs.

If, on the other hand, you're looking to hack on Crafthead, then keep reading.

Step 2: You want to do it?

This project uses wrangler, so make sure you have that installed. It is also strongly recommnded you purchase a Cloudflare Workers Unlimited plan, otherwise it is possible you could run into CPU limit problems at larger resolutions.

You'll also want the Rust toolchain and wasm-pack too. Also, you'll need Node.js as well.

Then:

  • Copy wrangler.toml.dev to wrangler.toml and fill in your own account_id
  • Use yarn install to install all the development dependencies
  • Use wrangler publish. You're done!

Notes on wrangler preview

Due to Mojang API rate limits, it is not possible to use wrangler preview to test Crafthead. You are better off deploying to workers.dev instead. In the future, a "fake" mode may be introduced where only one head can be scaled as needed.

crafthead's People

Contributors

astei avatar penple avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.