A comprehensive Roblox project template with modern tooling, flexible testing, and CI/CD support. Features Rojo, Darklua, Jest-Lua, and Roblox Open Cloud integration.
- Modern Development Stack: Rojo, Darklua, Wally, and Rokit for comprehensive tooling
- React Integration: Built-in React and ReactRoblox for modern UI development
- Flexible Testing: Jest-Lua with multiple execution modes (local, cloud, and live development)
- Cloud Testing: Roblox Open Cloud API integration for CI/CD-friendly testing without local dependencies
- Code Quality: Stylua formatting, Selene linting, and type checking
- Git Workflow: Pre-configured aliases and scripts for streamlined development
- Cross-Platform Scripts: Lune-powered development scripts that work on Windows, macOS, and Linux
- Rokit - Install via instructions here or releases
- Roblox Studio - For testing and publishing
-
Clone and setup:
git clone https://github.com/J0Nreynolds/roblox-project-template.git cd roblox-project-template rokit install # Install development tools lune run install # Install packages and setup project
-
Configure project (optional):
# Copy configuration template and fill in your values cp project.config.template.toml project.config.toml # Edit project.config.toml to set PROJECT_NAME and other options
-
Start developing:
lune run dev # Start development serverThen connect Roblox Studio to the Rojo server.
lune run analyze # Run type checking and analysis
lune run build # Build production place file
lune run dev # Start development server with file watching
lune run install # Install tools and packages
lune run test # Build and run tests
lune run test-dev # Start test development server
lune run test-wsl # Run tests via PowerShell (WSL users - enables run-in-roblox)
lune run test-cloud # Run tests via Roblox Open Cloud (requires API setup)See CLOUD_TESTING.md for cloud testing setup instructions
Note: All development scripts are powered by Lune, providing consistent cross-platform behavior without bash dependencies.
WSL Users: For
run-in-robloxsupport, uselune run test-wslwhich runs tests via PowerShell.
The template uses a project.config.toml file for project settings. Copy the template to get started:
cp project.config.template.toml project.config.tomlConfiguration options include:
[project]
name = "RobloxProjectTemplate" # Used for generated place files
[test]
verbose = true # Test output verbosity (JEST_VERBOSE -> __VERBOSE__)
ci = false # CI mode for tests (JEST_CI -> __CI__)
[cloud]
test_place_id = "" # Optional: Cloud testing place ID
test_universe_id = "" # Optional: Cloud testing universe ID
# api_key = "" # Optional: API key for cloud testingImportant:
project.config.tomlis gitignored - the template file is tracked- Never commit API keys to version control
- For CI/CD, you can use GitHub repository variables/secrets instead of the config file
Test Configuration: The test settings are injected as globals during the darklua build process and control test runner behavior.
This affects:
- Production builds:
YourProjectName.rbxl - Test builds:
YourProjectName_Test.rbxl - Cloud testing: Uses the specified place/universe IDs and API key (see CLOUD_TESTING.md for setup)
- Test behavior: Controls verbosity and CI mode through injected globals
Tip: You may also want to update the Rojo project names in build.project.json and build.test.project.json to match your project name.
src/
βββ Client/ # Client-side code (Controllers, UI, etc.)
βββ Server/ # Server-side code (Services, etc.)
βββ Common/ # Shared code between Client and Server
βββ __tests__/ # Test files (*.spec.luau)
assets/ # Static assets (Rbxm files, images, etc.) β empty by default
The Rojo project files (build.project.json, default.project.json) do not include Workspace, Lighting, or Assets mappings by default. These are optional and require prior setup:
Workspace/Lighting: Export these from an existing Roblox place as.rbxmfiles into amap/folder, then add to the project files:"Workspace": { "$path": "map/Workspace.rbxm" }, "Lighting": { "$path": "map/Lighting.rbxm" }
Assets: Place.rbxmor other asset files inassets/, then add toReplicatedStoragein the project files:The"Assets": { "$path": "assets" }
assets/folder is tracked in git (via.gitkeep) so it exists on a fresh clone, but you'll need to populate it with your own assets.
- Code:
- Edit files in
src/ - Use
lune run devfor live development server
- Edit files in
- Test:
- Write tests in
src/__tests__/ - Use
lune run testto build and run tests
- Write tests in
- Build:
- Use
lune run buildto create production place file
- Use
The development uses darklua with file watching to transform code with proper path aliases (@Common, @Client, @Server) before syncing to Studio. The build pipeline ensures development matches production.
lune run test # Build and run all tests
lune run test-dev # Live test development with file watching (preferred if you have issues with `run-in-roblox`)
lune run test-cloud # Run tests via Roblox Open Cloud (see CLOUD_TESTING.md for setup)- Use live test development server:
lune run test-dev - Open
RobloxProjectTemplate_Test.rbxlin Studio - Run:
loadstring(game:GetService("ServerScriptService").TestRunner.Source)()
Place tests in src/__tests__/ with *.spec.luau naming:
local JestGlobals = require("@DevPackages/JestGlobals")
local describe, it, expect = JestGlobals.describe, JestGlobals.it, JestGlobals.expect
local myModule = require("@Project/Common/MyModule")
describe("MyModule", function()
it("should do something", function()
expect(myModule.doSomething()).toBe(true)
end)
end)Note: Tests use @Project alias to access all code since the test environment places everything under ReplicatedStorage.Project.
The test runner uses global injection to configure behavior at build time. Environment variables from project.env are injected as globals during the darklua processing:
JEST_VERBOSEβ__VERBOSE__global: Controls test output verbosityJEST_CIβ__CI__global: Enables CI mode for cleaner outputTEST_IN_STUDIOβ__STUDIO__global: Detects Studio environment for color handling
This happens in .darklua.test.json using the inject_global_value rule, allowing compile-time configuration without runtime overhead.
For Jest matchers and patterns, see Jest-Lua documentation.
- run-in-roblox: Windows/macOS only (WSL users should use
lune run test-wsl) - File watching: WSL users must use PowerShell or CMD, or host project on Linux filesystem
If lune run test or lune run test-wsl fails with execution errors, restart Windows Host Network Service in admin PowerShell:
net stop hns
net start hns- Fork the repository
- Create a feature branch
- Add your changes
- Ensure all CI checks pass
- Submit a pull request