### src\index.html

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Notes</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <div data-tauri-drag-region class="titlebar">
    <div class="titlebar-button" id="titlebar-minimize">
      <img
        src="https://api.iconify.design/mdi:window-minimize.svg"
        alt="minimize"
      />
    </div>
    <div class="titlebar-button" id="titlebar-maximize">
      <img
        src="https://api.iconify.design/mdi:window-maximize.svg"
        alt="maximize"
      />
    </div>
    <div class="titlebar-button" id="titlebar-close">
      <img src="https://api.iconify.design/mdi:close.svg" alt="close" />
    </div>
  </div>

  <script src="main.js"/>
  <script>
    
    const { getCurrentWindow, Window } = window.__TAURI__.window;

    const appWindow = getCurrentWindow();

    document
      .getElementById('titlebar-minimize')
      ?.addEventListener('click', () => appWindow.minimize());
    document
      .getElementById('titlebar-maximize')
      ?.addEventListener('click', () => appWindow.toggleMaximize());
    document
      .getElementById('titlebar-close')
      ?.addEventListener('click', () => appWindow.close());

  </script>
  
</body>
</html>

```

### src\main.js (not editable, core API)

```javascript
class FileManager {
  
    constructor(basePath) {
      const { dialog, fs, path } = window.__TAURI__;
      this.fs = fs;
      this.path = path;
      this.dialog = dialog;
      this.basePath = basePath;
    }

    async selectDirectory() {
      const selected = await this.dialog.open({ directory: true });
      if (selected) {
        this.basePath = selected;
        return selected;
      }
      return null;
    }

    async createFile(filename, content = '') {
      const filePath = await this.path.join(this.basePath, filename);
      await this.fs.writeTextFile(filePath, content);
      return filePath;
    }

    async readFile(filename) {
      const filePath = await this.path.join(this.basePath, filename);
      return await this.fs.readTextFile(filePath);
    }

    async updateFile(filename, content) {
      const filePath = await this.path.join(this.basePath, filename);
      await this.fs.writeTextFile(filePath, content);
      return filePath;
    }

    async renameFile(oldFilename, newFilename) {
      const oldPath = await this.path.join(this.basePath, oldFilename);
      const newPath = await this.path.join(this.basePath, newFilename);
      await this.fs.rename(oldPath, newPath);
      return newPath;
    }

    async deleteFile(filename) {
      const filePath = await this.path.join(this.basePath, filename);
      await this.fs.remove(filePath);
    }

    async listFiles() {
      const entries = await this.fs.readDir(this.basePath);
      return entries.filter(entry => !entry.children);
    }
  }

  class VaultManager {

    constructor(fileManager) {
      this.fileManager = fileManager;
      this.vaultPath = '';
      this.onVaultChange = null;
    }

    async initialize() {
      const savedPath = await localStorage.getItem('vaultPath');
      if (savedPath) {
        this.vaultPath = savedPath;
        this.fileManager.basePath = savedPath;
        return true;
      }
      return false;
    }

    async selectVault() {
      const selected = await this.fileManager.selectDirectory();
      if (selected) {
        this.vaultPath = selected;
        this.fileManager.basePath = selected;
        await localStorage.setItem('vaultPath', selected);
        if (this.onVaultChange) {
          await this.onVaultChange();
        }
        return true;
      }
      return false;
    }

    async changeVault() {
      const selected = await this.fileManager.selectDirectory();
      if (selected) {
        this.vaultPath = selected;
        this.fileManager.basePath = selected;
        await localStorage.setItem('vaultPath', selected);
        if (this.onVaultChange) {
          await this.onVaultChange();
        }
        return true;
      }
      return false;
    }

    getPath() {
      return this.vaultPath;
    }

    isInitialized() {
      return !!this.vaultPath;
    }
  }

```

I need a minimal, plain text based, Obsidian clone.

- When the app it's opened for the first time, ask for the core path / vault
- No titles, but UID.
- Plain text notes based.