Skip to content

Commit

Permalink
feat: add PWA support
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Jan 6, 2024
1 parent 9525ba6 commit 7831021
Show file tree
Hide file tree
Showing 9 changed files with 2,330 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
branches: ["master", "feat/pwa"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Alby PoS
# BuzzPay

Static HTML PoS powered by Nostr Wallet Connect
Alby's super simple self-custodial PoS powered by Nostr Wallet Connect.

Easily save to your homescreen as a PWA and share with your team with a single link or QR code.

## Development

Expand Down
17 changes: 15 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,22 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Alby PoS</title>
<meta name="author" content="Alby" />
<meta name="description" content="Alby's super simple self-custodial PoS" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta
name="apple-mobile-web-app-status-bar-style"
content="black-translucent"
/>
<meta name="theme-color" content="#FFDF6F" />
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
<link rel="apple-touch-icon" href="/icon.png" sizes="512x512" />
<link rel="mask-icon" href="/mask-icon.svg" color="#FFFFFF" />
<link rel="shortcut icon" href="/icon.png" />
<link rel="manifest" href="/manifest.webmanifest" />
<title>BuzzPay</title>
</head>
<body>
<div id="root"></div>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"postcss": "^8.4.32",
"tailwindcss": "^3.3.6",
"typescript": "^5.2.2",
"vite": "^5.0.10"
"vite": "^5.0.10",
"vite-plugin-pwa": "^0.17.4"
}
}
Binary file added public/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions public/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Allow: /
23 changes: 22 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
import { defineConfig } from "vite";
import { VitePWA, VitePWAOptions } from "vite-plugin-pwa";
import react from "@vitejs/plugin-react-swc";

const pwaConfig: Partial<VitePWAOptions> = {
includeAssets: ["icon.png", "icon.svg"],
manifest: {
name: "BuzzPay",
short_name: "BuzzPay",
description: "Alby's super simple self-custodial PoS",
scope: "/pos/",
background_color: "#FFDF6F",
theme_color: "#FFDF6F",
display: "standalone",
icons: [
{
src: "icon.png",
type: "image/png",
sizes: "512x512",
},
],
},
};

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react(), VitePWA(pwaConfig)],
base: "/pos/",
});
Loading

0 comments on commit 7831021

Please sign in to comment.