Skip to content

Commit 938697d

Browse files
authored
relay-sqlite-example (#1403)
* relay-sqlite-example Manager+Adapter * Update README.md
1 parent 4b43fa7 commit 938697d

22 files changed

+3180
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# gun-relay-sqlite
2+
3+
Manager+Adapter Stable version
4+
5+
Support iOS & Android
6+
7+
# Quickly build a relay manager and Gun storage adapter with sqlite persistence.
8+
9+
```base
10+
yarn install
11+
```
12+
13+
```base
14+
yarn build
15+
```
16+
17+
```base
18+
npx cap sync
19+
```
20+
21+
```base
22+
npx cap open ios | android
23+
```
24+
25+
# Preview
26+
![relayios](https://github.com/user-attachments/assets/258050f2-328c-42f8-a8b0-0ab24efa9acf)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { CapacitorConfig } from '@capacitor/cli';
2+
import { CapacitorHttp } from '@capacitor/core';
3+
import { KeyboardResize, KeyboardStyle } from '@capacitor/keyboard'
4+
const config: CapacitorConfig = {
5+
appId: 'com.gun.relay',
6+
appName: 'Relay',
7+
webDir: 'dist',
8+
9+
10+
plugins: {
11+
CapacitorHttp: {
12+
enabled: true,
13+
},
14+
15+
Keyboard: {
16+
resize: KeyboardResize.None,
17+
resizeOnFullScreen: true,
18+
19+
},
20+
CapacitorSQLite: {
21+
migrate: true,
22+
iosDatabaseLocation: 'Library/CapacitorDatabase',
23+
iosIsEncryption: true,
24+
iosKeychainPrefix: 'gundb',
25+
iosBiometric: {
26+
biometricAuth: false,
27+
biometricTitle : "Biometric login for capacitor sqlite"
28+
},
29+
androidIsEncryption: true,
30+
androidBiometric: {
31+
biometricAuth : false,
32+
biometricTitle : "Biometric login for capacitor sqlite",
33+
biometricSubTitle : "Log in using your biometric"
34+
},
35+
electronIsEncryption: true,
36+
electronWindowsLocation: "C:\\ProgramData\\CapacitorDatabases",
37+
electronMacLocation: "~/Databases/",
38+
electronLinuxLocation: "Databases"
39+
}
40+
}
41+
};
42+
43+
export default config;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Gun-Relay-sqlite</title>
6+
7+
<base href="/" />
8+
9+
<meta name="color-scheme" content="light dark" />
10+
<meta
11+
name="viewport"
12+
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
13+
/>
14+
<meta name="format-detection" content="telephone=no" />
15+
<meta name="msapplication-tap-highlight" content="no" />
16+
17+
<link rel="shortcut icon" type="image/png" href="/favicon.png" />
18+
19+
<!-- add to homescreen for ios -->
20+
<meta name="apple-mobile-web-app-capable" content="yes" />
21+
<meta name="apple-mobile-web-app-title" content="Gun-Relay-sqlite" />
22+
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
23+
</head>
24+
25+
<body>
26+
<div id="app"></div>
27+
<script type="module" src="/src/main.ts"></script>
28+
</body>
29+
30+
</html>
31+
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
{
2+
"name": "gun-relay-sqlite",
3+
"private": true,
4+
"version": "0.0.1",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "npm run copy:sql:wasm && vite --host",
8+
"build:web": "npm run copy:sql:wasm && npm run build",
9+
"build:native": "npm run remove:sql:wasm && npm run build",
10+
"build": "vue-tsc && vite build",
11+
"preview": "vite preview",
12+
"ionic:serve:before": "npm run copy:sql:wasm",
13+
"copy:sql:wasm": "copyfiles -u 3 node_modules/sql.js/dist/sql-wasm.wasm public/assets",
14+
"remove:sql:wasm": "rimraf public/assets/sql-wasm.wasm",
15+
"ios:start": "npm run remove:sql:wasm && npm run build:native && npx cap sync && npx cap copy && npx cap open ios",
16+
"android:start": "npm run remove:sql:wasm && npm run build:native && npx cap sync && npx cap copy && npx cap open android",
17+
"electron:install": "cd electron && npm install && cd ..",
18+
"electron:prepare": "npm run remove:sql:wasm && npm run build && npx cap sync @capacitor-community/electron && npx cap copy @capacitor-community/electron",
19+
"electron:start": "npm run electron:prepare && cd electron && npm run electron:start",
20+
"clean:vite:cache": "vite clean",
21+
"test:e2e": "cypress run",
22+
"test:unit": "vitest",
23+
"lint": "eslint"
24+
},
25+
"dependencies": {
26+
"@angular/core": "^19.1.6",
27+
"@aparajita/capacitor-biometric-auth": "^9.0.0",
28+
"@aparajita/capacitor-secure-storage": "^6.0.1",
29+
"@capacitor-community/barcode-scanner": "^4.0.1",
30+
"@capacitor-community/electron": "^4.1.2",
31+
"@capacitor-community/media": "^8.0.0",
32+
"@capacitor-community/speech-recognition": "^6.0.1",
33+
"@capacitor-community/sqlite": "^5.2.3",
34+
"@capacitor/action-sheet": "^7.0.0",
35+
"@capacitor/android": "^7.0.0",
36+
"@capacitor/app": "^7.0.0",
37+
"@capacitor/assets": "latest",
38+
"@capacitor/background-runner": "^2.1.0",
39+
"@capacitor/browser": "^7.0.0",
40+
"@capacitor/camera": "^7.0.0",
41+
"@capacitor/clipboard": "^7.0.0",
42+
"@capacitor/core": "^7.0.0",
43+
"@capacitor/device": "^7.0.0",
44+
"@capacitor/dialog": "^7.0.0",
45+
"@capacitor/filesystem": "^7.0.0",
46+
"@capacitor/geolocation": "^7.0.0",
47+
"@capacitor/haptics": "^7.0.0",
48+
"@capacitor/ios": "^7.0.0",
49+
"@capacitor/keyboard": "^7.0.0",
50+
"@capacitor/local-notifications": "^7.0.0",
51+
"@capacitor/network": "^7.0.0",
52+
"@capacitor/preferences": "^7.0.0",
53+
"@capacitor/push-notifications": "^7.0.0",
54+
"@capacitor/status-bar": "^7.0.0",
55+
"@capacitor/toast": "^7.0.0",
56+
"@ffmpeg/core": "^0.12.10",
57+
"@ffmpeg/ffmpeg": "^0.12.15",
58+
"@ffmpeg/util": "^0.12.2",
59+
"@gun-vue/composables": "^0.24.2",
60+
"@gun-vue/gun-es": "^0.3.1240",
61+
"@iconify/tailwind": "latest",
62+
"@ionic-native/background-mode": "^5.36.0",
63+
"@ionic-native/core": "^5.36.0",
64+
"@ionic-native/fingerprint-aio": "^5.36.0",
65+
"@ionic-native/media": "^5.36.0",
66+
"@ionic-native/qr-scanner": "^5.36.0",
67+
"@ionic-native/secure-storage": "^5.36.0",
68+
"@ionic-native/sqlite": "^5.36.0",
69+
"@ionic/cli": "latest",
70+
"@ionic/pwa-elements": "^3.2.2",
71+
"@ionic/storage": "^4.0.0",
72+
"@ionic/storage-angular": "^4.0.0",
73+
"@ionic/vue": "^7.0.0",
74+
"@ionic/vue-router": "^7.0.0",
75+
"@joyid/capacitor-native-passkey": "^0.0.3",
76+
"@peculiar/webcrypto": "^1.5.0",
77+
"@rollup/plugin-inject": "^5.0.5",
78+
"@scure/bip39": "^1.6.0",
79+
"@simplewebauthn/browser": "^13.1.0",
80+
"@tresjs/core": "latest",
81+
"@tweenjs/tween.js": "latest",
82+
"@types/gun": "^0.9.6",
83+
"@types/text-encoding": "^0.0.40",
84+
"@types/uuid": "^10.0.0",
85+
"@types/webrtc": "^0.0.44",
86+
"@vue/language-plugin-pug": "^2.2.2",
87+
"@vueuse/core": "latest",
88+
"@vueuse/gesture": "^2.0.0",
89+
"add": "^2.0.6",
90+
"animate.css": "latest",
91+
"autopass": "^2.1.0",
92+
"axios": "latest",
93+
"b4a": "^1.6.7",
94+
"better-scroll": "^2.5.1",
95+
"btoa": "^1.2.1",
96+
"buffer": "^6.0.3",
97+
"capacitor-voice-recorder": "^7.0.5",
98+
"cordova-plugin-background-mode": "^0.7.3",
99+
"cordova-plugin-device": "^3.0.0",
100+
"cordova-plugin-fingerprint-aio": "^6.0.0",
101+
"cordova-plugin-secure-storage-echo": "^5.1.1",
102+
"cordova-sqlite-storage": "^7.0.0",
103+
"corestore": "^7.1.0",
104+
"crypto-browserify": "^3.12.1",
105+
"crypto-js": "^4.2.0",
106+
"cryptojs": "^2.5.3",
107+
"elliptic": "^6.6.1",
108+
"ffmpeg": "^0.0.4",
109+
"gsap": "^3.13.0",
110+
"gun": "^0.2020.1240",
111+
"gun-avatar": "^2.2.2",
112+
"gun-flint": "^0.0.28",
113+
"ionicons": "^7.4.0",
114+
"jsqr": "latest",
115+
"localforage-cordovasqlitedriver": "^1.8.0",
116+
"lodash": "^4.17.21",
117+
"native-run": "^2.0.1",
118+
"node-forge": "^1.3.1",
119+
"nvm": "latest",
120+
"peerjs": "^1.5.4",
121+
"photoswipe": "^5.4.4",
122+
"pinia": "^3.0.1",
123+
"pinyin-pro": "^3.26.0",
124+
"postcss": "latest",
125+
"postcss-loader": "latest",
126+
"pug": "^3.0.3",
127+
"qrcode.vue": "latest",
128+
"qrcodejs2": "latest",
129+
"sass": "latest",
130+
"socket.io-client": "latest",
131+
"stats.js": "latest",
132+
"stream-browserify": "^3.0.0",
133+
"swiper": "^11.2.6",
134+
"tailwind": "latest",
135+
"text-encoding": "^0.7.0",
136+
"three": "latest",
137+
"three-stdlib": "^2.35.16",
138+
"tweakpane": "latest",
139+
"uint8arrays": "latest",
140+
"unplugin-auto-import": "^19.0.0",
141+
"uuid": "^11.1.0",
142+
"vite-plugin-pwa": "latest",
143+
"vm-browserify": "^1.1.2",
144+
"vue": "latest",
145+
"vue-chartjs": "latest",
146+
"vue-count-to": "^1.0.13",
147+
"vue-i18n": "latest",
148+
"vue-image-lightbox": "^7.2.0",
149+
"vue-lazyload": "^3.0.0",
150+
"vue-router": "^4.1.6",
151+
"vue-virtual-scroller": "^2.0.0-beta.8",
152+
"vue3-carousel": "^0.15.0",
153+
"vue3-photo-preview": "^0.3.0",
154+
"vue3-qrcode-reader": "latest",
155+
"vue3-touch-events": "latest",
156+
"webrtc-adapter": "^9.0.3"
157+
},
158+
"devDependencies": {
159+
"@capacitor/cli": "^7.0.0",
160+
"@iconify-json/tabler": "latest",
161+
"@iconify/json": "latest",
162+
"@tsconfig/node22": "latest",
163+
"@types/jsdom": "latest",
164+
"@types/node": "^22.10.7",
165+
"@types/stats.js": "latest",
166+
"@types/three": "latest",
167+
"@unocss/preset-icons": "^65.4.2",
168+
"@unocss/preset-uno": "^65.4.2",
169+
"@vitejs/plugin-legacy": "^4.0.2",
170+
"@vitejs/plugin-vue": "^4.0.0",
171+
"@vitest/eslint-plugin": "latest",
172+
"@vue/eslint-config-prettier": "latest",
173+
"@vue/eslint-config-typescript": "^11.0.2",
174+
"@vue/test-utils": "^2.3.0",
175+
"@vue/tsconfig": "latest",
176+
"copyfiles": "^2.4.1",
177+
"cypress": "^13.1.0",
178+
"eslint": "^8.35.0",
179+
"eslint-plugin-oxlint": "latest",
180+
"eslint-plugin-vue": "^9.9.0",
181+
"jsdom": "^22.1.0",
182+
"npm-run-all2": "latest",
183+
"oxlint": "latest",
184+
"prettier": "latest",
185+
"process": "^0.11.10",
186+
"rimraf": "^5.0.1",
187+
"tailwindcss": "latest",
188+
"terser": "^5.37.0",
189+
"typescript": "^5.1.6",
190+
"unocss": "^65.4.2",
191+
"unplugin-vue-components": "latest",
192+
"vite": "^latest",
193+
"vite-plugin-node-polyfills": "^0.23.0",
194+
"vite-plugin-pages": "latest",
195+
"vite-plugin-vue-devtools": "latest",
196+
"vitest": "latest",
197+
"vue-tsc": "latest"
198+
},
199+
"description": "gun-sqlite-relay",
200+
"main": "index.js",
201+
"keywords": [],
202+
"author": "",
203+
"license": "ISC"
204+
}

0 commit comments

Comments
 (0)