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

maker-checker-cli-edubanc

v1.0.1

Published

A component library for maker-checker operations with easy to reuse components for your project

Downloads

3

Readme

Maker-Checker Functionality

This project implements the maker-checker functionality, allowing users to create requests which are then approved or denied by designated approvers.

Stack

This project is built using the following technologies:

  • Express.js: A minimalist web framework for Node.js.
  • TypeScript: A statically typed superset of JavaScript.
  • Prisma: A modern database toolkit for TypeScript and Node.js.
# Setup Instructions

## Environment Configuration

1. Create a `.env` file in the root directory of your project.

2. Add the following environment variables to the `.env` file:

DATABASE_URL="postgres://makerchecker:XcembodjTv3ZX2UpwUBuiuPYnGSFEW2x@dpg-co83uc6v3ddc73b7tvjg-a.oregon-postgres.render.com/makerchecker_b67g" PORT=3000


## Running the Application

To run the application, follow these steps:

1. Install dependencies by running:

npm install


2. Start the server by running:

npm start


This will start the application on port 3000 by default.

Schema

The schema defines the database structure and relationships between entities:

  • User: Represents users with attributes such as username, email, and role. Each user can be associated with multiple requests and can also act as an approver.
  • Approver: Connects users with approved request types. Each approver can approve requests based on their approved request types.
  • Request: Represents individual requests made by users. Each request has a requester, a request type, and a status indicating whether it's pending, approved, denied, or expired.

Routes

Create Requester

  • POST /api/createRequester
    • Creates a new requester.

    • Request Body:

      {
          "username": "aaaattt",
          "email": "[email protected]",
          "role": "REQUESTER"
      }
    • Response:

      {
          "id": "7d508fa4-c119-4a34-971d-c13edf9dbbe4",
          "username": "aaaattt",
          "email": "[email protected]",
          "role": "REQUESTER",
          "createdAt": "2024-04-05T22:34:23.745Z",
          "updatedAt": "2024-04-05T22:34:23.745Z"
      }

Create Approval User

  • POST /api/createApprovalUser
    • Creates a new user with approver role and approved request types.

    • Request Body:

      {
          "username": "TobePertera",
          "email": "[email protected]",
          "requestTypes": ["C", "A"]
      }
    • Response:

      {
          "id": "609f2f41-b671-47ad-8381-f0cd8f8e69c4",
          "username": "TobePertera",
          "email": "[email protected]",
          "role": "APPROVER",
          "createdAt": "2024-04-05T22:35:37.259Z",
          "updatedAt": "2024-04-05T22:35:37.259Z",
          "Approver": [
              {
                  "id": "64ed646b-8a2d-47f7-afc4-5ec2fc0c2771",
                  "userId": "609f2f41-b671-47ad-8381-f0cd8f8e69c4",
                  "approvedRequestTypes": ["B", "C"]
              }
          ]
      }

Create Request

  • POST /api/createrequests
    • Creates a new request.

    • Request Body:

      {
          "requesterId": "5e1c916a-9a6f-4cbd-ad55-624fe4e73b72",
          "requestType": "C",
          "expiration": "2024-04-09T12:00:00Z"
      }
    • Response:

      {
      "id": "b3daee36-81d3-460e-9395-8dfd3fac7d26",
      "requesterId": "7d508fa4-c119-4a34-971d-c13edf9dbbe4",
      "requestType": "C",
      "description": null,
      "details": null,
      "status": "PENDING",
      "expiration": "2024-04-09T12:00:00.000Z",
      "createdAt": "2024-04-05T22:47:14.133Z",
      "updatedAt": "2024-04-05T22:47:14.133Z"
      

} ```

Approve Request

  • PUT /api/{requestId}/approve
    • Approves or denies a request.

    • Request Body:

      {
          "approverId": "518e0c09-7df5-4613-896b-14f20118b7ce",
          "status": "Declined"
      }

Get User Details

  • GET /api/{userId}
    • Retrieves details of a user by ID.

    • Response:

      {
          "id": "609f2f41-b671-47ad-8381-f0cd8f8e69c4",
          "username": "TobePertera",
          "email": "[email protected]",
          "role": "APPROVER",
          "createdAt": "2024-04-05T22:35:37.259Z",
          "updatedAt": "2024-04-05T22:35:37.259Z",
          "Approver": [
              {
                  "id": "64ed646b-8a2d-47f7-afc4-5ec2fc0c2771",
                  "userId": "609f2f41-b671-47ad-8381-f0cd8f8e69c4",
                  "approvedRequestTypes": ["B", "C"]
              }
          ],
          "Request": []
      }