Skip to content

Project structure

Learn how to structure your Zuby.js app and what is the purpose of each file and directory of your new Zuby.js app. The names of directories and files are case-sensitive and must be named exactly as described below or in the Configuration section.

Directories and files

Some directories and files are required and have special meaning for Zuby.js:

  • ./ - The root directory of your Zuby.js app.
  • ./pages - The directory with the file-based routing (see Routing system).
  • ./public - The directory with static files that will be copied to the output directory.
  • ./zuby.config.mjs - The config file for your Zuby.js app. (zuby.config.ts for typescript projects)
  • ./tsconfig.json - The typescript config file for your Zuby.js app (only for typescript projects).
  • ./package.json - The project manifest file for your Zuby.js app with all dependencies and scripts.
  • ./package-lock.json - The package lock file for your Zuby.js app. This file is generated by NPM and should not be modified manually.
  • ./node_modules - The directory with all dependencies of your Zuby.js app. This directory is generated by NPM and should not be modified manually.

Build output structure

The build output structure is separated into two directories:

  • ./build/client - The directory with the client-side build output. This directory should be copied to static hosting.
  • ./build/server - The directory with the server-side build output. This directory should never be copied to static hosting or any public CDN as it may contain sensitive data.
  • ./build/server.mjs - The Zuby.js server file that allows to run the server and client builds.
  • ./build/node_modules - The traced dependencies for the server-side build.
  • ./build/package.json - The build manifest file for your Zuby.js app.