├── firestore.indexes.json ├── .firebaserc ├── public ├── favicon.ico └── index.html ├── src ├── assets │ ├── logo.png │ ├── home-bg.jpg │ ├── arrow-204-32.png │ ├── google-icon.png │ ├── fonts │ │ └── StargazeStencil.otf │ ├── main.css │ ├── register.svg │ └── discord.svg ├── store │ └── index.js ├── composables │ ├── useLoginCollection.js │ ├── getUser.js │ ├── useLogout.js │ ├── addUsers.js │ ├── useCollection.js │ ├── useLogin.js │ ├── useSignInGoogle.js │ ├── deleteDocuments.js │ ├── useSignup.js │ └── getCollection.js ├── main.js ├── firebase │ └── config.js ├── App.vue ├── views │ ├── Auth.vue │ ├── SubmitPR.vue │ ├── Dashboard.vue │ └── Home.vue ├── components │ ├── Confetti.vue │ ├── Nav.vue │ ├── Login.vue │ ├── Signup.vue │ └── PreLoader.vue └── router │ └── index.js ├── babel.config.js ├── storage.rules ├── firestore.rules ├── .gitignore ├── README.md ├── firebase.json └── package.json /firestore.indexes.json: -------------------------------------------------------------------------------- 1 | { 2 | "indexes": [], 3 | "fieldOverrides": [] 4 | } 5 | -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "aperta-fons-bf53f" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BitByte-TPC/Aperta-Fons/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BitByte-TPC/Aperta-Fons/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/home-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BitByte-TPC/Aperta-Fons/HEAD/src/assets/home-bg.jpg -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /src/assets/arrow-204-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BitByte-TPC/Aperta-Fons/HEAD/src/assets/arrow-204-32.png -------------------------------------------------------------------------------- /src/assets/google-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BitByte-TPC/Aperta-Fons/HEAD/src/assets/google-icon.png -------------------------------------------------------------------------------- /src/assets/fonts/StargazeStencil.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BitByte-TPC/Aperta-Fons/HEAD/src/assets/fonts/StargazeStencil.otf -------------------------------------------------------------------------------- /storage.rules: -------------------------------------------------------------------------------- 1 | rules_version = '2'; 2 | service firebase.storage { 3 | match /b/{bucket}/o { 4 | match /{allPaths=**} { 5 | allow read, write: if request.auth!=null; 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import { createStore } from 'vuex' 2 | 3 | export default createStore({ 4 | state: { 5 | }, 6 | mutations: { 7 | }, 8 | actions: { 9 | }, 10 | modules: { 11 | } 12 | }) 13 | -------------------------------------------------------------------------------- /firestore.rules: -------------------------------------------------------------------------------- 1 | rules_version = '2'; 2 | service cloud.firestore { 3 | match /databases/{database}/documents { 4 | match /{document=**} { 5 | allow read, write: if 6 | request.time < timestamp.date(2025, 10, 14); 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/composables/useLoginCollection.js: -------------------------------------------------------------------------------- 1 | import {projectFirestore} from "@/firebase/config"; 2 | 3 | const useLoginCollection = async (id) => { 4 | return projectFirestore.collection("admins").get().then(t => { 5 | return t.docs.map(doc => doc.data()) 6 | }) 7 | } 8 | 9 | export default useLoginCollection -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | .DS_Store 3 | node_modules 4 | /dist 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aperta-fons 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Customize configuration 19 | See [Configuration Reference](https://cli.vuejs.org/config/). 20 | -------------------------------------------------------------------------------- /src/composables/getUser.js: -------------------------------------------------------------------------------- 1 | import { ref } from "vue"; 2 | import { projectAuth } from "../firebase/config"; 3 | 4 | // refs 5 | const user = ref(projectAuth.currentUser); 6 | 7 | // auth changes 8 | projectAuth.onAuthStateChanged((_user) => { 9 | console.log("User state change. Current user is:", _user); 10 | user.value = _user; 11 | }); 12 | 13 | const getUser = () => { 14 | return { user }; 15 | }; 16 | 17 | export default getUser; 18 | -------------------------------------------------------------------------------- /src/composables/useLogout.js: -------------------------------------------------------------------------------- 1 | import {ref} from "vue"; 2 | import {projectAuth} from "@/firebase/config"; 3 | 4 | const error = ref(null) 5 | 6 | const logout = async () => { 7 | error.value = null 8 | try { 9 | await projectAuth.signOut() 10 | } catch (err) { 11 | console.log(err) 12 | error.value = err.message 13 | } 14 | } 15 | 16 | const useLogout = () => { 17 | return {error, logout} 18 | } 19 | 20 | export default useLogout -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "firestore": { 3 | "rules": "firestore.rules", 4 | "indexes": "firestore.indexes.json" 5 | }, 6 | "hosting": { 7 | "public": "dist", 8 | "ignore": [ 9 | "firebase.json", 10 | "**/.*", 11 | "**/node_modules/**" 12 | ], 13 | "rewrites": [ 14 | { 15 | "source": "**", 16 | "destination": "/index.html" 17 | } 18 | ] 19 | }, 20 | "storage": { 21 | "rules": "storage.rules" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from "vue"; 2 | import App from "./App.vue"; 3 | import router from "./router"; 4 | import store from "./store"; 5 | import "./assets/main.css"; 6 | import 'bootstrap/dist/css/bootstrap.min.css' 7 | import 'jquery/src/jquery.js' 8 | import 'bootstrap/dist/js/bootstrap.min.js' 9 | 10 | import {projectAuth} from "@/firebase/config"; 11 | let app 12 | 13 | projectAuth.onAuthStateChanged(() => { 14 | if(!app) { 15 | app = createApp(App).use(router).use(store).mount('#app') 16 | } 17 | }) -------------------------------------------------------------------------------- /src/composables/addUsers.js: -------------------------------------------------------------------------------- 1 | import {ref} from "vue"; 2 | import {projectFirestore} from "@/firebase/config"; 3 | 4 | const addUsers = (collection) => { 5 | const error = ref(null) 6 | 7 | const addDoc = async (user) => { 8 | error.value = null 9 | 10 | try { 11 | await projectFirestore.collection(collection).doc(user.uid).set(user) 12 | } catch (err) { 13 | console.log(err.message) 14 | error.value = "Could not send message!!" 15 | } 16 | } 17 | 18 | return {error, addDoc} 19 | } 20 | 21 | export default addUsers -------------------------------------------------------------------------------- /src/composables/useCollection.js: -------------------------------------------------------------------------------- 1 | import {ref} from "vue"; 2 | import {projectFirestore} from "@/firebase/config"; 3 | 4 | const useCollection = (collection) => { 5 | const error = ref(null) 6 | 7 | const addDoc = async (doc) => { 8 | error.value = null 9 | 10 | try { 11 | await projectFirestore.collection(collection).add(doc) 12 | } catch (err) { 13 | console.log(err.message) 14 | error.value = "Could not send message!!" 15 | } 16 | } 17 | 18 | return {error, addDoc} 19 | } 20 | 21 | export default useCollection -------------------------------------------------------------------------------- /src/composables/useLogin.js: -------------------------------------------------------------------------------- 1 | import {ref} from "vue"; 2 | import {projectAuth} from "@/firebase/config"; 3 | 4 | const error = ref(null) 5 | 6 | const login = async (email, password) => { 7 | error.value = null 8 | try { 9 | const res = await projectAuth.signInWithEmailAndPassword(email, password) 10 | error.value = null 11 | return res 12 | } catch (err) { 13 | console.log(err.message) 14 | error.value = "Incorrect login credentials" 15 | } 16 | } 17 | 18 | const useLogin = () => { 19 | return {error, login} 20 | } 21 | 22 | export default useLogin -------------------------------------------------------------------------------- /src/assets/main.css: -------------------------------------------------------------------------------- 1 | #app { 2 | width: 100vw; 3 | margin: 0; 4 | padding: 0; 5 | } 6 | 7 | body { 8 | margin: 0; 9 | padding: 0; 10 | overflow-x: hidden; 11 | } 12 | 13 | html { 14 | scroll-behavior: smooth; 15 | } 16 | 17 | ::-webkit-scrollbar { 18 | width: 20px; 19 | } 20 | 21 | ::-webkit-scrollbar-track { 22 | background-color: black; 23 | } 24 | 25 | ::-webkit-scrollbar-thumb { 26 | background-color: #3770ff; 27 | border-radius: 20px; 28 | border: 6px solid transparent; 29 | background-clip: content-box; 30 | } 31 | 32 | ::-webkit-scrollbar-thumb:hover { 33 | background-color: #1e45a9; 34 | } -------------------------------------------------------------------------------- /src/assets/register.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Aperta Fons 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/composables/useSignInGoogle.js: -------------------------------------------------------------------------------- 1 | import firebase from "firebase/compat"; 2 | import {ref} from "vue"; 3 | 4 | const err = ref(null) 5 | const googleLogin = async () => { 6 | const provider = new firebase.auth.GoogleAuthProvider() 7 | await firebase.auth().signInWithPopup(provider).then((result) => { 8 | const credential = firebase.auth.GoogleAuthProvider.credentialFromResult(result); 9 | const token = credential.accessToken; 10 | const user = result.user; 11 | }).catch((err) => { 12 | err.value = err.message 13 | }) 14 | } 15 | 16 | const useSignInGoogle = () => { 17 | return {err, googleLogin} 18 | } 19 | 20 | export default useSignInGoogle -------------------------------------------------------------------------------- /src/composables/deleteDocuments.js: -------------------------------------------------------------------------------- 1 | import {ref} from "vue"; 2 | import {projectFirestore} from "@/firebase/config"; 3 | import getCollection from "@/composables/getCollection"; 4 | 5 | const deleteDocuments = async (n) => { 6 | const { err, documents } = getCollection("PriorityQueue") 7 | const colRef = await projectFirestore.collection("PriorityQueue") 8 | for(let i = 0; i < n && i < docs.value.length; i++) { 9 | const docRef = colRef.doc(docs[i].id) 10 | docRef.delete().then(() => { 11 | console.log(docRef + " deleted") 12 | }).catch((e) => { 13 | console.log(e.message) 14 | }) 15 | } 16 | console.log("finished deleting") 17 | } 18 | 19 | export default deleteDocuments -------------------------------------------------------------------------------- /src/composables/useSignup.js: -------------------------------------------------------------------------------- 1 | import {ref} from "vue"; 2 | import {projectAuth} from "@/firebase/config"; 3 | 4 | const error = ref(null) 5 | 6 | const signup = async (email, password, displayName) => { 7 | error.value = null 8 | try { 9 | const res = await projectAuth.createUserWithEmailAndPassword(email, password) 10 | if (!res) { 11 | throw new Error("Could not complete signup!!") 12 | } 13 | await res.user.updateProfile({ displayName }) 14 | error.value = null 15 | return res 16 | } catch (err) { 17 | console.log(err.message) 18 | error.value = err.message 19 | } 20 | } 21 | 22 | const useSignup = () => { 23 | return {error, signup} 24 | } 25 | 26 | export default useSignup -------------------------------------------------------------------------------- /src/firebase/config.js: -------------------------------------------------------------------------------- 1 | import firebase from "firebase/compat"; 2 | import 'firebase/firestore' 3 | import 'firebase/auth' 4 | import 'firebase/storage' 5 | 6 | const firebaseConfig = { 7 | apiKey: "AIzaSyDEq2tylwwCdLJgK2q8_yiDtUmMDEuWgo8", 8 | authDomain: "aperta-fons-bf53f.firebaseapp.com", 9 | projectId: "aperta-fons-bf53f", 10 | storageBucket: "aperta-fons-bf53f.appspot.com", 11 | messagingSenderId: "41948206133", 12 | appId: "1:41948206133:web:4165b8287fa4de746e4d7c" 13 | }; 14 | 15 | firebase.initializeApp(firebaseConfig) 16 | 17 | const projectFirestore = firebase.firestore() 18 | const projectAuth = firebase.auth() 19 | const projectStorage = firebase.storage() 20 | 21 | const timestamp = firebase.firestore.FieldValue.serverTimestamp 22 | 23 | export { projectFirestore, projectAuth, projectStorage, timestamp } -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 16 | -------------------------------------------------------------------------------- /src/views/Auth.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 32 | 33 | -------------------------------------------------------------------------------- /src/composables/getCollection.js: -------------------------------------------------------------------------------- 1 | import {ref, watchEffect} from "vue"; 2 | import {projectFirestore} from "@/firebase/config"; 3 | 4 | const getCollection = (collection) => { 5 | const documents = ref(null) 6 | const error = ref(null) 7 | 8 | let collectionRef = projectFirestore.collection(collection).orderBy("time") 9 | 10 | const unsub = collectionRef.onSnapshot((snap) => { 11 | let results = [] 12 | snap.docs.forEach(doc => { 13 | results.push({ ...doc.data(), id: doc.id, time_sec: doc.time }) 14 | }) 15 | documents.value = results.reverse() 16 | error.value = null 17 | }, (err) => { 18 | console.log(err.message) 19 | documents.value = null 20 | error.value = "could not fetch data" 21 | }) 22 | 23 | watchEffect((onInvalidate) => { 24 | onInvalidate(() => unsub()) 25 | }) 26 | 27 | return {error, documents} 28 | } 29 | 30 | export default getCollection -------------------------------------------------------------------------------- /src/components/Confetti.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 42 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aperta-fons", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build" 8 | }, 9 | "dependencies": { 10 | "@popperjs/core": "^2.10.1", 11 | "axios": "^0.21.4", 12 | "bootstrap": "^5.1.1", 13 | "canvas-confetti": "^1.9.2", 14 | "core-js": "^3.6.5", 15 | "date-fns": "^2.24.0", 16 | "firebase": "^9.0.2", 17 | "hover.css": "^2.3.2", 18 | "jquery": "^3.6.0", 19 | "particles.js": "^2.0.0", 20 | "popper": "^1.0.1", 21 | "vue": "^3.0.0", 22 | "vue-anchor-router-link": "^0.8.5", 23 | "vue-router": "^4.0.0-0", 24 | "vuex": "^4.0.0-0" 25 | }, 26 | "devDependencies": { 27 | "@types/canvas-confetti": "^1.6.4", 28 | "@vue/cli-plugin-babel": "~4.5.0", 29 | "@vue/cli-plugin-router": "~4.5.0", 30 | "@vue/cli-plugin-vuex": "~4.5.0", 31 | "@vue/cli-service": "~4.5.0", 32 | "@vue/compiler-sfc": "^3.0.0" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHistory } from 'vue-router' 2 | import Home from '../views/Home.vue' 3 | import Auth from "@/views/Auth"; 4 | import {projectAuth} from "@/firebase/config"; 5 | import Dashboard from "@/views/Dashboard"; 6 | import SubmitPR from "@/views/SubmitPR"; 7 | 8 | 9 | const requireAuth = (to, from, next) => { 10 | let user = projectAuth.currentUser 11 | if(!user) { 12 | next({path: "/auth"}) 13 | } 14 | else { 15 | next() 16 | } 17 | } 18 | 19 | const requireNoAuth = (to, from, next) => { 20 | let user = projectAuth.currentUser 21 | if(user) { 22 | next({path: "/dashboard"}) 23 | } 24 | else { 25 | next() 26 | } 27 | } 28 | 29 | const routes = [ 30 | { 31 | path: '/', 32 | name: 'Home', 33 | component: Home 34 | }, 35 | { 36 | path: '/auth', 37 | name: 'Auth', 38 | component: Auth, 39 | beforeEnter: requireNoAuth 40 | }, 41 | { 42 | path: '/dashboard', 43 | name: 'Dashboard', 44 | component: Dashboard, 45 | beforeEnter: requireAuth 46 | }, 47 | { 48 | path: '/submit', 49 | name: 'Submit', 50 | component: SubmitPR, 51 | beforeEnter: requireAuth 52 | } 53 | ] 54 | 55 | const router = createRouter({ 56 | history: createWebHistory(process.env.BASE_URL), 57 | routes 58 | }) 59 | 60 | export default router 61 | -------------------------------------------------------------------------------- /src/assets/discord.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/views/SubmitPR.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 51 | 52 | -------------------------------------------------------------------------------- /src/components/Nav.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 25 | 26 | -------------------------------------------------------------------------------- /src/components/Login.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 61 | 62 | -------------------------------------------------------------------------------- /src/components/Signup.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 74 | 75 | -------------------------------------------------------------------------------- /src/views/Dashboard.vue: -------------------------------------------------------------------------------- 1 | 64 | 65 | 66 | 67 | 146 | 147 | 331 | -------------------------------------------------------------------------------- /src/components/PreLoader.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 131 | 132 | -------------------------------------------------------------------------------- /src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 268 | 269 | 452 | 453 | 820 | --------------------------------------------------------------------------------