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

erised-microservice

v1.0.0

Published

Simple express boilerplate microservice

Downloads

1

Readme

Description

This is a fast deployment / easy-to-use Node.js server.

Commit Rules & Review

The commits must follow the rules specified in the doitmentation, in order to be accepted for merging.

Installation & Execution

npm i

npm run dev

Runs the server in the development mode.

=======================================================================================================

API Endpoints

Informations about microservice's endpoints

/getAll (GET)

This enndpoint is located inside multiple controllers. Used for mqtt sync. Return all records of a collection.

/users

/register (POST)

Creates a user record based on request's input. Includes validation. Return userId

Data Example

{
    "userId": "f0ea4e43-545c-4f8f-8c2a-6fe5af1c48c5",
    "username": "username",
    "firstname": "firstname",
    "lastname": "lastname",
    "email":{
        "email": "[email protected]",
        "verified": false
    },
    "status": "active",
    "banned": false
}

/ownSubscription (GET)

Recieve userId and performe a db query to find if the user has active subscriptions. Returns subscribed: true if user has active subcriptions and subscribed: false otherwise.

Data Example

?userId=f0ea4e43-545c-4f8f-8c2a-6fe5af1c48c5

/tools

/myTools (GET)

Requires userId. Performes a db query to find this user's tool. Returns data in the following form. Includes auth.checkAdmin.

{
    "tools": [
        "Google Ads"
    ]
}

Data Example

?userId=f0ea4e43-545c-4f8f-8c2a-6fe5af1c48c5

/configurations

/saveWizardStatus (POST)

Creates a configuration record based on request's input. Field status is hardcoded to 'incomplete'. Includes validation. Return the new configuration record.

Data Example

{
    "userId": "userId",
    "name": "temp-web-app",
    "submitted": {
        "0": "something",
        "1": "somethingelse"
    },
    "pageNo": 2
}

/continueWizard (GET)

Search the db for "status:incomplete" records that matches the query parameters. Query params are userId and name. Return the matched configuration records.

Data Example

?userId=f0ea4e43-545c-4f8f-8c2a-6fe5af1c48c5&name=temp-web-app

/subscriptions

Only includes one endpoint, the getAll (explained on top)

/wizards

/getWizard (GET)

Search the db for one record that matches the query parameters. Query params are lang and name. Return the matched wizard record.

Data Example

?lang=el&name=ERISED_MAIN_FLOW

/getWizards (GET)

Search the db for records that matches the query parameter. Query param is lang. Return the matched wizard records.

Data Example

?lang=el

/createWizard (POST)

Creates a wizard record based on request's input. Includes validation. Return the new wizard record.

Data Example

{
    "lang": "el",
    "name": "TEMP_NAME_FLOW",
    "questions": [
        {
            "title": "temp",
            "type": "CHECKBOX_WITH_TEXT",
            "answers": [
                "Απάντηση1",
                "Απάντηση2"
            ],
            "pageNo": 0,
            "skippable": false
            },
            {
            "title": "temp2",
            "type": "CHECKBOX",
            "answers": [
                "Απάντηση5",
                "Απάντηση6",
                "Απάντηση7"
            ],
            "pageNo": 1,
            "skippable": false
            }
    ],
    "styles": [
        "tempStyle1",
        "tempStyle2"
    ]
}

/editWizard (POST)

Updates a wizard record that matches the given lang and name. Updatable fields are questions and styles. Includes validation. Return the new wizard record.

Data Example

{
    "lang": "de",
    "name": "ERISED_MAIN_FLOW",
    "questions": [
        {
            "title": "temdddp",
            "type": "CHECKBOX_WITH_TEXT",
            "answers": [
                "Απάντηση1",
                "Απάντηση2"
            ],
            "pageNo": 0,
            "skippable": false
            },
            {
            "title": "temp2",
            "type": "CHECKBOX",
            "answers": [
                "Απάντηση5",
                "Απάντηση6",
                "Απάντηση7"
            ],
            "pageNo": 1,
            "skippable": false
            }
    ],
    "styles": [
        "tempStyle1",
        "tempStyle2"
    ]
}

/microservices

/syncMicroservices (GET)

Used for server db cloning sync (mqtt). Hardcoded messages are broadcasted to all microservices/# subscribers. Return 'SUCCESS' or 'FAILED' depended on errors during publishing.

/translations

/findMissing (GET)

Used for the translation tool. Takes no parameters. Configuration is needed in the config file.

Returned Data Example

{
    "client": "erised-web-app",
    "missing": [
        {
            "lang": "de",
            "keys": [
                "HOME",
                "ABOUT"
            ]
        },
        {
            "lang": "el",
            "keys": [
                "ABOUT",
                "CONTACT"
            ]
        },
        {
            "lang": "it",
            "keys": [
                "HOME",
                "ABOUT",
                "CONTACT"
            ]
        }
    ]
}

/media/users

/upload (POST)

Require the express-fileupload middleware. Link: https://www.npmjs.com/package/express-fileupload

Receives an png image and uploads it to Minio.