All Projects → sandulat → laratron

sandulat / laratron

Licence: MIT license
🖼Laravel SSR using Rendertron 🖼

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laratron

Nano
🎯 SSR first, lightweight 1kB JSX library.
Stars: ✭ 238 (+750%)
Mutual labels:  ssr
core
🚀Fast, 💎Lightweight Angular alternative with the same modern API thats compile directly to WebComponents
Stars: ✭ 49 (+75%)
Mutual labels:  ssr
zero
Zero is a web server to simplify web development.
Stars: ✭ 5,835 (+20739.29%)
Mutual labels:  ssr
Next Boost
Add a cache layer for server-side-rendered pages with stale-while-revalidate. Can be considered as an implementation of next.js's Incremental Static Regeneration which works with getServerSideProps.
Stars: ✭ 239 (+753.57%)
Mutual labels:  ssr
ng-universal
Angular Universal & SEO Utilities/Helpers - Brought to you by Trilon
Stars: ✭ 39 (+39.29%)
Mutual labels:  ssr
react-redux-immutable-webpack-ssr-starter
React + React-Router 4 + Redux + ImmutableJS + Bootstrap + webpack 3 with with Server side rendering, Hot Reload and redux-devtools STARTER
Stars: ✭ 21 (-25%)
Mutual labels:  ssr
Nuxt Wordpress Pwa
Wordpress + Vue + Nuxt.js
Stars: ✭ 251 (+796.43%)
Mutual labels:  ssr
laravel-nuxt
Laravel 5.6 + Nuxt 1.4: Auth Starter (SSR, SPA, Socialite)
Stars: ✭ 19 (-32.14%)
Mutual labels:  ssr
personal-website
Personal website – made with Next.js, Preact, MDX, RMWC, & Vercel
Stars: ✭ 16 (-42.86%)
Mutual labels:  ssr
async-react-router
Client side react router with async. It like next.js!
Stars: ✭ 21 (-25%)
Mutual labels:  ssr
Next Go
Production ready blog + boilerplate for Next.js 3.X
Stars: ✭ 254 (+807.14%)
Mutual labels:  ssr
Feliz.ViewEngine
Feliz DSL and engine for HTML generation and server side rendering (SSR)
Stars: ✭ 53 (+89.29%)
Mutual labels:  ssr
react-auth-kit
universal react app with flux, altjs, passportjs and server side rendering
Stars: ✭ 21 (-25%)
Mutual labels:  ssr
Css In Js 101
💈 CSS-in-JS 101: All you need to know
Stars: ✭ 252 (+800%)
Mutual labels:  ssr
angular-ssr
Angular 14 Example SSR (Server side rendering)
Stars: ✭ 92 (+228.57%)
Mutual labels:  ssr
Beidou
🌌 Isomorphic framework for server-rendered React apps
Stars: ✭ 2,726 (+9635.71%)
Mutual labels:  ssr
angular-universal-firebase
angular-universal-firebase.firebaseapp.com/
Stars: ✭ 30 (+7.14%)
Mutual labels:  ssr
daymanage
基于umi3+ts开发的日程管理系统,包括前后端, 前端umi3+ts+dva+ssr, 后端koa。打通微信,手机日历,浏览器提醒。后端见daymanage-server。
Stars: ✭ 28 (+0%)
Mutual labels:  ssr
vue-mapfit
A SSR compatible vue component which provides a Maps View with Mapfit
Stars: ✭ 12 (-57.14%)
Mutual labels:  ssr
ultimate-backend-dashboard
ultimate react ssr starter kit is a boilerplate strapped with Apollo graphql support and alot of goodies based on FusionJS
Stars: ✭ 19 (-32.14%)
Mutual labels:  ssr

Laratron

🖼Laravel SSR using Rendertron 🖼

About

Since we know that not all crawlers can render Javascript, we have to implement SSR (Server-Side Rendering). Implementing SSR in Laravel may be a headache and the easiest solution could be Rendertron.

Laratron is a tiny middleware for your Laravel app that detects whether the visitor is a crawler and passes the request to Rendertron.

About Rendertron (from official Readme):

Rendertron is designed to enable your Progressive Web App (PWA) to serve the correct content to any bot that doesn't render or execute JavaScript. Rendertron runs as a standalone HTTP server. Rendertron renders requested pages using Headless Chrome, auto-detecting when your PWA has completed loading and serializes the response back to the original request. To use Rendertron, your application configures middleware to determine whether to proxy a request to Rendertron. Rendertron is compatible with all client side technologies, including web components.

Installation

First of all we need to install Rendertron. Please consult the official documentation for more info. To install Laratron run this inside your project:

composer require sandulat/laratron

Configuration

Laratron exposes only one simple option, the URL of Rendertron, which can be set in your env file:

RENDERTRON_URL=http://localhost:3000

Usage

After installation you can use the middleware laratron on any route that you'd like to be server-side rendered.

Route::get('/', function () {
    return view('home');
})->middleware('laratron');

Or you can apply it on the entire web middleware group in App\Http\Kernel:

'web' => [
    // ...
    \Sandulat\Laratron\Http\Middleware\LaratronMiddleware::class,
],

Credits

Created by Stratulat Alexandru.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].