# GRKL - Website Instructions
website: https://soloapps.grkl.run

Welcome to **GRKL**, a self-hosted platform that allows you to instantly deploy small web applications directly from your browser. Every app you deploy automatically gets its own persistent database and real-time WebSocket channel.

Here is a step-by-step guide on how to use the website.

## 1. Logging In
1. Navigate to the website. You will be redirected to the login page if you are not authenticated.
2. Click the **Login with Google** button. All accounts are managed securely via Google OAuth.
3. Once successfully authenticated, you will be automatically redirected to your **User Dashboard**.

## 2. The User Dashboard
The dashboard (`/user/dashboard`) is your central hub. It lists all the applications you have deployed on the platform.
- **View Live App:** Click the `/apps/<slug>` link next to an app to open it in a new tab.
- **Active Sessions:** For multi-session apps, you will see a list of all active sessions directly below the app's files. Click a session to join it, click the **copy icon** to copy the full shareable URL, or click the **trash icon** to instantly disconnect all users and delete the session data.
- **Manage Files:** Click the **Add Files** button to upload additional assets to an existing app.
- **Remove Files:** Click the trash icon next to a specific file to delete it.
- **Delete App:** Click the delete button to completely remove an app, its files, and its database state.

## 3. Creating a New App
To deploy a new application, click the **New App** button from your dashboard.

1. **Name your app:** Type a display name. The URL slug will be automatically generated below it (e.g., "My Portfolio" becomes `/apps/my-portfolio`).
2. **Multi-Session Toggle:**
   - Optionally check **Multi-Session App**. If enabled, every visitor gets their own isolated backend room based on a session key in the URL. If a user visits the app without a session key, they are automatically redirected to a new random session.
3. **Upload Files:** 
   - Drag and drop a folder or individual files into the drop zone, or click the zone to open your system's file browser.
   - If you drop a folder, its contents will be flattened into the root of your app.
   - Hidden files (like `.DS_Store` or `.git`) are automatically ignored.
   - **Important:** Your upload *must* include an `index.html` file. The "Create App" button will remain disabled until `index.html` is provided.
3. **Launch:** Click **Create App**. Once uploaded, you will be presented with the live URL for your new application!

## 4. App Development & Assets
Once your app is uploaded, you don't need to configure complex routing. Files reference each other using standard relative paths.

For example, if you uploaded `index.html`, `style.css`, and `logo.png`, your `index.html` can simply use:
```html
<link rel="stylesheet" href="style.css">
<img src="logo.png" alt="Logo">
```
*Note: A `<base>` tag is injected automatically when `index.html` is served, so relative paths resolve correctly.*

## 5. Overwriting Existing Files
If you make changes to your code locally and want to update your app:
1. Go to your dashboard.
2. Click **Add Files** on your app.
3. Upload the modified file(s). If the filenames match, the existing files on the server will be seamlessly overwritten.

Enjoy building and deploying with GRKL!
