Giter VIP home page Giter VIP logo

saviour-eco's Introduction

SAViour-Eco

Progressive Web App to solve poverty,hunger and impact of climate change.

Introduction

This project uses google technologies like Firebase, Tensorflow , Google cloud , Google Map and Progressive web app

Cloning the Repository

To clone this repository, follow these steps:

Open your terminal/command prompt and navigate to the directory where you want to clone the repository.

Run the following command:

Once the repository has been cloned, navigate into the directory by running:

2 - cd SAViour-Eco

Install the necessary dependencies by running the following command:

3 - npm install

Start the development server by running:

4 - npm run dev

Now Website is running at http://localhost:3000/

Install the Firebase Package

After creating your React app, change directory to your project's root folder and install the Firebase package by running:

npm install firebase

Add Your React App to a Firebase Project

The next step is to create a Firebase project and link it with your React app. Go to the Firebase console:

  1. Click Add project to start a new Firebase project. image

2.Enter a project name, then click Continue. image

3.Click Continue on the next page. 4.Select your Firebase account from the dropdown or click Create a new account if you don't already have one. 5.Finally, click Create project.

image

6.Click Continue once the process completes. 7.Next, click the Web icon (</>) towards the top-left of the following page to set up Firebase for the web. image 8.Enter a nickname for your app in the provided field. Then click Register app. image 9. Copy the generated code and keep it for the following step (discussed in the following section). 10. Click Continue to the console. 11. There are many options on the following page. Scroll down and select Cloud Firestore since you only need to set up a database in this case. image 12.Next, click Create database. image 13. Click Next. Select your preferred Firestore location from the dropdown. 14. Then click Enable to create a Firestore database. image

#Initialize Firebase in Your React App Create a new folder inside your project src directory. You can call this firebase_setup. Next, create a firebase.js file inside that folder. Then paste the code generated earlier into this file. For example, to enter your app's Firebase secret key in the .env file:

REACT_APP_apiKey = yourFirebaseAccessKey

Thus, you can fine-tune the generated code as follows:

import { initializeApp } from "firebase/app";
import { getFirestore } from "@firebase/firestore"

const firebaseConfig = {
  apiKey: process.env.REACT_APP_apiKey,
  authDomain: process.env.REACT_APP_authDomain,
  projectId: process.env.REACT_APP_projectId,
  storageBucket: process.env.REACT_APP_storageBucket,
  messagingSenderId: process.env.REACT_APP_messagingSenderId,
  appId: process.env.REACT_APP_appId,
  measurementId: process.env.REACT_APP_measurementId
};

const app = initializeApp(firebaseConfig);
export const firestore = getFirestore(app)

Woah 🥳 Firebase is connected successfully.

saviour-eco's People

Contributors

rimjhim20 avatar amanpandey2101 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.