Laravel for Javascript exists - It’s far better than you think - AdonisJS Tutorial

preview_player
Показать описание
In this video, we dive deep into the world of full-stack JavaScript development using AdonisJS, a powerful framework inspired by Laravel. Building full-stack applications in JavaScript can often feel like piecing together a complex puzzle with numerous libraries and syntaxes. However, AdonisJS simplifies this process, allowing you to create robust applications with ease. We'll walk you through building a simple site, complete with user authentication features like sign-up, login, and logout. You'll learn how to set up a user model, manage routes, and render pages using Inertia and React. We'll also cover how to maintain a clean and organized codebase by utilizing controllers and middleware. By the end of this tutorial, you'll have a solid understanding of how to build and manage full-stack JavaScript applications efficiently. For more details, check out the blog post linked below.

Timestamps:
0:00 - Introduction
01:30 - Starting an AdonisJS project
01:53 - Making the User Table
02:53 - Exploring how IntertiaJS works with AdonisJS
03:45 - Changing the home page
05:12 - Add public page routes
06:00 - Building the signup page
07:23 - Adding signup API route
08:51 - Adding the signup method on AuthController
10:26 - building the dashboard page
12:39 - Adding global state for inertia pages
14:00 - Handling logout workflow
15:16 - Adding login page
16:32 - Handling the login on AuthController
17:48 - Final results
18:00 - Outro

Tools I use:
- Helix Editor
- Zellij terminal mux
- Kitty terminal
- Catpuccin Mocha everywhere
- Mac mini M2
======================================

Рекомендации по теме
Комментарии
Автор

Follow along with much more details on the blog post:

MightyMoud
Автор

I tried to do navigation from the react component but was not successful. So for example login returns a JSON, and then I want to navigate from the client.

nDenTzMotionZztrujillo
Автор

Why would you prefix "api" on the routes for the endpoints that handle the form submissions? The whole point of Inertia.js is you don't need to build an API (on the homepage of the inertia.js site).

What demonstrates the approach you have taken is odd is the fact that your "API" endpoints are redirecting the clients. This is not normal in my opinion. If you did have an API the communication would be done via JSON and the redirection would be handled client side.

Nevertheless, appreciate someone putting the spotlight on AdonisJS and InertiaJS, definitely underrated. Also, nice to see you after your hiatus, I remember watching your tutorials back in the day on React and Chakra UI.

ttncmok