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

jsonapi-express-backend

v0.5.38

Published

JSONAPI backend based on Express and MySQL

Downloads

17

Readme

JSONAPI Express.js / MySQL backend

Live demo

A simple blog app: https://ember-blog.info/about. It still has many bugs (like: no redirection after login) but should work. Feedback is welcome.

Backend code for this demo app is here, frontend code is here.

Fair bit of warning

This is work in progress, and not production-ready (yet). That being said, it does the job, for me at least :).

Please don't hesitate to contact me if you run into issues while giving this project a try. As I am currently working on it heavily, I will definitely answer your request. Besides, documentation is on its way, a user guide will be provided soon.

About this project

This project began as a standalone Express app, that I just started turning into an NPM module.

The motivation for it is to have a simple-to-use backend for Ember.js.

An example project is available at https://github.com/bhubr/jsonapi-express-backend-demo. It demonstrates how to configure the module by providing those parameters:

  • public&private keys path
  • db settings
  • model relationships descriptors

Install

npm install --save jsonapi-express-backend

Features

  • MySQL support. Works with MariaDB (actually only tested on MariaDB). More (PostgreSQL) might come after.
  • Dead-simple. No ORM, but simple query-building using Squel.
  • Uses JSON Web Tokens for authentication.
  • Supports one-to-one, one-to-many, many-to-many model relationships.

Limitations

  • As of now, you have to create your MySQL schema by hand. It has to respect some conventions as to table and field naming:
    • primary key for all tables is id
    • each data type (that is, all tables but the pivot tables) must have createdAt and updatedAt fields.

Naming conventions

  • Model / table names
    • model: super-duper-model (Ember)
    • plural: super-duper-models ** (Ember, Backend)
    • singular: superDuperModel (Backend)
    • plural: superDuperModels (??)
    • table: super_duper_models (Backend)
  • Beware of inflection
    • niceCity => niceCities