@edgedev/create-edge-app 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +10 -0
- package/.vscode/settings.json +14 -0
- package/README.md +63 -0
- package/app.vue +106 -0
- package/bin/cli-edge-app.js +99 -0
- package/components/.gitkeep +0 -0
- package/components/account.vue +84 -0
- package/components/bottomMenu.vue +35 -0
- package/components/dashboard.vue +186 -0
- package/components/editor.vue +250 -0
- package/components/formSubtypes/.gitkeep +0 -0
- package/components/topMenu.vue +17 -0
- package/components/userMenu.vue +64 -0
- package/composables/global.ts +15 -0
- package/composables/vuetify.ts +10 -0
- package/deploy.sh +6 -0
- package/emulator.sh +17 -0
- package/firebase.json +56 -0
- package/firestore.indexes.json +4 -0
- package/firestore.rules +294 -0
- package/firestore.rules.backup +1 -0
- package/functions/.runtimeconfig.json +5 -0
- package/functions/index.js +226 -0
- package/functions/index.js.backup +4 -0
- package/functions/package-lock.json +4535 -0
- package/functions/package.json +25 -0
- package/middleware/auth.ts +17 -0
- package/nuxt.config.ts +27 -0
- package/package.json +34 -0
- package/pages/app/[[page]]/[[collection]]/[[docId]].vue +48 -0
- package/pages/app/login.vue +16 -0
- package/pages/app/signup.vue +17 -0
- package/plugins/draggable.ts +5 -0
- package/plugins/edgeFirebaseFramework.ts +5 -0
- package/plugins/firebase.client.ts +16 -0
- package/plugins/maska.ts +5 -0
- package/plugins/number.ts +4 -0
- package/plugins/vuetify.ts +14 -0
- package/public/favicon.ico +0 -0
- package/public/images/logo-square.png +0 -0
- package/public/images/logo.png +0 -0
- package/server/tsconfig.json +3 -0
- package/storage.rules +8 -0
- package/tsconfig.json +4 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "functions",
|
|
3
|
+
"description": "Cloud Functions for Firebase",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"serve": "firebase emulators:start --only functions",
|
|
6
|
+
"shell": "firebase functions:shell",
|
|
7
|
+
"start": "npm run shell",
|
|
8
|
+
"deploy": "firebase deploy --only functions",
|
|
9
|
+
"logs": "firebase functions:log"
|
|
10
|
+
},
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": "16"
|
|
13
|
+
},
|
|
14
|
+
"main": "index.js",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"firebase-admin": "^10.0.2",
|
|
17
|
+
"firebase-functions": "^4.2.1",
|
|
18
|
+
"form-data": "^4.0.0",
|
|
19
|
+
"formidable-serverless": "^1.1.1"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"firebase-functions-test": "^0.2.0"
|
|
23
|
+
},
|
|
24
|
+
"private": true
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default defineNuxtRouteMiddleware(async () => {
|
|
2
|
+
// EDGE START
|
|
3
|
+
const preLoginRoute = useState('preLoginRoute')
|
|
4
|
+
if (!preLoginRoute.value) {
|
|
5
|
+
preLoginRoute.value = window.location.pathname
|
|
6
|
+
}
|
|
7
|
+
const auth: any = useState('auth')
|
|
8
|
+
if (auth.value) {
|
|
9
|
+
if (!auth.value.loggedIn) {
|
|
10
|
+
return '/app/login'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
return '/app/login'
|
|
15
|
+
}
|
|
16
|
+
// EDGE END
|
|
17
|
+
})
|
package/nuxt.config.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
2
|
+
export default defineNuxtConfig({
|
|
3
|
+
css: [
|
|
4
|
+
'vuetify/lib/styles/main.sass',
|
|
5
|
+
'@mdi/font/css/materialdesignicons.min.css',
|
|
6
|
+
],
|
|
7
|
+
ssr: false,
|
|
8
|
+
build: {
|
|
9
|
+
transpile: ['vuetify'],
|
|
10
|
+
},
|
|
11
|
+
runtimeConfig: {
|
|
12
|
+
public: {
|
|
13
|
+
registrationCode: process.env.REGISTRATION_CODE,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
components: {
|
|
17
|
+
dirs: [
|
|
18
|
+
{ path: '~/components/formSubtypes', global: true, prefix: 'form-subtypes' },
|
|
19
|
+
'~/components',
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
vite: {
|
|
23
|
+
define: {
|
|
24
|
+
'process.env.DEBUG': false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
})
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@edgedev/create-edge-app",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Create Edge Starter App",
|
|
5
|
+
"bin": "bin/cli-edge-app.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "nuxt build",
|
|
8
|
+
"dev": "nuxt dev",
|
|
9
|
+
"emulator": "nuxt dev --dotenv .env.dev",
|
|
10
|
+
"build-emulator": "nuxt generate --dotenv .env.dev",
|
|
11
|
+
"generate": "nuxt generate",
|
|
12
|
+
"preview": "nuxt preview",
|
|
13
|
+
"postinstall": "nuxt prepare"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@antfu/eslint-config": "^0.35.1",
|
|
17
|
+
"@mdi/font": "^7.1.96",
|
|
18
|
+
"@nuxt/devtools": "^0.7.2",
|
|
19
|
+
"@types/node": "^18.11.18",
|
|
20
|
+
"eslint": "^8.33.0",
|
|
21
|
+
"firebase": "^9.17.1",
|
|
22
|
+
"nuxt": "^3.1.2",
|
|
23
|
+
"sass": "^1.58.0",
|
|
24
|
+
"typescript": "^4.9.5",
|
|
25
|
+
"vuedraggable": "^4.1.0",
|
|
26
|
+
"vuetify": "^3.1.13"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@chenfengyuan/vue-number-input": "2",
|
|
30
|
+
"@edgedev/firebase": "latest",
|
|
31
|
+
"@edgedev/firebase-framework": "latest",
|
|
32
|
+
"maska": "^2.1.9"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const route = useRoute()
|
|
3
|
+
const edgeGlobal = inject('edgeGlobal')
|
|
4
|
+
|
|
5
|
+
const state = reactive({
|
|
6
|
+
newDocs: {
|
|
7
|
+
things: {
|
|
8
|
+
name: { type: 'text', value: '', rules: [edgeGlobal.edgeRules.required], helper: 'Name', cols: '12' },
|
|
9
|
+
description: { type: 'text', value: '', rules: [], helper: 'Description', cols: '12' },
|
|
10
|
+
subthings: { type: 'collection', value: '', rules: [], helper: 'Subthings', cols: '12' },
|
|
11
|
+
},
|
|
12
|
+
subthings: {
|
|
13
|
+
name: { type: 'text', value: '', rules: [edgeGlobal.edgeRules.required], helper: 'Name', cols: '12' },
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const page = computed(() => {
|
|
19
|
+
return route.params.page
|
|
20
|
+
})
|
|
21
|
+
const collection = computed(() => {
|
|
22
|
+
if (route.params.collection) {
|
|
23
|
+
return route.params.collection
|
|
24
|
+
}
|
|
25
|
+
return 'things'
|
|
26
|
+
})
|
|
27
|
+
const docId = computed(() => {
|
|
28
|
+
if (route.params.docId) {
|
|
29
|
+
return route.params.docId
|
|
30
|
+
}
|
|
31
|
+
return ''
|
|
32
|
+
})
|
|
33
|
+
definePageMeta({
|
|
34
|
+
middleware: 'auth',
|
|
35
|
+
})
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<v-container
|
|
40
|
+
v-if="edgeGlobal.edgeState.organizationDocPath"
|
|
41
|
+
class="py-8 px-6"
|
|
42
|
+
fluid
|
|
43
|
+
>
|
|
44
|
+
<dashboard v-if="page === 'dashboard' && docId === ''" :collection="collection" />
|
|
45
|
+
<editor v-else-if="page === 'dashboard' && docId !== ''" :collection="collection" :doc-id="docId" :new-doc-schema="state.newDocs[collection]" />
|
|
46
|
+
<account v-else-if="page === 'account'" />
|
|
47
|
+
</v-container>
|
|
48
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<template>
|
|
5
|
+
<v-container class="fill-height" fluid>
|
|
6
|
+
<v-row align="center" class="fill-height" justify="center">
|
|
7
|
+
<v-col cols="12" class="center-align" sm="8" md="6">
|
|
8
|
+
<edge-auth type="login" />
|
|
9
|
+
</v-col>
|
|
10
|
+
</v-row>
|
|
11
|
+
</v-container>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<style lang="scss" scoped>
|
|
15
|
+
|
|
16
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const config = useRuntimeConfig()
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<v-container class="fill-height" fluid>
|
|
7
|
+
<v-row align="center" class="fill-height" justify="center">
|
|
8
|
+
<v-col cols="12" class="center-align" sm="8" md="6">
|
|
9
|
+
<edge-auth type="register" :registration-code="config.public.registrationCode" />
|
|
10
|
+
</v-col>
|
|
11
|
+
</v-row>
|
|
12
|
+
</v-container>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<style lang="scss" scoped>
|
|
16
|
+
|
|
17
|
+
</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import edgeFirebase from '@edgedev/firebase'
|
|
2
|
+
|
|
3
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
4
|
+
nuxtApp.vueApp.use(edgeFirebase, {
|
|
5
|
+
apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
|
|
6
|
+
authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
|
|
7
|
+
projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
|
|
8
|
+
storageBucket: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET,
|
|
9
|
+
messagingSenderId: import.meta.env.VITE_FIREBASE_MESSAGING_SENDER_ID,
|
|
10
|
+
appId: import.meta.env.VITE_FIREBASE_APP_ID,
|
|
11
|
+
measurementId: import.meta.env.VITE_FIREBASE_MEASUREMENT_ID,
|
|
12
|
+
emulatorAuth: import.meta.env.VITE_FIREBASE_EMULATOR_AUTH,
|
|
13
|
+
emulatorFirestore: import.meta.env.VITE_FIREBASE_EMULATOR_FIRESTORE,
|
|
14
|
+
emulatorFunctions: import.meta.env.VITE_FIREBASE_EMULATOR_FUNCTIONS,
|
|
15
|
+
}, true, true)
|
|
16
|
+
})
|
package/plugins/maska.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default defineNuxtPlugin (async (nuxtApp) => {
|
|
2
|
+
const { createVuetify } = await import('vuetify')
|
|
3
|
+
const components = await import('vuetify/components')
|
|
4
|
+
const directives = await import('vuetify/directives')
|
|
5
|
+
const vuetify = createVuetify({
|
|
6
|
+
theme: {
|
|
7
|
+
defaultTheme: 'light',
|
|
8
|
+
},
|
|
9
|
+
components,
|
|
10
|
+
directives,
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
nuxtApp.vueApp.use(vuetify)
|
|
14
|
+
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/storage.rules
ADDED
package/tsconfig.json
ADDED