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

nor-app

v1.4.3

Published

Sendanor Hypermedia App Server

Downloads

18

Readme

nor-app -- Hypermedia App Server

nor-app provides a HTTP interface in to a nor-nopg database -- which provides noSQL features in a PostgreSQL database server.

Features

  • Web based UI to maintain document types with JSON Schema
  • Web interface to create, search, edit and delete documents
  • Maintains a hypermedia JSON REST API for the data

See also

  • nopg -- Shell scripting CLI for nor-nopg

Requirements

Development

  • Trello board: https://trello.com/b/MHiSILez

Install

Installing globally

Install nor-nopg:

npm install -g nor-nopg

Install nor-app:

npm install -g nor-app

Creating a database

Create a PostgreSQL database with these extensions:

CREATE EXTENSION plv8;
CREATE EXTENSION "uuid-ossp";
CREATE EXTENSION tcn;
CREATE EXTENSION moddatetime;

Set your database configurations into a PGCONFIG environment variable:

export PGCONFIG='postgres://app:password@localhost/app'

Setting name and port

Name your application (default name is nor-app):

export APPNAME='myapp'

You can also change your application port (default port is 3000):

export PORT='8080'

Initializing NoPG

nor-nopg init

Start the server

nor-app start

Check the logs at ~/.nor-app/logs/myapp/.

If there's any problems, just create an issue.

Create admin user

nor-app-useradd --email='[email protected]'

Write down the password, you need it to login :)

Installing as a dependency

You may want to use nor-app as a dependency instead of a global command.

Create a directory for your project and initialize NPM there:

mkdir myapp
cd myapp
npm init
npm install --save nor-nopg
npm install --save nor-app

...then edit scripts section in your ./package.json to look like this:

{
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "init": "nor-nopg init",
    "start": "nor-app start",
    "stop": "nor-app stop"
  }
}

After that, you can initialize the NoPg database with a command npm run init instead of nor-nopg init and start the server simply with a command npm start and stop it npm stop.

After installation

Open your browser at http://localhost:3000 and login

... and design your database in the browser...

... and access REST interface from: http://localhost:3000/api/

Troubleshooting

If something doesn't work, check log files at ~/.nor-app/logs/myapp/.

Testing API

We recommend using jsonview when working in Google Chrome.

Testing API with curl

We also have a curl wrapper ./tools/curl which makes it easier to work with our API.

Easiest way to get a cookie is from logged in session using Google Chrome's inspector.

Copy the value of connect.sid:

npm config set nor-app:curl_cookie 'connect.sid=your-value-here'

Then you can use the api:

./tools/curl http://localhost:3000/api/