Brisa Project Structure

This page provides an overview of the file and folder structure of a Brisa project.

src-level folders

pages Pages Router
api Api Router
public Static assets to be served
middleware Middleware
layout Layout / Layouts
websocket Websocket
i18n Internationalization routing & translations
web-components Client components
sitemap Specify a Sitemap in an easy way

Top-level files

brisa.config.js Configuration file for Brisa.

Special Files in src/pages

_404 .js .jsx .tsx 404 Error Page
_500 .js .jsx .tsx 500 Error Page

Routes

Folder convention
index .js .jsx .tsx Home page
folder/index .js .jsx .tsx Nested page
File convention
index .js .jsx .tsx Home page
file .js .jsx .tsx Nested page

Dynamic Routes

Folder convention
[folder]/index .js .jsx .tsx Dynamic route segment
[...folder]/index .js .jsx .tsx Catch-all route segment
[[...folder]]/index .js .jsx .tsx Optional catch-all route segment
File convention
[file] .js .jsx .tsx Dynamic route segment
[...file] .js .jsx .tsx Catch-all route segment
[[...file]] .js .jsx .tsx Optional catch-all route segment