npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@groupbwt/kanban-board-firebase

v1.0.13

Published

This package helps you organize your Kanban board data using firebase.

Downloads

12

Readme

Kanban board firebase

This package helps you organize your Kanban board data using firebase.

Content

Installation

Using npm:

$ npm i @groupbwt/kanban-board-firebase

Note: add `--save', if you use npm <5.0.0

Example

First you need to create a project and an application firebase.

Initialization

Pass apiKey, authDomain, projectId in initializeApp.(Firebase config object)

// api.js
import { initializeApp } from "@groupbwt/kanban-board-firebase";

const { lane, card, db, app } = initializeApp({
    apiKey: FIREBASE.API_KEY,
    authDomain: FIREBASE.AUTH_DOMAIN,
    projectId: FIREBASE.PROJECT_ID
});

Now you can use lane and card as API.

Lane methods

| Method | Description | |----- | ---- | | get() | Get all columns and cards of this user.| | create() | Add a column.| | update() | Change column title.| | remove() | Delete column.| | move() | Change column position.|

lane.get()

Get all columns and cards of this user.

import { lane } from "./api";

const getAllLanes = async () => {
    try {
       // ...
       const lanes = await lane.get();
       // ...   
    } catch (e) {
      // ...
    }
}

lane.create()

Add a column.

import { lane } from "./api";

const createLane = async () => {
    try {
        // ...    
        const id = await lane.create({
            title: 'hello',
            ownerId: 'userId',
            pos: 222
        });
        // ...
    } catch (e) {
      // ...
    }
}

lane.update()

Change column title.

import { lane } from "./api";

const updateLane = async () => {
    try {
        // ...    
        await lane.update('laneId-1', {
            title: "hello world"
        });
        // ...
    } catch (e) {
      // ...
    }
}

lane.remove()

Delete column.

import { lane } from "./api";

const removeLane = async () => {
    try {
        // ...    
        await lane.remove('laneId-1');
        // ...
    } catch (e) {
      // ...
    }
}

lane.move()

Change column position.

import { lane } from "./api";

const dropLane = async () => {
    try {
        // ...    
        await lane.move({
            id: 'laneId-1',
            pos: 255
        });
        // ...
    } catch (e) {
      // ...
    }
}

Card methods

| Метод | Описание | |----- | ---- | | create() | Add a card.| | update() | Change card position.| | remove() | Delete card.| | move() | Change card position.|

card.create()

Add a card.

import { card } from "./api";

const createCard = async () => {
    try {
        // ...    
        const id = await card.create({
            laneId: 'laneId-1',
            data: {
                pos: 135,
                title: 'titleCard'
            }
        });
        // ...
    } catch (e) {
      // ...
    }
}

card.update()

Change card position.

import { card } from "./api";

const updateCard = async () => {
    try {
        // ...    
        await card.update({
            laneId: 'laneId-1',
            id: 'idCard-1',
            data: {
              title: 'newTitleCard'
            }
        });
        // ...
    } catch (e) {
      // ...
    }
}

card.remove()

Delete card.

import { card } from "./api";

const removeCard = async () => {
    try {
        // ...    
        await card.remove({
            laneId: 'laneId-1',
            id: 'idCard-1'        
        });
        // ...
    } catch (e) {
      // ...
    }
}

card.move()

Change card position.

import { card } from "./api";

const dropCard = async () => {
    try {
        // ...    
        await card.move({
              fromLaneId: 'laneId-1',
              toLaneId: 'laneId-2',
              id: 'idCard',
              posTo: 1539
        });
        // ...
    } catch (e) {
      // ...
    }
}

Authentication

The user information is saved locally in Firebase. It is not necessary to save the token. User will remain even after page refresh.

Registration

Password and login are required for registration.

import { signUp } from "@groupbwt/kanban-board-firebase";

const signUpUser = async () => {
    try {
       // ...
        const user = await signUp({
            email: '[email protected]', // user's email 
            password: '123456' // user's password   
        });
       // ...   
    } catch (e) {
      // ...
    }
}

Authorization

Password and login are required for authorization.

import { signIn } from "@groupbwt/kanban-board-firebase";

const signInUser = async () => {
    try {
       // ...
        const user = await signIn({
            email: '[email protected]', // user's email 
            password: '123456' // user's password   
        });
       // ...   
    } catch (e) {
      // ...
    }
}

To log out the user

import { signOut } from "@groupbwt/kanban-board-firebase";

const signOutUser = async () => {
    try {
       // ...
        await signOut();
       // ...   
    } catch (e) {
      // ...
    }
}

Subscription to user information updates

You can subscribe to user information updates.

React.js example
import { useEffect } from 'react';
import { onAuthChanged } from '@groupbwt/kanban-board-firebase';

const App = () => {
    //...
    useEffect(() => {
        const unsubscriber = onAuthChanged((user) => {
            if (user) {
                // User is signed in.
            } else {
                // No user is signed in.
            }
        });

        return () => unsubscriber();
    }, []);
    //...
}