Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add PWA support #8

Merged
merged 5 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
16 changes: 14 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@
<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="/shortcut-icon.png" sizes="512x512" />
<link rel="mask-icon" href="/mask-icon.svg" color="#FFFFFF" />
<link rel="shortcut icon" href="/shortcut-icon.png" />
<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: /
Binary file added public/shortcut-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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: ["shortcut-icon.png", "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: "shortcut-icon.png",
type: "image/png",
sizes: "512x512",
},
],
},
};

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