Coder Social home page Coder Social logo

firestore's Introduction

ESP-IDF Component for Cloud Firestore

GitHub Build workflow status GitHub release GitHub issues GitHub top language License: MIT Twitter follow

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

To use this component you need ESP-IDF installed on your machine, see espressif getting started guide on how to do that natively or you can simply use PlatformIO.

How to use this component with PlatformIO:

  1. Install PlatformIO Extension for vscode
  2. Create a new project using ESP-IDF framework
  3. Under the root of the project create a new directory called components
  4. Clone this repo under the components directory
$ cd components
$ git clone https://github.com/kaizoku-oh/firestore.git
  1. To avoid exposing sensitive data in the code we'll store them in environment variables that'll be when building the project.

Add your WiFi SSID, WiFi password, Firebase project ID, Firebase API key as environment variables like the following:

Window (Powershell)

# Set local environment variables
> $env:WIFI_SSID = '"TYPE_YOUR_WIFI_SSID_HERE"'
> $env:WIFI_PASS = '"TYPE_YOUR_WIFI_PASSWORD_HERE"'
> $env:FIRESTORE_FIREBASE_PROJECT_ID = '"TYPE_YOUR_FIREBASE_PROJECT_ID_HERE"'
> $env:FIRESTORE_FIREBASE_API_KEY = '"TYPE_YOUR_FIREBASE_API_KEY_HERE"'

# OPTIONAL: To read and verify the values of the variables that you just set:
> Get-ChildItem Env:WIFI_SSID
> Get-ChildItem Env:WIFI_PASS
> Get-ChildItem Env:FIRESTORE_FIREBASE_PROJECT_ID
> Get-ChildItem Env:FIRESTORE_FIREBASE_API_KEY

Linux (Bash)

# Set local environment variables
$ export WIFI_SSID='"TYPE_YOUR_WIFI_SSID_HERE"'
$ export WIFI_PASS='"TYPE_YOUR_WIFI_PASS_HERE"'
$ export FIRESTORE_FIREBASE_PROJECT_ID='"TYPE_YOUR_FIREBASE_PROJECT_ID_HERE"'
$ export FIRESTORE_FIREBASE_API_KEY='"TYPE_YOUR_FIREBASE_PROJECT_ID_HERE"'

# OPTIONAL: To read and verify the values of the variables that you just set:
$ echo $WIFI_SSID
$ echo $WIFI_PASS
$ echo $FIRESTORE_FIREBASE_PROJECT_ID
$ echo $FIRESTORE_FIREBASE_API_KEY

Don't know where to get your Project ID and API key? Easy:

  • Open you firebase console
  • Go to Project settings
  • Scroll down to SDK setup and configuration
  • Select the Config option and you'll be presented with something like this:

From there you can copy your projectId and apiKey.

const firebaseConfig = {
  apiKey: "YOUR_FIRESTORE_FIREBASE_API_KEY",
  authDomain: "XXXXXXXXXXXXXXXXXXXXXXXX",
  databaseURL: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  projectId: "YOUR_FIRESTORE_FIREBASE_PROJECT_ID",
  storageBucket: "XXXXXXXXXXXXXXXXXXXXXXXX",
  messagingSenderId: "XXXXXXXXXXXXXX",
  appId: "XXXXXXXXXXXXXXXXXXXXXX"
};
  1. Finally you can build project, upload the firmware to the board and start a serial monitor all with a single combined command:
$ pio run --target upload --target monitor

TODO

  • Add contribution guide
  • Refactor code and remove repeated parts
  • Add doxygen comments
  • Add anonymous authentication
  • Add CI/CD
  • Add thread safety

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Resources

firestore's People

Contributors

kaizoku-oh avatar flynn91 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.