Fireship · @fireship
Nuxt in 100 Seconds
Uploaded June 13, 2023 · Length 2:50
Summary
nuxt.js framework for building web applications with vue.js, including routing, data fetching, caching, and deployment.
- nuxt.js
- vue.js
- full-stack
- web development
- javascript
- framework
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
next A batteries included framework for
- 0:02
building any type of web application you
- 0:04
can imagine with vue.js the purpose of
- 0:07
VJs is to build front-end user
- 0:08
interfaces with JavaScript but a true
- 0:10
full stack web application also needs to
- 0:12
deal with routing data fetching caching
- 0:14
deployment and more that's where nux
- 0:16
comes in it works by strapping its Nitro
- 0:19
server engine to view enabling multiple
- 0:21
rendering modes from a single
- 0:22
application by default it does Universal
- 0:24
rendering where the initial page view is
- 0:26
rendered on the server then JavaScript
- 0:28
takes over to handle all subsequent
- 0:30
navigation client-side however if that's
- 0:31
not ideal developers can set different
- 0:33
rendering and caching rules for every
- 0:35
route and it's capable of running on
- 0:37
edge networks like cloudflare its
- 0:39
built-in Dev tools are incredible and
- 0:40
may trigger jealousy if you use a
- 0:42
different framework beyond that it has a
- 0:44
huge ecosystem of modules that can
- 0:46
handle requirements like image
- 0:47
optimization content management database
- 0:49
Integrations e-commerce and countless
- 0:51
others to get started generate a new
- 0:53
project with the CLI then you'll find
- 0:55
the main entry point in the app.view
- 0:57
file and notice how it's configured with
- 0:59
typescript out of the box to an ensure
- 1:00
your own safety to build an application
- 1:02
you write view components in the Pages
- 1:04
directory the structure of the file
- 1:06
system determines the routes and URLs in
- 1:08
the browser what's unique about nux
- 1:09
though is that reusable components and
- 1:11
composables have their own dedicated
- 1:13
directories any code defined here can be
- 1:15
automatically imported in your pages and
- 1:17
that means you don't need a massive list
- 1:18
of import statements in every single
- 1:20
page and under the hood it will
- 1:22
automatically handle code splitting so
- 1:23
only the JavaScript needed for the
- 1:25
components in this file will be sent
- 1:26
Downstream to the browser next up we
- 1:28
have the layouts directory here we
- 1:30
Define view components that have a slot
- 1:32
in the middle allowing the outer UI like
- 1:34
a nav bar and footer to be shared across
- 1:36
multiple Pages now if you're building a
- 1:37
Blog you'll really like the content
- 1:39
directory because here you can write
- 1:40
content and markdown and use it
- 1:42
throughout the application with minimal
- 1:43
friction then we have the middleware
- 1:45
directory which is capable of running
- 1:46
code before you navigate to a route like
- 1:48
for collecting analytics or checking the
- 1:50
user authentication state next has many
- 1:52
other special directories to offer but
- 1:54
everything in the framework is
- 1:55
progressively enhanced which means you
- 1:57
can opt into these features as needed
- 1:58
now when it comes to data fetching it


