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.
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- 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
- 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
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- 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
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- src
- Combat
- CombatService@Server.luau
- CombatTypes.luau
- Inventory
- InventoryService@Server.luau
- ItemCatalog.luau
- src
- combat
- combat-service@server.ts
- combat-types.ts
- inventory
- inventory-service@server.ts
- item-catalog.ts
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- src
- common
- Shop
- ItemCatalog.luau
- ShopService@Server.luau
- game
- Shop
- ItemCatalog.luau
- lobby
- game.rogen.json
- lobby.rogen.json
- 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
Still Rojo
Run rogen serve where you ran rojo serve, with the same flags. Rojo still does the syncing and building underneath.
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 *.
- 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.
- 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.
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