Giter Club home page Giter Club logo

matter's Introduction

Matter

npm version npm downloads build status dependencies status codeclimate coverage license

What are the minimal tools I need to make an app matter?

Matter is a Javascript library that provides common web application functionality such as user authentication and local/session/token storage. This library is built to communicate with a Tessellate Server such as Tessellate for application data, but custom server setups are on the roadmap.

Matter is Isomorphic, which means it will work well in both Browser and NodeJS environments. ES6 functionality is also available through importing and/or extending Matter (more details below).

Quick Start

Using Matter requires having created an application on devshare, Tessellate or on your own Tessellate server.

ES6

  1. Run npm install --save kyper-matter
  2. Import Matter library
import Matter from 'kyper-matter';
  1. Create a new matter application object:
//New matter object with the application name 'exampleApp'
let matter = new Matter('exampleApp');
//Login to account with username "test" and password "test"
matter.login({username:"test", password:"test"}).then((user) => {
  console.log('User logged into exampleApp:', user);
}, (err) => {
  console.error('Error logging in:', err);
});
  1. Use Matter methods

NodeJS

  1. Run npm install --save kyper-matter
  2. Import Matter library
var Matter = require('kyper-matter');
  1. Create a new matter application object:
//New matter object with the application name 'exampleApp'
var matter = new Matter('exampleApp');
//Login to account with username "test" and password "test"
matter.login({username:"test", password:"test"}).then(function(user) {
  console.log('User logged into exampleApp:', user);
}, function(err) {
  console.error('Error logging in:', err);
});

Browser

  1. Include the Matter library using one of the following:
#### CDN

To use the CDN, add the following script tag to your `index.html`:

  ```html
  <!-- Matter Library Bundle -->
  <script src="http://cdn.kyper.io/js/matter/latest/matter.js"></script>
  ```
#### Bower
Run `bower install --save kyper-matter`
  1. Start using Matter by providing the name of the app you created on Build or Tessellate: javascript //New Matter object with the application name 'exampleApp' var matter = new Matter('exampleApp');
  2. Start using Matter:
//Login to account with username "test" and password "test"
matter.login({username:"test", password:"test"}).then(function(user){
    console.log('User logged into exampleApp:', user);
});

Options

When creating a new matter object, you can provide an options object as the second argument:

//New matter object with the application name 'exampleApp'
var optionsObj = {
  localServer: false,
  logLevel: 'trace'
}
var matter = new Matter('exampleApp', optionsObj);

Availble options:

  • logLevel - Level of logging (error, warn, info, debug, or trace)
  • localServer - Boolean of whether or not to use local tessellate server

Docs

More Information

Matter is a javascript library that provides common web application functionality such as user authentication and local/session/token storage. In order to build applications quickly, Matter uses Tessellate to store and manage application data.

Application Data

Matter communicates with Tessellate for users, auth groups, and other application data. This means that you must have an application on Tessellate or on your own Tessellate server in order for you to be able to control the groups.

Features

  • Login/Logout/Signup
  • Authentication Groups
  • Secure Auth State Persistence (jwt token + cookies)
  • Session Management/Storage
  • Authenticated request utility
  • Logger utility

Diagram Coming Soon

Examples

Browser/Javascript

React

Angular

Test

Tests are located in test folder and can be run via gulp test or gulp coverage commands.

index.html has been added as a bare bones test page similar to browser example (`/examples/browser/index.html).

matter's People

Contributors

prescottprue avatar mvanlonden avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

prescottprue

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.