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

eco-rewards-hub

v1.2.3

Published

Eco Rewards Hub

Downloads

26

Readme

Eco Rewards Hub

Travis codecov David

API to ingest and process passenger travel transactions and calculate eco rewards.

Installation

Node +12 and a MySQL compatible database are required. The Ubuntu set up is:

sudo apt-get install -y nodejs mariadb-server
# warning this will blank your root mysql password
sudo mysql -u root mysql -e "update user set authentication_string=password(''), plugin='mysql_native_password' where user='root'; flush privileges;"

Installing and running the service:

git clone [email protected]:EcoRewards/eco-rewards-hub.git
npm install --save eco-rewards-hub
npm run migrate
npm start

Running with pm2:

pm2 start ecosystem.config.js

CLI commands

There are some CLI commands to help get set up:

npm run cli -- create-scheme [name]
npm run cli -- create-organisation [name] [schemeId]
npm run cli -- create-group [name] [organisationId]
npm run cli -- create-user [name] [email] [password] [role]
npm run cli -- export-all-members

Functional requirements

The scope of the API is defined by a number of user stories in cucumber format.

See features.

Non-functional requirements

  • Swagger documentation
  • Secure API access
  • Continuous integration with automated tests

Decision log

| Date | Decision | Reasoning | | ---------- | -------- | --------- | | 2019-11-01 | Implement with node.js | Developers familiar with it, fast iteration speed | | 2019-11-01 | Use a MySQL compatible database | Developers familiar with it, widely used | | 2019-11-01 | Use AWS | It's convenient and widely used | | 2019-11-18 | Do not use docker | Unnecessary for a project this size | | 2019-11-18 | Make the code open-source | No need for private repository, cheaper tooling (Travis et al) | | 2019-11-18 | Use travis CI | It's free | | 2019-11-18 | Use cucumber to capture functional requirements | Track the evolution of requirements and use as a basis for functional tests | | 2019-11-18 | Use use Koa | Widely used and supports promises | | 2019-11-18 | Use db-migrate | Most widely used database migration tool | | 2019-11-18 | Do not use an ORM | Seems like overkill when there are so few models | | 2019-11-18 | Bcrypt passwords | Most secure, widely used method to salt passwords | | 2019-11-19 | Basic auth for API access | Simple, widely used and easy to implement | | 2019-11-21 | Swagger documentation | Comes with a slick UI and package to validate requests and responses | | 2019-11-21 | Link based API responses | Reduces duplication in API responses. See this post | | 2019-11-27 | Travis deployment | Simple, easy, as seen here | | 2019-11-27 | PM2 process management | Makes the travis deployment easier |

License

This software is licensed under GNU GPLv3.