Skip to content

Commit

Permalink
feat: refactor configs onboarding for project
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabanai104 committed May 26, 2024
1 parent dadfa3c commit 0d8fe03
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 9 deletions.
Binary file added .DS_Store
Binary file not shown.
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ build/Release
node_modules/
jspm_packages/

# Firebase config
src/config/firebaseConfig.js
src/config/firebaseConfig-dev.js
src/config/firebaseAuthConfig.js

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
Expand Down Expand Up @@ -125,4 +121,6 @@ package-lock.json
# Arquivo de configuração de backup remoto
rclone.conf

miaajuda.pem
miaajuda.pem

.idea
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.10.0
6 changes: 2 additions & 4 deletions src/config/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const UserSeed = require('../utils/seed/UserSeed');
const HelpSeed = require('../utils/seed/HelpOfferCampaignSeed');
const NotificationSeed = require('../utils/seed/NotificationSeed');

Check failure on line 5 in src/config/database.js

View workflow job for this annotation

GitHub Actions / build-test

'NotificationSeed' is assigned a value but never used

Check failure on line 5 in src/config/database.js

View workflow job for this annotation

GitHub Actions / build-test

'NotificationSeed' is assigned a value but never used
const BadgeSeed = require('../utils/seed/BadgeTemplateSeed');

Check failure on line 6 in src/config/database.js

View workflow job for this annotation

GitHub Actions / build-test

'BadgeSeed' is assigned a value but never used

Check failure on line 6 in src/config/database.js

View workflow job for this annotation

GitHub Actions / build-test

'BadgeSeed' is assigned a value but never used
const TimelineEventTemplateSeed = require('../utils/seed/TimelineEventTemplateSeed');

const databaseURL = process.env.DATABASE_URL || 'mongodb://mongo:27017/miaAjudaDB';
const envType = process.env.NODE_ENV || 'development';
Expand All @@ -23,9 +22,8 @@ const databaseConnect = async () => {
if (envType === 'development') {
await UserSeed();
await HelpSeed();
await NotificationSeed();
await BadgeSeed();
await TimelineEventTemplateSeed();
// await NotificationSeed();
// await BadgeSeed();
}
} catch (err) {
console.log('Não foi possível inicicializar corretamente a base de dados!');
Expand Down
19 changes: 19 additions & 0 deletions src/config/firebaseAuthConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const config = {
type: 'service_account',
project_id: 'miaajudadev',
private_key_id: process.env.FIREBASE_AUTH_CONFIG_PRIVATE_KEY_ID,
private_key: process.env.FIREBASE_AUTH_CONFIG_PRIVATE_KEY,
client_email: '[email protected]',
client_id: '105126767310578944074',
auth_uri: 'https://accounts.google.com/o/oauth2/auth',
token_uri: 'https://oauth2.googleapis.com/token',
auth_provider_x509_cert_url: 'https://www.googleapis.com/oauth2/v1/certs',
client_x509_cert_url: 'https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-1djmt%40miaajudadev.iam.gserviceaccount.com',
};

const databaseURL = 'https://miaajudadev.firebaseio.com';

module.exports = {
config,
databaseURL,
};
21 changes: 21 additions & 0 deletions src/config/firebaseConfig-dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const config = {
type: 'service_account',
project_id: 'miaajudadev',
private_key_id: process.env.FIREBASE_CONFIG_DEV_PRIVATE_KEY_ID,
private_key: process.env.FIREBASE_CONFIG_DEV_PRIVATE_KEY,
client_email: '[email protected]',
client_id: '105126767310578944074',
auth_uri: 'https://accounts.google.com/o/oauth2/auth',
token_uri: 'https://oauth2.googleapis.com/token',
auth_provider_x509_cert_url: 'https://www.googleapis.com/oauth2/v1/certs',
client_x509_cert_url: 'https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-1djmt%40miaajudadev.iam.gserviceaccount.com',
};


const databaseURL = 'https://miaajudadev.firebaseio.com';


module.exports = {
config,
databaseURL,
};
19 changes: 19 additions & 0 deletions src/config/firebaseConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const config = {
type: 'service_account',
project_id: 'miaajuda-1b205',
private_key_id: process.env.FIREBASE_CONFIG_PRIVATE_KEY_ID,
private_key: process.env.FIREBASE_CONFIG_PRIVATE_KEY,
client_email: '[email protected]',
client_id: '103236107628512014144',
auth_uri: 'https://accounts.google.com/o/oauth2/auth',
token_uri: 'https://oauth2.googleapis.com/token',
auth_provider_x509_cert_url: 'https://www.googleapis.com/oauth2/v1/certs',
client_x509_cert_url: 'https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-ee658%40miaajuda-1b205.iam.gserviceaccount.com',
};

const databaseURL = 'https://miaajuda-1b205.firebaseio.com';

module.exports = {
config,
databaseURL,
};

0 comments on commit 0d8fe03

Please sign in to comment.