Skip to content

abvstudio-net/chat_app

Repository files navigation

chat_app

This application is a Progressive Web App that serves the frontend of "PlebChat" - an AI-chat application where users are anonymous and pay-per-token with bitcoin in the form of eCash (cashu tokens).

Upon first use the application will show a series of welcome popups that serve to educate the user on steps to install the PWA, import backed-up API keys (from other sessions), paste cashu tokens in order to setup a new API key, or skip in order to browse the app and become familiar.


Quick start

npm install
npm run icons     # generate PNGs and Apple touch icon
npm run dev      # http://localhost:5175
npm run build
npm run preview  # http://localhost:5174

Stack

  • Vue 3 + Vue Router (SPA)
  • Vite
  • vite-plugin-pwa (registerType: autoUpdate; Workbox with skipWaiting + clientsClaim)

Docs

  • Authoritative template docs: docs/VUE.md (Vue + Vite + vite-plugin-pwa)
  • cashu.me reference docs (Quasar-based): docs/PWA.md, docs/FAQ.md (kept for background; concepts map to Vite equivalents)
  • Submodule (do not edit): Inspiration/cashu.me/

Service worker & caching

  • SW is generated by vite-plugin-pwa and registered via useRegisterSW in src/App.vue.
  • Only the app shell is precached. External APIs (height/price) are fetched with cache: 'no-store' and are never cached by the SW.

Icons

  • Development icons live in public/icons/ and are referenced by the PWA manifest configured in vite.config.js.
  • SVG sources: public/icons/icon-192.svg, public/icons/icon-512.svg.
  • PNGs (preferred by many platforms): public/icons/icon-192.png, public/icons/icon-512.png.
  • Apple touch icon: public/icons/apple-touch-icon.png.
  • Generate icons from SVGs: run npm run icons.

Hosting (SPA history fallback)

  • Netlify or Cloudflare Pages: add a _redirects file at the repo root or in public/ containing:
    /* /index.html 200
    
  • Vercel: add vercel.json with:
    {
      "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
    }
    
  • Nginx:
    location / {
      try_files $uri $uri/ /index.html;
    }
    
  • Apache (.htaccess):
    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index\.html$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.html [L]
    </IfModule>
    
  • GitHub Pages: copy dist/index.html to dist/404.html during deploy so unknown routes serve the SPA.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors