Skip to content

Deploy to firebase #49

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
38 changes: 38 additions & 0 deletions .firebase/hosting.ZGlzdC9uZXctcmR2LWFwcA.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
197.c0e4561aaa90c0ab.js,1659211507496,952e5a3bdf234f77c53b45bb24153775f87e72d5b70def29db0dde1e56efcaaf
36.d276df0e0eded5bd.js,1659211507512,74cd6f194ad27e0bc81ea213e7091c6e53fb77c287c77225a162633792432d7d
3rdpartylicenses.txt,1659211507512,3fa5c189fea1ae80b9a14f0e2a39caadae6fcaacb1caee47bae0111246ec7217
698.ea4689e700ad3983.js,1659211507496,540d12851c555425018813cbcae5444f9d57335b881ea82210791ca35a12da0e
781.27f423e7159fd21e.js,1659211507496,a726bc29e307a37e3eee1e474f0516a2786ba907f628267ea4477c81f4979442
642.4e99a89c86033bb7.js,1659211507496,5ff26c76715347df96bfeeb45debd7e207a5e651359da07e5834459255be1d82
865.0c5ee2805ad12526.js,1659211507496,3814d1870c87105e877a3d3b25fe2942d2379f07e24292bcb1936d58648e3204
favicon.ico,1659211519672,5ba04cf43d3c8c026bd5edd43046db96acb28b5686d99ea7d7e148feabfffc8f
common.8526cc0c86c704ea.js,1659211507512,2d4861bd71e9f0c0e4dcbb1f6808c9857f9bb57538a36e00854acaf46895afa3
index.html,1659211523068,dee09a4d0120ab47a2f8efa2b66c1685b8a2fda5c5a795488c06b6a63abaf90a
manifest.webmanifest,1659211520188,6226e6ad8d33d39826e315e03622a1dbc02f29399298581c4580ea600ede039e
ngsw.json,1659211523476,90c4d8d4756c22ea0f1069882fdef3ce4792a202a1af9e698512a22689c975f8
runtime.869b1e9db9bbb236.js,1659211507496,59d82e1f5155f4d42b791759b42ec1fd86b806482a7aa46026d54af704a3de47
safety-worker.js,1659211523524,288dc60f516ea1b07726fb346c28f079c2958980147a397887c0e3f68bc225e9
polyfills.4caae9b68dd9bdc3.js,1659211507496,7aafbb699003f3e3e43451c8a34be3401f864e9da19406a4d4c22440d0bb83a5
worker-basic.min.js,1659211523524,288dc60f516ea1b07726fb346c28f079c2958980147a397887c0e3f68bc225e9
assets/unknown-profile-picture.jpg,1659211520176,dc8f625380083c6958768032541a0823fa6697138df74dbed0d5e43c4ce2790a
assets/i18n/fr.json,1659211520108,8980051ff21410ca5c323a6ac1bed46d7d99a3ad36c67be768f5e95bf861f13d
assets/icons/icon-128x128.png,1659211520128,9383deaaf0367604045fa24cddc3e4af5100edea6456d2a3b386e026cdc37bd7
assets/icons/icon-144x144.png,1659211520132,58210cb1519151a224a3b1661453ce8cc854dc3f5d555935b0eebd8d09e972b7
assets/icons/icon-152x152.png,1659211520136,96c7948119dc4bad59f77551a7034b05cf77fb0faf7b652282b136cd2d7323d6
assets/icons/icon-192x192.png,1659211520136,1325ccc5f3942574427b6deeccd21adf6dbf0401aa322dd773da3973d5f11bed
assets/rendezvous-icon.svg,1659211520164,46df56d01d4d8a06938c3b344ccafdab31cacda9191c0aef02474c0f78dd4210
assets/icons/icon-512x512.png,1659211520140,0d63b9844a642c66db2befc1af125aa1381d9b938611defaf1b8006fac1e0292
assets/icons/icon-72x72.png,1659211520148,bb57e2f17b24f708cb44dc9f33478a2f1c72ed772eab00f552de97df863d3e98
assets/icons/icon-96x96.png,1659211520152,1b57c2c67699bf4d6334e78f6fcdee30308a3c7533a2a03e41051530227491dc
assets/i18n/ar.json,1659211520088,eba450c0042c80e9adc7771523fa28f5c8bf0f93f0c7cd4f0880eccb14c138a7
assets/icons/icon-384x384.png,1659211520136,7f3a3d434fc28a6eeaa4528cb386d70f43212f96f685721e40c621704486ecb1
assets/i18n/en.json,1659211520108,8b31d3719384595081285c0ebeed4f122db4cf3f7cc0790d9ffe4bdf8e52e3b8
ngsw-worker.js,1659211523496,95aa339f506b3c6d84c700a6de996345fd360806ae7dbea06725539635978026
284.5dcededf0ec24088.js,1659211507496,9e2d9bd834b0e27fe99c831c64a54b9cd4c2faf0f28bf8b2ff49b0b7d9224afe
flags.f73aa829a0084837.png,1659211507496,bcbd377d960d005bb9b9d89470bea0eec05d288897585224f418456f89918b69
styles.ff2ad5a230020d07.css,1659211507496,c6bce9e6318e9c8ad790e79ee7bd569d7263777a88b6eac8b3c8571620b96314
552.9445d6a47ea2b9ac.js,1659211507496,eb8f89182981ee0d3cf7b34a1dbb35614cb5f23ab92b6fc21c08b957980a8957
[email protected],1659211507492,d1b8da85ae14d4d345088dea7068adf916624961ec965fdd92d9e02bebab6ee6
scripts.08446f2a65ddccd4.js,1659211507496,ec449660b7eab6265bc62f0071ab2ff39cabc503374f4e4e593a804b30c4e7d3
main.d84174b71181947f.js,1659211507496,4aff94127d28437e24c396fa71e14a83c8ebbe6d2afec15813e1a25a123b93ba
469.9b8970333e7ad9a6.js,1659211507496,6f66b20bc50efe799e515a9a9cdca8d117d65235fb9ece80db2f360728210bac
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "ngauth-d9be6"
}
}
20 changes: 20 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_NGAUTH_D9BE6 }}'
channelId: live
projectId: ngauth-d9be6
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# NewRdvApp

You can check out the application here: https://ngauth-d9be6.web.app/

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.0.1.

## Development server
Expand Down
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
{
"type": "initial",
"maximumWarning": "1.7mb",
"maximumError": "1.7mb"
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
Expand Down
23 changes: 23 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"firestore": {
"rules": "security-rules.js",
"indexes": "firestore.indexes.json"
},
"hosting": {
"public": "dist/new-rdv-app",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"storage": {
"rules": "storage.rules"
}
}
69 changes: 69 additions & 0 deletions firestore.indexes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"indexes": [
{
"collectionGroup": "Rendezvous",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "createdBy",
"order": "ASCENDING"
},
{
"fieldPath": "rdvState",
"order": "ASCENDING"
},
{
"fieldPath": "createdAt",
"order": "ASCENDING"
}
]
},
{
"collectionGroup": "Rendezvous",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "createdBy",
"order": "ASCENDING"
},
{
"fieldPath": "rdvState",
"order": "ASCENDING"
},
{
"fieldPath": "rdvDate",
"order": "ASCENDING"
}
]
},
{
"collectionGroup": "Rendezvous",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "rdvState",
"order": "ASCENDING"
},
{
"fieldPath": "createdAt",
"order": "ASCENDING"
}
]
},
{
"collectionGroup": "Rendezvous",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "rdvState",
"order": "ASCENDING"
},
{
"fieldPath": "rdvDate",
"order": "ASCENDING"
}
]
}
],
"fieldOverrides": []
}
40 changes: 40 additions & 0 deletions security-rules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// declare users functions
function isAuth() {
return request.auth != null;
}
function getUserDoc() {
return get(/databases/$(database)/documents/profiles/$(request.auth.uid)).data
}
function isAdmin() {
return getUserDoc().role == 'ADMIN'
}
function isProfileOwner(id) {
return request.auth.uid == id;
}
// declare rendezvous functions
function getRdvDoc(id) {
return get(/databases/$(database)/documents/Rendezvous/$(id)).data
}
function isRdvOwner(id) {
return getRdvDoc(id).createdBy == getUserDoc().email
}

// rules
match /{document=**} {
allow read, write: if false;
}

match /profiles/{userId} {
allow create: if true;
allow read, update, delete: if isAuth() && (isProfileOwner(userId) || isAdmin())
}

match /Rendezvous/{rdvId} {
allow create, read: if isAuth();
allow update, delete: if isAuth() && (isRdvOwner(rdvId) || isAdmin())
}
}
}
8 changes: 8 additions & 0 deletions storage.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth!=null;
}
}
}