# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
