Layers

I use Nuxt Layers to structure my application. This allows me to create a modular architecture that is easy to maintain and extend.

Nuxt Layers is a powerful feature that allows you to create modular applications by composing different layers. Each layer can contain its own configuration, components, and modules, making it easy to share and reuse code across different projects.

What layers are included in this starter kit?

This starter kit contains the following layers in the /layers directory:

  • blog: All components and pages related to the blog functionality.
  • core: Contains some composables, components & server routes that are shared across all layers. Here some of the most important ones:
    • useAppToast: A composable for displaying toast notifications.
    • useConfirmationModal: A composable for displaying confirmation modals.
    • useLoadingModal: A composable for displaying loading modals.
    • useLogger: A composable to log messages on the client.
    • useServerLogger: A server method to log messages on the server.
  • docs: All components and pages related to the documentation functionality.
  • email: All components and server routes related to the email functionality.
  • testimonials: All components, pages and server routes related to the testimonials functionality.

Remove a layer

To remove a layer, simply delete the corresponding directory in the /layers directory. For example, to remove the blog layer, delete the /layers/blog directory.

Additionally, search for blog in all files and remove the corresponding code.