⏳ Chapters
- InertiaJS Adapters
- AdonisJS' Benefit
- About This Series
What Exactly is InertiaJS?
InertiaJS describes itself as a modern monolith. It’s not a framework but a middleman between the server and the client, enabling a seamless developer experience. This allows us to build client-side single-page applications (SPAs) as well as server-rendered apps in a way that leverages typical monolithic data flows without the need for an API. Instead, the server can directly pass data to the client-side application, just as it would with any server-side template engine like EdgeJS.
InertiaJS is framework-agnostic and supports various server and client-side frameworks. On the server side, this includes Laravel, AdonisJS, Rails, Go, Django, Flask, and more. Then, on the client side, Vue, React, Svelte, and Solid.
One of the primary advantages of AdonisJS over other backend frameworks is that it’s written in TypeScript and JavaScript, just like the frontend frameworks. This consistency allows us to share some types and even code between the backend and frontend.
What We'll Be Building
Throughout this series, we'll be building an application called PlotMyCourse. We’ll start with the basics of how InertiaJS works and how it binds the backend and frontend together. Then, we’ll focus on building out complete features using AdonisJS as our backend framework, InertiaJS as our middleman, and Vue on the frontend.
Join The Discussion! (2 Comments)
Please sign in or sign up for free to join in on the dicussion.
laithong-singhalat
Please Share me how to work with Transmit inertia vue.
Please sign in or sign up for free to reply
tomgobich
Hi laithong! I haven't yet worked with Trasmit, but I don't believe using Inertia should change its implementation any from what is covered in the docs.
The server-side installation would be the same as covered in the documentation; installing the packages, configuring your Redis connection, registering the routes, and defining the channels.
Then, you'd define the client initialization inside a file within your Inertia directory, somewhere like
~/inertia/lib/transmit.ts
, and import it where needed. I imagine the client will only work client-side in the browser. So, you may want to ensure whatever imports your transmit file is running only on the client and not using SSR. I'm not certain on that though.Please sign in or sign up for free to reply