TypeScript guides
Hello World tutorial
Project overview
5 min
now that you have successfully set up your hello world project in ir engine, let’s review its structure before diving deeper this guide provides a high level overview of the project’s code, so you can understand how the engine processes your project 💡 quick overview this is a brief introduction you don’t need to understand everything now—the upcoming guides will explain each concept in detail understanding the project structure your hello world project contains the following key components project configuration file ( xrengine config ts ) – connects the project to the engine hello world script ( src/hello ts ) – defines the entity and components scenes and assets – stores all scene data reviewing the hello world script the core logic of your project is located in src/hello ts this file initializes an entity with basic components src/hello ts import { ecs } from '@ir engine/packages/ecs' import { namecomponent } from '@ir engine/packages/spatial/src/common/namecomponent' import { visiblecomponent } from '@ir engine/packages/spatial/src/renderer/components/visiblecomponent' import { transformcomponent } from '@ir engine/packages/spatial/src/transform/components/transformcomponent' import { primitivegeometrycomponent } from '@ir engine/packages/engine/src/scene/components/primitivegeometrycomponent' import { vector3 } from 'three' const entity = ecs createentity() ecs setcomponent(entity, namecomponent, 'hello world') ecs setcomponent(entity, visiblecomponent) ecs setcomponent(entity, transformcomponent, { position new vector3(0, 1, 0) }) ecs setcomponent(entity, primitivegeometrycomponent, { geometrytype 1 }) conceptual overview at a high level, this script does the following ✅ creates an entity named hello world ✅ assigns a geometry component to define its shape (a sphere) ✅ positions the entity in 3d space technical overview from a technical perspective, this script imports ir engine modules to use ecs functions and components uses the ecs pattern to structure data and behavior defines an entity and components to create a visible object registers the script with the engine using the xrengine config ts file this connection happens in the project’s configuration file xrengine config ts worldinjection () => import(' /src/hello') // connects hello ts to the engine this ensures the engine loads and executes hello ts when the project starts ➡️ next steps your project is minimal but introduces critical engine concepts next, you will explore how ir engine structures data and logic using the ecs pattern 📌 continue to the ecs pattern docid 8qk3y ima2wses 92z65q to understand the engine’s core architecture