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

@digital-garden-builder/server

v0.0.8

Published

## Development

Downloads

4

Readme

API Server For Digital Garden Builder

Development

  • Setup env variables

These commands should be run from root of monorepo as yarn server dev most of the time:

  • Install
    • yarn
  • Start
    • yarn dev
  • Test
    • yarn test

Env Variables

  • Github API token
    • Github Personal Access Token
    • GITHUB_API_TOKEN
    • Should be created with repo:status and public_repo scopes only.
    • This is used as the access token for Github API when user is NOT logged in.
  • Github oAuth App
    • Create a Github app
    • GITHUB_ID
    • GITHUB_SECRET
    • It would be BETTER to use a Github app, not an oAuth app.
    • JOSH: Do that next(ish)!
  • Encryption and Decryption
    • ENCRYPT_KEY - Must be 32 charcters long.
    • Used to encrypt and decrypt the session details that are encoded in the JWT token.
  • JWT
    • JWT_SECRET_KEY
    • Right now, the JWT token is set in a cookie, _garden_token and it can be sent in the Authorization header of HTTP requests to the application.
    • The data property of the JWT should include:
      • name: The current user's display name.
      • session: Object with:
        • iv: The initialization vector used to encrypt the session.
        • content: The encrypted session content.

Notes On Security

So the user token can contain encrypted data. To decrypt that data you need the iv, which is transmitted with the encrypted data and you need the value of the environment varible ENCRYPT_KEY to decrypt the data.

That is a secret that is stored in encrypted environment variables. Also, only run this on HTTPS.

If the cookie is stolen, you could use it to update the same data that this app updates. But not gain access to other repos or worse. If the attacker decrypted the stolen data, they would get a Github access token. It has privaledges, for the repos the application is added to.

What It Is Built With