-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24527ff
commit ee83135
Showing
12 changed files
with
1,371 additions
and
393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This file was auto-generated by the Firebase CLI | ||
# https://github.com/firebase/firebase-tools | ||
|
||
name: Deploy to Firebase Hosting on merge | ||
'on': | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build_and_deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: FirebaseExtended/action-hosting-deploy@v0 | ||
with: | ||
repoToken: '${{ secrets.GITHUB_TOKEN }}' | ||
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_QUIZGEN_FINAL }}' | ||
channelId: live | ||
projectId: quizgen-final |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This file was auto-generated by the Firebase CLI | ||
# https://github.com/firebase/firebase-tools | ||
|
||
name: Deploy to Firebase Hosting on PR | ||
'on': pull_request | ||
jobs: | ||
build_and_preview: | ||
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: FirebaseExtended/action-hosting-deploy@v0 | ||
with: | ||
repoToken: '${{ secrets.GITHUB_TOKEN }}' | ||
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_QUIZGEN_FINAL }}' | ||
projectId: quizgen-final |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
firebase-debug.log* | ||
firebase-debug.*.log* | ||
|
||
# Firebase cache | ||
.firebase/ | ||
|
||
# Firebase config | ||
|
||
# Uncomment this if you'd like others to create their own Firebase project. | ||
# For a team working on the same Firebase project(s), it is recommended to leave | ||
# it commented so all members can deploy to the same project(s) in .firebaserc. | ||
# .firebaserc | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-app.js"; | ||
|
||
import { | ||
getFirestore, | ||
collection as firestoreCollection, | ||
query as firestoreQuery, | ||
where as firestoreWhere, | ||
getDoc as firebaseGetDoc, | ||
getDocs as firebaseGetDocs, | ||
doc as firebaseDoc, | ||
setDoc as firebaseSetDoc, | ||
serverTimestamp as firebaseServerTimestamp, | ||
} from "https://www.gstatic.com/firebasejs/10.7.1/firebase-firestore.js"; | ||
|
||
import { | ||
getAuth, | ||
signInWithPopup, | ||
GoogleAuthProvider, | ||
} from "https://www.gstatic.com/firebasejs/10.7.1/firebase-auth.js"; | ||
|
||
const firebaseConfig = { | ||
apiKey: "AIzaSyD0db68DhXLKxtPCyzmjeL3zcWbIllrPU8", | ||
authDomain: "quizgen.app", | ||
databaseURL: "https://quizgen-final.firebaseio.com", | ||
projectId: "quizgen-final", | ||
storageBucket: "quizgen-final.appspot.com", | ||
messagingSenderId: "789815253960", | ||
appId: "1:789815253960:web:8d49a9968c5e7037a47efd", | ||
}; | ||
// Initialize Firebase | ||
const app = initializeApp(firebaseConfig); | ||
|
||
const provider = new GoogleAuthProvider(); | ||
provider.addScope("https://www.googleapis.com/auth/drive.metadata.readonly"); | ||
provider.addScope("https://www.googleapis.com/auth/spreadsheets.readonly"); | ||
|
||
export const GoogleProvider = GoogleAuthProvider; | ||
export const auth = getAuth(); | ||
export const signIn = signInWithPopup; | ||
export const googleAuthProvider = provider; | ||
export const setDoc = firebaseSetDoc; | ||
export const doc = firebaseDoc; | ||
export const getDoc = firebaseGetDoc; | ||
export const getDocs = firebaseGetDocs; | ||
export const serverTimestamp = firebaseServerTimestamp; | ||
export const query = firestoreQuery; | ||
export const collection = firestoreCollection; | ||
export const where = firestoreWhere; | ||
export const db = getFirestore(app); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"indexes": [], | ||
"fieldOverrides": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
service cloud.firestore { | ||
match /databases/{database}/documents { | ||
// Allow public read access, but only content owners can write | ||
match /quizzes/{id} { | ||
allow read: if true | ||
allow create: if request.auth.uid == request.resource.data.author_uid; | ||
allow update, delete: if request.auth.uid == resource.data.author_uid; | ||
} | ||
} | ||
} |
Oops, something went wrong.