A Rojo superset

Each feature in one folder

Rogen generates the Rojo project file from your file system. Keep a feature's server and client code together, and Rogen sends each file to the right place in Studio.

$rokit add ldgerrits/rogen@2.0.0-rc.1
my-game
EXPLORER
MY-GAME
  • Packages
  • src
  • Inventory
  • UI
  • InventoryHud.luau
  • ItemSlot.luau
  • InventoryController@Client.luau
  • InventoryInput@Client.luau
  • InventoryService@Server.luau
  • InventoryStore@Server.luau
  • InventoryTypes.luau
  • ItemCatalog.luau
  • ItemIcons.rbxm
  • default.rogen.json
  • rokit.toml
  • wally.toml
  • node_modules
  • src
  • inventory
  • ui
  • inventory-hud.tsx
  • item-slot.tsx
  • inventory-controller@client.ts
  • inventory-input@client.ts
  • inventory-service@server.ts
  • inventory-store@server.ts
  • inventory-types.ts
  • item-catalog.ts
  • item-icons.ts
  • default.rogen.json
  • package.json
  • tsconfig.json
my-game % rogen serverogen serve · default.rogen.jsonServing my-game at localhost:34872 · http://localhost:34872/ In Studio, press Connect in the Rojo plugin.Studio connected to my-game.
Explorer
  • Workspace
  • Players
  • Lighting
  • ReplicatedStorage
  • Packages
  • Shared
  • Inventory
  • InventoryTypes
  • ItemCatalog
  • ItemIcons
  • UI
  • InventoryHud
  • ItemSlot
  • ServerScriptService
  • Inventory
  • InventoryService
  • InventoryStore
  • StarterPlayer
  • StarterPlayerScripts
  • Inventory
  • InventoryController
  • InventoryInput
  • Workspace
  • Players
  • Lighting
  • ReplicatedStorage
  • rbxts_include
  • shared
  • inventory
  • inventory-types
  • item-catalog
  • item-icons
  • ui
  • inventory-hud
  • item-slot
  • ServerScriptService
  • inventory
  • inventory-service
  • inventory-store
  • StarterPlayer
  • StarterPlayerScripts
  • inventory
  • inventory-controller
  • inventory-input

One folder per feature from server to client

01

Organize by feature

Keep everything a feature needs in one folder, from its server code to its UI and assets. You find it all in one place, and you remove a feature by deleting its folder.

See suggested architectures
my-game
MY-GAME
  • srcsrc
  • Combatcombat
  • Inventoryinventory
  • UIui
  • InventoryHud.luauinventory-hud.tsx
  • ItemSlot.luauitem-slot.tsx
  • InventoryController@Client.luauinventory-controller@client.ts
  • InventoryService@Server.luauinventory-service@server.ts
  • InventoryTypes.luauinventory-types.ts
  • ItemIcons.rbxmitem-icons.ts
  • Shopshop
02

Enforce boundaries

Every require path includes the name of its feature, so a lint rule can stop one feature from reaching into another.

See the lint rule
my-game
MY-GAME
  • src
  • Combat
  • CombatService@Server.luau
  • CombatTypes.luau
  • Inventory
  • InventoryService@Server.luau
  • ItemCatalog.luau
my-game % lute lint --no-default-lints srcerror[require_boundaries]: feature Combat requires feature Inventory: ReplicatedStorage.Shared.Inventory.ItemCatalog ┌── /Users/me/my-game/src/Combat/CombatService@Server.luau:4:21-76 ── │ 4 │ local ItemCatalog = require(ReplicatedStorage.Shared.Inventory.ItemCatalog) │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
my-game
MY-GAME
  • src
  • combat
  • combat-service@server.ts
  • combat-types.ts
  • inventory
  • inventory-service@server.ts
  • item-catalog.ts
my-game % npx eslint src/Users/me/my-game/src/combat/combat-service@server.ts 1:25 error Unexpected path "../inventory/item-catalog" imported in restricted zone import/no-restricted-paths ✖ 1 problem (1 error, 0 warnings)
03

Multi-place games

Write shared code once and use it in every place. When one place needs its own version of a file, put a file with the same name in that place's folder, and it replaces the shared one.

Set up places
my-game
MY-GAME
  • src
  • common
  • Shop
  • ItemCatalog.luau
  • ShopService@Server.luau
  • game
  • Shop
  • ItemCatalog.luau
  • lobby
  • game.rogen.json
  • lobby.rogen.json
my-game % rogen where gamesrc/common/Shop/ItemCatalog.luau -> replaced by src/game/Shop/ItemCatalog.luausrc/common/Shop/ShopService@Server.luau -> ServerScriptService/Shop/ShopService · route Server (suffix)src/game/Shop/ItemCatalog.luau -> ReplicatedStorage/Shared/Shop/ItemCatalog · route * (fallback)
my-game
MY-GAME
  • projects
  • common
  • src/shop
  • item-catalog.ts
  • shop-service@server.ts
  • tsconfig.json
  • game
  • src/shop
  • item-catalog.ts
  • default.rogen.json
  • tsconfig.json
  • lobby
  • package.json
my-game % rogen where projects/game/default.rogen.jsonprojects/common/src/shop/item-catalog.ts -> replaced by projects/game/src/shop/item-catalog.tsprojects/common/src/shop/shop-service@server.ts -> ServerScriptService/shop/shop-service · route server (suffix)projects/game/src/shop/item-catalog.ts -> ReplicatedStorage/shared/shop/item-catalog · route * (fallback)
04

Still Rojo

Run rogen serve where you ran rojo serve, with the same flags. Rojo still does the syncing and building underneath.

Coming from Rojo

How routing works

You choose the routes and where each one points. Add @Server@server to a file's name or put it in a Serverserver folder, and it goes to ServerScriptService. Files without a route go to *.

    The name InventoryService@Server.luau is read from src/Inventory, matched to the Server route in default.rogen.json, and written into default.project.json as InventoryService inside an Inventory folder. Rojo syncs it into Roblox Studio as ServerScriptService/Inventory/InventoryService, with an Inventory folder under each of the three services.

      my-game
      MY-GAME
      • src
      • Inventory
      • UI
      • InventoryHud.luau
      • ItemSlot.luau
      • InventoryController@Client.luau
      • InventoryInput@Client.luau
      • InventoryService@Server.luau
      • InventoryStore@Server.luau
      • InventoryTypes.luau
      • ItemCatalog.luau
      • ItemIcons.rbxm

      Mark only the files that belong on one side. Everything else goes to ReplicatedStorage through the * route.

      Explorer
      • ReplicatedStorage
      • Shared
      • Inventory
      • InventoryTypes
      • ItemCatalog
      • ItemIcons
      • UI
      • InventoryHud
      • ItemSlot
      • ServerScriptService
      • Inventory
      • InventoryService
      • InventoryStore
      • StarterPlayer
      • StarterPlayerScripts
      • Inventory
      • InventoryController
      • InventoryInput

      The result in Studio is the same for both.

      Built for agents

      Coding agents find their way around a feature as easily as you do.

      One feature, one folder

      When an agent works on a feature, everything it needs is in one folder, from server to client. It spends its context on your task instead of searching the codebase.

      Several agents at once

      Give each agent a feature. A lint rule catches any agent that makes one feature require another, and they never fight over a shared project file.

      Working with agents

      Used by Roblox studios

      “It has been a game changer for my team and I”

      Acecateer
      Technical Director, Wonder Works Studio

      “Spent the last couple days refactoring Lua Learning to use Rogen. I love it”

      Zack (boatbomber) Williams
      CEO, Torpedo Software
      $rokit add ldgerrits/rogen@2.0.0-rc.1