Project directory layout
The layout below extends the first game mode with optional UI, branding, and custom assets. It keeps the JavaScript example’s file names. Your project folders can use other names through the server configuration.
Example layout
Section titled “Example layout”server/ revo-server.exe lib/ config.toml resources/ first-mod/ package.json package-lock.json node_modules/ server/ index.js modules/ ui-src/ client/ scripts/ client.js modules/ ui/ index.html assets/ branding/ icon.ico loading/ index.html assets/ .resources/ .api/ logs/| Location | Contents |
|---|---|
server/ inside the mod |
Server scripts and modules. |
client/scripts/ |
Client scripts and their imported modules. |
ui-src/ |
UI source files and build configuration when using a frontend build tool. |
client/ui/ |
HTML, CSS, JavaScript, and assets served to WebViews. A frontend build can write its output here. |
client/branding/ |
Optional loading screen and window icon. |
client/assets/ |
Custom game assets, with the directory structure and metadata required by their formats. |
node_modules/ |
Installed JavaScript development tools, typings, and server dependencies. |
For a plain HTML interface, edit the files in client/ui/ directly. The ui-src/
folder is only needed when you keep separate sources for a UI build.
How the paths connect
Section titled “How the paths connect”The example uses these settings in config.toml:
scripting.js.entrypoints toresources/first-mod/server/index.js.resources.pack.pathpoints toresources/first-mod/client, the folder to package.resources.pathpoints to.resources, where the generated package is stored.
These relative paths are resolved from the server’s working directory. Keep the package output separate from the folder being packaged.
The server runs its configured entry script. Client JavaScript starts at
scripts/client.js relative to resources.pack.path. Import additional modules
from those entries. Keep imported client modules within scripts/. For npm
dependencies and a client build example, see
Imports and npm dependencies.
The UI folder name is your choice. A file at client/ui/index.html is available
to WebViews at resources://ui/index.html. This URL uses the
prepared client bundle. The folder name on the server, such as first-mod, is
not part of that URL.
Branding uses specific paths relative to the same client root:
branding/loading/index.html for the loading screen and branding/icon.ico for
the game window icon.
What players download
Section titled “What players download”The packer scans resources.pack.path recursively. In this layout, client
scripts, UI files, branding, and custom assets are included. Server scripts and
dependencies remain outside that folder.
If you use TypeScript, a bundler, or a UI framework, build the client-facing output before starting the server. Package the resulting JavaScript and assets. Keep build tooling and dependency installations outside the client folder.
Shared source code can live elsewhere in your project. Include the parts needed
by the client in its build output or under client/scripts/ so its imports can
resolve inside the downloaded bundle.
Generated and persistent data
Section titled “Generated and persistent data”.resources/ contains the generated package, manifest, and packing cache. Make
changes in the source folder and let the server prepare the package on startup.
Generated package files are managed by the packer. To prepare a package before
deployment, see Package and publish client resources.
.api/ holds server identity records when using the paths from the development
setup. Preserve these records across restarts and deployments. Each server
instance needs its own identity files.
Keep logs, database files, and other runtime data outside the client resource folder. Database locations and persistence are configured by your mod.
The helper’s resource storage is a separate client-side location, described in Run locally. Files there are managed by the helper and client. Edit your project’s resource sources to publish changes.