text: require("dotenv").config({
    path: `.env`,
  });
  
  
  module.exports = {
    siteMetadata: {
      title: `Sanjivani`,
      description: `Sanjivani App`,
      author: `@`,
    },
    plugins: [
      `gatsby-plugin-react-helmet`,
      {
        resolve: `gatsby-source-filesystem`,
        options: {
          name: `images`,
          path: `${__dirname}/src/images`,
        },
      },
      `gatsby-transformer-sharp`,
      `gatsby-plugin-sharp`,
      {
        resolve: `gatsby-plugin-manifest`,
        options: {
          name: `sanjivani`,
          short_name: `sanjivani`,
          start_url: `/`,
          background_color: `#663399`,
          theme_color: `#663399`,
          display: `minimal-ui`,
          icon: `src/images/logo-2.png`,
          // icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
        },
      },
      // this (optional) plugin enables Progressive Web App + Offline functionality
      // To learn more, visit: https://gatsby.dev/offline
      // `gatsby-plugin-offline`,
      {
        resolve: `gatsby-plugin-typography`,
        options: {
          pathToConfigModule: `src/utils/typography`,
        },
      },
      {
        resolve: `gatsby-source-firestore`,
        options: {
            // credential or appConfig
          //  credential: require(`./credentials.json`),
          credential: {
              type: `service_account`,
              project_id: process.env.GATSBY_FIREBASE_PROJECT_ID,
              private_key_id: process.env.REACT_APP_FIREBASE_PRIVATE_KEY_ID,
              private_key: process.env.REACT_APP_FIREBASE_PRIVATE_KEY.replace(/\\n/g, '\n'),
              client_email: process.env.REACT_APP_FIREBASE_CLIENT_EMAIL,
              client_id: process.env.REACT_APP_FIREBASE_CLIENT_ID,
              auth_uri: process.env.REACT_APP_FIREBASE_AUTH_URI,
              token_uri: process.env.REACT_APP_FIREBASE_TOKEN_URI,
              auth_provider_x509_cert_url: process.env.REACT_APP_FIREBASE_AUTH_PROVIDER_URL,
              client_x509_cert_url: process.env.REACT_APP_FIREBASE_CLIENT_CERT_URL
           },
           types: [
              {
                  type: `Symptom`,
                  collection: `symptoms`,
                  map: doc => ({
                    name: doc.name,
                    description: doc.description,
                  }),
              },
              {
                  type: `Disease`,
                  collection: `diseases`,
                  map: doc => ({
                    name: doc.name,
                    description: doc.description,
                  }),
              },
              {
                  type: `Plant`,
                  collection: `plants`,
                  map: doc => ({
                    name: doc.name,
                    diseases___NODE: doc.diseases.map(disease => disease.id),
                    symptoms___NODE: doc.symptoms.map(symptom => symptom.id),
                  }),
              },
              {
                  type: `Diagnostic`,
                  collection: `diagnostics`,
                  map: doc => ({
                    date: doc.date,
                    comments: doc.comments,
                    patient___NODE: doc.patient,
                    plants___NODE: doc.plants.map(plant => plant.id),
                    diseases___NODE: doc.diseases.map(disease => disease.id),
                    symptoms___NODE: doc.symptoms.map(symptom => symptom.id),
                  }),
              },
              {
                  type: `Patient`,
                  collection: `patients`,
                  map: doc => ({
                    name: doc.name,
                    lastName: doc.lastName,
                    address: doc.address,
                    city: doc.city,
                    country: doc.country,
                    zipcode: doc.zipcode,
                    phone: doc.phone,
                    email: doc.email,
                    diagnostics___NODE: doc.diagnostics.map(diagnostic => diagnostic.id),
                  }),
              },
           ],
        },
      },
    ],
  }
  