Skip to content

Instantly share code, notes, and snippets.

View vaibhavgehani's full-sized avatar

Vaibhav Gehani vaibhavgehani

View GitHub Profile
import { createUserWithEmailAndPassword } from "firebase/auth";
import React, { useState } from "react";
import Button from 'react-bootstrap/Button';
import Form from 'react-bootstrap/Form';
import { useNavigate } from "react-router-dom";
import { auth, db } from '../firebase';
import { doc, setDoc, collection } from 'firebase/firestore';
function Register() {
const [username, setUsername] = useState();
const [password, setPassword] = useState();
import { createUserWithEmailAndPassword, signInWithEmailAndPassword } from "firebase/auth";
import React, { useState } from "react";
import Button from 'react-bootstrap/Button';
import Form from 'react-bootstrap/Form';
import { useNavigate } from "react-router-dom";
import { auth } from '../firebase';
function Login() {
const [username, setUsername] = useState();
const [password, setPassword] = useState();
const navigate = useNavigate();
import logo from './logo.svg';
import './App.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import {
BrowserRouter,
Routes, //replaces "Switch" used till v5
Route,
} from "react-router-dom";
import Register from './screens/Register';
import Home from './screens/Home';
import { initializeApp } from 'firebase/app';
import { initializeFirestore } from 'firebase/firestore'
import { getAuth } from "firebase/auth";
const firebaseConfig = {
apiKey: "<your_project_key>",
authDomain: "<your_project_key>",
projectId: "<your_project_key>",
storageBucket: "<your_project_key>",
messagingSenderId: "<your_project_key>",
const FCM = require('fcm-node');
// put your server key here
const serverKey = '<your-server-key>';
const fcm = new FCM(serverKey);
function sendNotificationToFirebase(message) {
return new Promise((resolve, reject) => {
fcm.send(message, (err, response) => {
$RNFirebaseAsStaticFramework = true
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false
production = ENV["PRODUCTION"] == "1"
target 'chatApp' do
const express = require("express");
const app = express();
const bodyParser = require('body-parser');
const admin = require('firebase-admin');
const serviceAccount = require("./serviceAccountKey.json");
var jsonParser = bodyParser.json()
app.use(bodyParser.urlencoded({
extended:true
}));
<template>
<ion-page>
<ion-header :translucent="true">
<ion-toolbar>
<ion-title >Camera Application</ion-title>
</ion-toolbar>
</ion-header>
<ion-content :fullscreen="true">
<div class="container">
import React from 'react';
import {
StyleSheet,
Text,
View,
AppState
} from 'react-native';
import { useEffect, useRef, useState } from 'react';
import React from 'react';
import {
StyleSheet,
Text,
View,
AppState
} from 'react-native';
import { useEffect, useRef, useState } from 'react';