This project was developed, using the following technologies:
These tools were essential for the development of the entire project.
- VS Code - Best IDE :)
- Git CZ - To make this repo Commitizen-friendly
- Git Flow - To improve organization between branches
- Insomnia - To manage and test api requisitions
- express
- eslint
- firebase-admin
- firebase-functions
To run this application, you'll need:
- Git - To use git commands
- Node.js v16.13.0 or higher - To run this project
- Yarn v1 or higher - To manage the project dependencies
After, from your command line:
$ git clone https://github.com/alexandre1921/firebase-example-api
$ yarn
Or
$ yarn install
Setup your .firebaserc
- set your default project
- in .firebaserc.example rename to .firebaserc
Setup your runtime variables to use as .env
- in .runtimeconfig.example.json and rename to .runtimeconfig.json
Setup service account to access firebase servers resources instead locally resources
- in .serviceaccount.example.json rename to .serviceaccount.json
$ yarn dev
i emulators: Starting emulators: auth, functions, firestore, pubsub
โ functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: database, hosting
โ functions: Using node@16 from host.
i firestore: Firestore Emulator logging to firestore-debug.log
i pubsub: Pub/Sub Emulator logging to pubsub-debug.log
i ui: Emulator UI logging to ui-debug.log
โ functions[userHelloWorld]: http function initialized (http://0.0.0.0:5001/firebase-example-api/us-central1/userHelloWorld).
โ functions[getUserByName]: http function initialized (http://0.0.0.0:5001/firebase-example-api/us-central1/getUserByName).
โ functions[welcomeNewUser]: firestore function initialized.
โ functions[adminHelloWorld]: http function initialized (http://0.0.0.0:5001/firebase-example-api/us-central1/adminHelloWorld).
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ All emulators ready! View status and logs at 0.0.0.0:4000 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Emulator โ Host:Port โ View in Emulator UI โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Authentication โ 0.0.0.0:9099 โ 0.0.0.0:4000/auth โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Functions โ 0.0.0.0:5000 โ 0.0.0.0:4000/functions โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Firestore โ 0.0.0.0:8080 โ 0.0.0.0:4000/firestore โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Pub/Sub โ 0.0.0.0:8085 โ n/a โ
โโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ
To test these routes and update documentation with new ones use Insomnia.