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
import React from 'react'; | |
import { Link } from 'react-router-dom'; | |
import IPageProps from '../interfaces/page.interface'; | |
const SignUpPage: React.FunctionComponent<IPageProps> = props => { | |
return ( | |
<div> | |
<h1> SignUp Page - Unprotected</h1> | |
<Link to={`/`}> | |
<button>Back Home</button> |
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
import React from 'react'; | |
import { Link } from 'react-router-dom'; | |
import IPageProps from '../interfaces/page.interface'; | |
const CartPage: React.FunctionComponent<IPageProps> = props => { | |
return ( | |
<div> | |
<h1> Cart Page - Protected</h1> | |
<Link to={`/`}> | |
<button>Back Home</button> |
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
import React from 'react'; | |
import { Link } from 'react-router-dom'; | |
import IPageProps from '../interfaces/page.interface'; | |
const HomePage: React.FunctionComponent<IPageProps> = props => { | |
return ( | |
<div> | |
<h1> Home Page - Unprotected</h1> | |
<Link to={`/cart`}> | |
<button>View Cart</button> |
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
export default interface IPageProps { | |
name: string; | |
} |
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
import React from 'react'; | |
import { Link } from 'react-router-dom'; | |
interface IPageProps { | |
name: string; | |
} | |
const HomePage: React.FunctionComponent<IPageProps> = props => { | |
return ( | |
<div> | |
<h1> Home Page - Unprotected</h1> |
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
import firebase from 'firebase/app'; | |
import 'firebase/auth'; | |
import config from './config'; | |
const Firebase = firebase.initializeApp(config.firebase); | |
// Add or Remove authentification methods here. | |
export const Providers = { | |
google: new firebase.auth.GoogleAuthProvider(), | |
facebook: new firebase.auth.FacebookAuthProvider(), |
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
// Contains Global Configurations | |
const config = { | |
firebase: { | |
apiKey: process.env.REACT_APP_FIREBASE_KEY, | |
authDomain: process.env.REACT_APP_FIREBASE_DOMAIN, | |
databaseURL: process.env.REACT_APP_FIREBASE_DATABASE, | |
projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID, | |
storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET, | |
messagingSenderId: process.env.REACT_APP_FIREBASE_SENDER_ID, | |
appId: process.env.REACT_APP_FIREBASE_APP_ID, |
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
## Firebase Credentials | |
REACT_APP_FIREBASE_KEY="" | |
REACT_APP_FIREBASE_DOMAIN="" | |
REACT_APP_FIREBASE_DATABASE="" | |
REACT_APP_FIREBASE_PROJECT_ID="" | |
REACT_APP_FIREBASE_STORAGE_BUCKET="" | |
REACT_APP_FIREBASE_SENDER_ID="" | |
REACT_APP_FIREBASE_APP_ID="" | |
REACT_APP_FIREBASE_MEASUREMENT_ID="" |
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
const { buildSchema } = require('graphql'); | |
export default buildSchema(` | |
type Product{ | |
_id:ID! | |
name: String! | |
description: StriWng! | |
price: Float! | |
discount: Int | |
created_at: String! |
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
const Product = require('../models/product'); | |
module.exports = { | |
/** | |
* CREATE PRODUCT - | |
* @param { name, description, price, discount} ProductInput | |
* @returns Product | |
* | |
* @mutation | |
* mutation { |