This repository provides a clean, structured template for building and deploying Cloud Functions for Firebase, focused on Google Cloud Platform integrations. It's designed to help developers jumpstart their Firebase projects by providing a set of pre-defined functions and configurations.
- Predefined Data Access Layers: Separate read and write operations for clarity and maintenance ease.
- Validation Layer: Includes basic validators to ensure data integrity.
- Configuration Management: Organized configuration files for managing environments and dependencies.
- Testing Setup: Pre-configured Jest setup for both unit and integration tests to ensure your code remains bug-free.
/FirebaseNodeTemplate
|-- /DataAccess
| |-- /Read
| | |-- getSomething.ts
| |-- /Write
| | |-- setSomething.ts
|-- /Validators
| |-- validateUid.ts
|-- /Configs
|-- /tests
| |-- /Integration
| | |-- sample.test.ts
| |-- /Unit
| | |-- validateUid.test.ts
|-- /Helpers
| |-- constants.ts
| |-- defaultApp.ts
|-- index.ts
|-- jest.config.js
|-- ts.config.json
|-- sKey.json
- Node.js installed (version 12 or above recommended).
- Firebase CLI installed.
- A Google Cloud account with billing enabled.
-
Clone the Repository
git clone https://github.com/yourusername/FirebaseNodeTemplate.git cd FirebaseNodeTemplate
-
Install Dependencies
npm install
-
Configure Firebase
- Replace
sKey.json
with your Firebase service account key file. - Modify
constants.ts
to include your specific configurations.
- Replace
To deploy your cloud functions to Firebase:
firebase deploy --only functions
We welcome contributions! If you would like to help make our Firebase template better, please follow our contribution guidelines.
To run the predefined tests:
npm run test
This project is licensed under the MIT License - see the LICENSE.md file for details.