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

vue-firevase

v0.0.2

Published

Smart way to integrate Vue and Firebase that skips most bureaucracy. It automatically generates relations between your firebase resources such as firestore entries and files, all base don a simple configuration file.

Downloads

21

Readme

Firevase 🚀🌸

Welcome to Firevase, the coolest way to make Vue and Firebase get along like peanut butter and jelly! 🍞+🍓

What the Heck is Firevase?

Firevase is your new best friend for integrating Vue and Firebase without all the boring setup. Here's the awesome stuff you can do:

  • 📁 Firestore and Storage Integration: Because juggling databases shouldn't be a circus act.
  • 🔄 Automatic Relation Management: Set up your data relationships once and let Firevase handle the rest. No more micromanaging!
  • Easy Peasy Syncing: Sync your Vue variables with Firestore entries with a single line of code. Yes, it's that simple.
  • 🏗️ Object-Oriented Firestore: Forget the Firebase jargon. Firevase speaks Vue so you can focus on building.
  • 📦 Storage Associations: Link Firestore entries with storage entries like a pro.

The Secret Sauce: Resources

In Firevase, a "resource" is an entry in your Firestore. When you create your Firevase client using the fillFirevase method, you define your resource names and types. You can also set up one-to-many and many-to-many relationships and associate resources with storage entries. It's like playing matchmaker for your data!

How to Set Up Your Firevase Client

Check out this example to get started:

import { fillFirevase } from 'firevase'
import { firebaseApp } from './firebase'
import { Guild } from './guilds'
import { Notification } from './notifications'
import { Player } from './players'
import { Adventure } from './adventures'
import { Feedback } from './feedback'

/** Firevase client for your project */
export const vase = fillFirevase<{
  guilds: Guild
  players: Player
  notifications: Notification
  adventures: Adventure
  feedback: Feedback
}>(firebaseApp, [
  'guilds',
  'players',
  'notifications',
  'adventures',
  'feedback',
])
  /** Adds the banner property to adventures, automatically associating it to a storage entry */
  .configureFiles({ adventures: ['banner'] as ['banner'] })

  /** Define many-to-many tables for relations */
  .configureManyToMany({
    playersGuilds: ['guilds', 'players'],
    guildAdmissionRequests: ['guilds', 'players'],
    playersAdventures: ['adventures', 'players'],
    narratorsAdventures: ['adventures', 'players'],
    adventureAdmissionRequests: ['adventures', 'players'],
  })

  .configureRelations(({ hasMany, hasOne }) => ({
    guilds: {
      // When we use hasMany with the "relationKey" associator, it sets up a one-to-many relation
      adventures: hasMany('adventures', { relationKey: 'guildId' }),
      owner: hasOne('players', { relationKey: 'ownerUid' }, 'protected'),
      // When we use hasMany with the "manyToManyTable" associator, it sets up a many-to-many relation
      players: hasMany('players', { manyToManyTable: 'playersGuilds' }),
      admissionRequests: hasMany('players', {
        manyToManyTable: 'guildAdmissionRequests',
      }),
    },

    players: {
      notifications: hasMany('notifications', { relationKey: 'playerId' }),
      ownedGuilds: hasMany('guilds', { relationKey: 'ownerUid' }),
      guilds: hasMany('guilds', { manyToManyTable: 'playersGuilds' }),
      guildAdmissionRequests: hasMany('guilds', {
        manyToManyTable: 'guildAdmissionRequests',
      }),
      narratorAdventures: hasMany('adventures', {
        manyToManyTable: 'narratorsAdventures',
      }),
      playerAdventures: hasMany('adventures', {
        manyToManyTable: 'playersAdventures',
      }),
      adventureAdmissionRequests: hasMany('adventures', {
        manyToManyTable: 'adventureAdmissionRequests',
      }),
    },

    adventures: {
      guild: hasOne('guilds', { relationKey: 'guildId' }, 'protected'),
      players: hasMany('players', { manyToManyTable: 'playersAdventures' }),
      narrators: hasMany('players', { manyToManyTable: 'narratorsAdventures' }),
      admissionRequests: hasMany('players', {
        manyToManyTable: 'adventureAdmissionRequests',
      }),
    },
  }))

/** Firevase client type */
export type Vase = typeof vase

Dependencies and Contributions

Firevase is open source and runs on Firebase and Vue. It's maintained whenever inspiration strikes. 🧠💡

Got problems? Got solutions? Feel free to open issues or even better, pull requests. Your contributions make the world a better place! 🌍✨

Now go forth and build amazing things with Firevase! 🎉