The restructuring prompt, how it was implemented, the features that exist today, and guidance for future development.
Review and reorganize the entire project structure to make it clean, logical, scalable, and easy to maintain. Separate core system/source code from Admin-Panel-managed project files; store all admin-managed content in a dedicated directory; keep two-way GitHub sync working; add a /documentation folder with a project doc and this feature/prompt doc; make the Admin Panel fully responsive; and preserve all existing functionality while verifying the app still builds and deploys.
The goal was a clear separation between the application's core files and the content the Admin Panel manages, without breaking the live launcher or admin.
data/ and moved the old clients/ tree into a nested, scalable layout:
clients/icon → data/scripts/icon
clients/stpm → data/scripts/stpm
clients/general-scripts → data/scripts/general-scripts
clients/shared → data/shared
clients/_template → data/templates
clients/_docs → data/documents
Files were moved with git mv so history is preserved.api/list.js / api/get.js path guards) from clients/… to data/…. Because script sets now live in their own data/scripts/ folder, the old "filter out shared/_template/_docs" logic was removed.public/documentation/ with this file and project-documentation.html.api/, public/) did not move — Vercel requires those locations. The clean separation is: api/ + public/ = the app; data/ = everything the Admin Panel manages.irm https://toolkit.bistab.com.np | iex.data/.B/H/Q.LAUNCHER_KEY), prompted at startup.-Config passed only if the script declares it; robust JSON parsing; errors never crash the menu.curl -fsSL https://toolkit.bistab.com.np/linux | bash.data/linux (mirror of Scripts); browse set → category → script.at); same x-launcher-key auth; input read from /dev/tty so it works under curl | bash.ADMIN_PASSWORD); grouped tree (Script Sets / Doc Storage / Templates & Shared).config.json and .gitkeep hidden from view.data/documents) for procedures/docs — admin-only, hidden from PowerShell.no-store on read endpoints closes a cache auth-bypass.The private repo is the data store. Adding files in git and editing in the Admin Panel are two sides of the same thing:
data/ and it appears in the Admin Panel and launcher with the correct hierarchy on the next load (Trees/Contents API, no caching on reads).admin: <action> <path>), so changes sync straight back with full history.The functions authenticate to GitHub with GITHUB_TOKEN (fine-grained, this repo, Contents read+write). Writes include the file sha when updating; deletes require the sha.
/admin, sign in with ADMIN_PASSWORD.data/scripts/<name>/config.json.config.json.GITHUB_TOKEN (Contents read+write), GITHUB_REPO, optional GITHUB_REF, ADMIN_PASSWORD, optional LAUNCHER_KEY.$script:BaseUrl in public/launcher.ps1, push once.Verify: irm https://<domain> | iex shows the script set menu; /admin loads the tree and opens files.
api/ + public/; all managed content under data/. New content categories → new subfolders of data/ (mirror the launcher/admin grouping logic if they should be treated specially).public/launcher.ps1 (script sets from data/scripts, shared from data/shared). Bump $script:Version so deploys are verifiable.public/admin/index.html (single file). Reuse the existing helpers: write(), askPassword(), loadTree(), renderFolderView().api/. Gate reads with LAUNCHER_KEY-or-admin, writes with ADMIN_PASSWORD; keep no-store on anything that returns gated content.