Coder Social home page Coder Social logo

firetodo's Introduction

Firetodo

A simple todo list app illustrating the use of server-signed tokens.

How does it work?

Firetodo manages the todo lists of three users, Alice, Bob, and Carol. The data for each user is kept in Firebase under the root namespace underneath their respective usernames. There is a simple server process that mimics a server process that plugs into an existing user system. Rather than provision users into Firebase or use one of the auth services compatible with Firebase, the signed server tokens allows developers to use Firebase with their existing users.

The server signs the "login" requests given its representation of the users, as such:

  • Alice is the manager.
  • Bob and Carol are regular users.
  • Every other user is a guest.

The server process then signs the auth token with the Firebase secret for the namespace and returns this token to the client. The client then uses it in an auth() request to a Firebase reference.

The rules enforce the following semantics: managers can write to anyone's todo list, Alice and Bob can write to their respective lists, and anyone can write to Carol's list. When writing to Alice or Bob's lists, the from field has to match the authenticated user.

The variety in the rules are meant to illustrate the flexibility one has in creating Firebase security and validation rules.

Exercises for the reader

  1. Augment front-end to support an arbitrary number of users.
  2. Include support for different flows depending on if the user is a manager, regular user, or guest.
  3. Add real-time support for todo-completion, re-assignment, and commenting.

License

MIT

firetodo's People

Contributors

anantn avatar robertdimarco avatar mikelehen avatar

Watchers

James Cloos avatar Christopher Morrissey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.