> For the complete documentation index, see [llms.txt](https://docs.win32.run/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.win32.run/developers/spaghetti-code/code-structure.md).

# Code Structure

UI components, utility functions, shared data structures and configurations reside in `src/lib`

Assets and static content (embedded html page used in some programs) reside in `static`

Application starting point: `src/routes/index.svelte`, this page handles the general load/unload of the UI.&#x20;

Upon its boot, `src/routes/index.svelte` will load `src/routes/boot_manager.svelte`, which is the boot options scene.&#x20;

At this point, if you select `Start Windows Normally`, the `src/routes/xp/starting.svelte` will be loaded into the scene.

## starting.svelte

`src/routes/xp/starting.svelte`

If this is the first time use, it will bootstrap the user's *hard drive* with hard\_drive.json. It also preloads static assets (wallpapers, icons, audios, etc.) and some components like context menus.

Then it loads `src/routes/xp/desktop.svelte`

## desktop.svelte

`src/routes/xp/desktop.svelte`

The desktop environment. It's the container for the workspace, taskbar, start menu, etc.

`desktop.svelte` also listens for system-wide commands (at the moment: shutdown, restart) and handles writing changes made by users and programs to the disk (IndexedDB)

## work\_space.svelte

`src/routes/xp/work_space.svelte`

The screen -  (taskbar + startmenu) in terms of screen estate.

It launches programs into the workspace on request.

## /programs

`src/routes/xp/programs`

This folder contains all the *native* programs (apps, like Foxit Reader, MS Word). It's just my code organizing, if you write a new program, you don't necessarily put your `your_program.svelte` in this folder.

In case you already have an up & running webapp (website), please read [3rd-party apps](/developers/3rd-party-apps.md) section for integration, so you don't have to deal with win32.run codebase.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.win32.run/developers/spaghetti-code/code-structure.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
