# Firebase cloud Functions

<img src="https://docs.pixelstrap.net/laravel/taxido/assets/images/icons/cloudFirestore.png" alt="Firebase Icon" data-size="line">**Firebase Collection: Deploying Firebase Cloud Functions**

All necessary Firebase Cloud Functions are provided. Your task is to deploy them to your Firebase account. Ensure you have a Firebase account, project, and apps (iOS & Android) already set up.

**1. Setting up Node.js and the Firebase CLI**

For detailed instructions, refer to the official Firebase documentation: [Write, test, and deploy your first functions](https://firebase.google.com/docs/functions/get-started) in Cloud Functions for Firebase.

You’ll need Node.js and the Firebase CLI to write and deploy Cloud Functions.

To set up Node.js, download it from the official website: [Node.js download](https://nodejs.org/en/download/). After installing Node.js, proceed to install the Firebase CLI using the following command:

```html
npm install -g firebase-tools
```

If you’ve already installed Firebase tools, update to the latest version with:

```html
npm install -g firebase-tools@latest
```

These steps ensure you’re ready to write and deploy functions. If you encounter issues, consult the [Firebase documentation](https://firebase.google.com/docs/functions) for troubleshooting.

**2. Initializing Your Firebase Project**

To initialize your Firebase project, authenticate the Firebase CLI by running the following command. You’ll be prompted to log in to your Firebase account via your web browser:

```
firebase login
```

**3. Implementing Firebase Cloud Functions**

The complete source code for your Firebase Cloud Functions is provided. Follow these steps:

1. Extract the zip file `Order Tracking Firebase Function folder.zip`.
2. Update the following files with the necessary credentials:

`.firebaserc`: Add your Firestore Project ID.

With these steps, your credentials are properly configured.

**4. Deploy Your Firebase Functions**

Navigate to the `Order Tracking Firebase Function > functions` directory and run the following command to deploy your functions:

```html
firebase deploy --only functions
```

After deployment, visit your Firebase Console to verify that the functions have been deployed. You can view logs for each function, check their output, and monitor when they are triggered.
