Frontend microservices framework for scalable and blazing fast websites.
PuzzleJs makes it easy to create gateways and storefront projects that talk each other. It is inspired by Facebook's BigPipe, developed with lots of great features and passion.
The traditional model is very inefficient for modern websites.
- Multiple teams working on the same code makes everything harder to manage.
- Time to first byte is as fast as the slowest api.
- When backend is collecting data user browser is wasting time waiting for first byte.
- Features can't be online as soon as it is fully developed and tested because of other teams features are not ready yet.
- You can't use different technologies expect from the existing one.
- You can't scale specific process because you are dependent to whole system.
- First Time To Byte PuzzleJs compiles html template into javascript function on compile time. This operation is fully independent from the request so PuzzleJs can send the first chunk using this function.
- Seo Friendly PuzzleJs is fully SEO friendly as everything is being prepared and rendered on server side.
- Extensibility It is easy to extend PuzzleJs with your custom functions.
- Easy You can easily create a gateway or storefront and connect them by providing a configuration file.
- Independent You can use any technology on your gateways, PuzzleJs is fully independent from your technologies. ReactJs, Vue or anything else.
- Scalable PuzzleJs can create storefront and gateways independent from each other. So you can easily scale single project on Dockerized environments.
- Fail-Safe When your api required by a fragment is down, PuzzleJs guarantees other page fragments are still working.
Checkout quick start guide for fastest implementation.
- Create one or more gateway projects.
- Create fragments and api on gateway projects.
- Create a storefront project and connect gateways with a config file.
- Create pages on storefront project and provide html files with desired fragments.
Please check the guide for full documentation.
Compile time
- Gateways start exposing their fragments, api and gateway information.
- Storefront fetches registered gateways' information.
- Storefront downloads and caches required fragments, dependencies and assets.
- Storefront compiles html into in memory javascript function for fastest template rendering.
On Request
- Storefront sends a chunked response with the compiled function but not closes the connection. Users are now able to see your website with static contents and placeholders. It also sends backend requests to gateways to recieve rendered fragments.
- When any fragment recieved from gateway it sends it to browser as a chunk and replaces previously sended placeholder with the content.
- When all fragments are sent, PuzzleJs closes connection.
Read the guide to familiarize yourself with how PuzzleJs works.
Feel free to contribute to PuzzleJs, please read Contributions for detailed information.