Skip to content

Alireza-Valizadeh/NodejsFirebaseBoilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firebase Node.js Cloud Functions Template

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.

Features

  • 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.

Project Structure

/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

Getting Started

Prerequisites

  • Node.js installed (version 12 or above recommended).
  • Firebase CLI installed.
  • A Google Cloud account with billing enabled.

Setup

  1. Clone the Repository

    git clone https://github.com/yourusername/FirebaseNodeTemplate.git
    cd FirebaseNodeTemplate
    
  2. Install Dependencies

    npm install
    
  3. Configure Firebase

    • Replace sKey.json with your Firebase service account key file.
    • Modify constants.ts to include your specific configurations.

Deployment

To deploy your cloud functions to Firebase:

firebase deploy --only functions

How to Contribute

We welcome contributions! If you would like to help make our Firebase template better, please follow our contribution guidelines.

Running Tests

To run the predefined tests:

npm run test

License

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

About

A clean template for google cloud functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published