Giter Site home page Giter Site logo

pricing-plan's Introduction

Backend

How to run

  • Install all the dependencies by running npm install, this will install all the dependencies in the package.json

To start the app run npm run start OR npm run start:dev [This will spin up the app with nodemon]

The App should running on http://localhost:8080

Endpoint

GET 'http:{{base_url}}/v1/pricing

This returns all the plans.

//Sample response
{
    "success": true,
    "message": "Pricing sucessfully fetched",
    "data": {
        "tiers": [
            {
                "starter": {
                    "price": "€3",
                    "description": "Good place to start",
                    "reporting": [
                        {
                            "detailed_reports": false,
                            "weekly_data_reports": true,
                            "create_your_own_reports": false
                        }
                    ],
                    "blog": [
                        {
                            "create_your_own_blog": true,
                            "upload_images": false
                        }
                    ],
                    "file_storgae": [
                        {
                            "upload_files": false,
                            "share_files_with_team": true,
                            "watch_videos": false
                        }
                    ],
                    "application_integration": [
                        {
                            "install_new_apps": false,
                            "install_custom_apps": true
                        }
                    ]
                },
                "advanced": {
                    "price": "€10",
                    "description": "For the startup with more needsGood place to start",
                    "reporting": [
                        {
                            "detailed_reports": true,
                            "weekly_data_reports": true,
                            "create_your_own_reports": true
                        }
                    ],
                    "blog": [
                        {
                            "create_your_own_blog": true,
                            "upload_images": true
                        }
                    ],
                    "file_storgae": [
                        {
                            "upload_files": true,
                            "share_files_with_team": true,
                            "watch_videos": false
                        }
                    ],
                    "application_integration": [
                        {
                            "install_new_apps": true,
                            "install_custom_apps": false
                        }
                    ]
                },
                "enterprise": {
                    "price": "€100",
                    "description": "for big companies with big dreams",
                    "reporting": [
                        {
                            "detailed_reports": true,
                            "weekly_data_reports": true,
                            "create_your_own_reports": true
                        }
                    ],
                    "blog": [
                        {
                            "create_your_own_blog": true,
                            "upload_images": true
                        }
                    ],
                    "file_storgae": [
                        {
                            "upload_files": false,
                            "share_files_with_team": true,
                            "watch_videos": false
                        }
                    ],
                    "application_integration": [
                        {
                            "install_new_apps": true,
                            "install_custom_apps": false
                        }
                    ]
                }
            }
        ]
    }
}

The tiers can be queried with different plans e.g starter, advanced, enterprise

GET 'http:{{base_url}}/v1/pricing?plans=starter

This returns all starter plan

{
    "success": true,
    "message": "Pricing sucessfully fetched",
    "data": [
        {
            "starter": {
                "application_integration": [
                    {
                        "install_new_apps": false,
                        "install_custom_apps": true
                    }
                ],
                "blog": [
                    {
                        "create_your_own_blog": true,
                        "upload_images": false
                    }
                ],
                "description": "Good place to start",
                "file_storgae": [
                    {
                        "upload_files": false,
                        "share_files_with_team": true,
                        "watch_videos": false
                    }
                ],
                "price": "€3",
                "reporting": [
                    {
                        "detailed_reports": false,
                        "weekly_data_reports": true,
                        "create_your_own_reports": false
                    }
                ]
            }
        }
    ]
}

GET 'http:{{base_url}}/v1/pricing?plans=starter,advanced

This returns starter and advanced plan

{
    "success": true,
    "message": "Pricing sucessfully fetched",
    "data": [
        {
            "starter": {
                "application_integration": [
                    {
                        "install_new_apps": false,
                        "install_custom_apps": true
                    }
                ],
                "blog": [
                    {
                        "create_your_own_blog": true,
                        "upload_images": false
                    }
                ],
                "description": "Good place to start",
                "file_storgae": [
                    {
                        "upload_files": false,
                        "share_files_with_team": true,
                        "watch_videos": false
                    }
                ],
                "price": "€3",
                "reporting": [
                    {
                        "detailed_reports": false,
                        "weekly_data_reports": true,
                        "create_your_own_reports": false
                    }
                ]
            }
        },
        {
            "advanced": {
                "application_integration": [
                    {
                        "install_new_apps": true,
                        "install_custom_apps": false
                    }
                ],
                "blog": [
                    {
                        "create_your_own_blog": true,
                        "upload_images": true
                    }
                ],
                "description": "For the startup with more needsGood place to start",
                "file_storgae": [
                    {
                        "upload_files": true,
                        "share_files_with_team": true,
                        "watch_videos": false
                    }
                ],
                "price": "€10",
                "reporting": [
                    {
                        "detailed_reports": true,
                        "weekly_data_reports": true,
                        "create_your_own_reports": true
                    }
                ]
            }
        }
    ]
}

Also, the response can be sorted by passing sort query params

Sort only the plans and not the available options

GET 'http:{{base_url}}/v1/pricing?sort=true

"success": true,
    "message": "Pricing sucessfully fetched",
    "data": {
        "advanced": {
            "price": "€10",
            "description": "For the startup with more needsGood place to start",
            "reporting": [
                {
                    "detailed_reports": true,
                    "weekly_data_reports": true,
                    "create_your_own_reports": true
                }
            ],
            "blog": [
                {
                    "create_your_own_blog": true,
                    "upload_images": true
                }
            ],
            "file_storgae": [
                {
                    "upload_files": true,
                    "share_files_with_team": true,
                    "watch_videos": false
                }
            ],
            "application_integration": [
                {
                    "install_new_apps": true,
                    "install_custom_apps": false
                }
            ]
        },
        "enterprise": {
            "price": "€100",
            "description": "for big companies with big dreams",
            "reporting": [
                {
                    "detailed_reports": true,
                    "weekly_data_reports": true,
                    "create_your_own_reports": true
                }
            ],
            "blog": [
                {
                    "create_your_own_blog": true,
                    "upload_images": true
                }
            ],
            "file_storgae": [
                {
                    "upload_files": false,
                    "share_files_with_team": true,
                    "watch_videos": false
                }
            ],
            "application_integration": [
                {
                    "install_new_apps": true,
                    "install_custom_apps": false
                }
            ]
        },
        "starter": {
            "price": "€3",
            "description": "Good place to start",
            "reporting": [
                {
                    "detailed_reports": false,
                    "weekly_data_reports": true,
                    "create_your_own_reports": false
                }
            ],
            "blog": [
                {
                    "create_your_own_blog": true,
                    "upload_images": false
                }
            ],
            "file_storgae": [
                {
                    "upload_files": false,
                    "share_files_with_team": true,
                    "watch_videos": false
                }
            ],
            "application_integration": [
                {
                    "install_new_apps": false,
                    "install_custom_apps": true
                }
            ]
        }
    }
}

sort both the plans and available options GET 'http:{{base_url}}/v1/pricing?sort=true&plans=starter,advanced,enterprise'

{
    "success": true,
    "message": "Pricing sucessfully fetched",
    "data": {
        "advanced": {
            "application_integration": [
                {
                    "install_new_apps": true,
                    "install_custom_apps": false
                }
            ],
            "blog": [
                {
                    "create_your_own_blog": true,
                    "upload_images": true
                }
            ],
            "description": "For the startup with more needsGood place to start",
            "file_storgae": [
                {
                    "upload_files": true,
                    "share_files_with_team": true,
                    "watch_videos": false
                }
            ],
            "price": "€10",
            "reporting": [
                {
                    "detailed_reports": true,
                    "weekly_data_reports": true,
                    "create_your_own_reports": true
                }
            ]
        },
        "enterprise": {
            "application_integration": [
                {
                    "install_new_apps": true,
                    "install_custom_apps": false
                }
            ],
            "blog": [
                {
                    "create_your_own_blog": true,
                    "upload_images": true
                }
            ],
            "description": "for big companies with big dreams",
            "file_storgae": [
                {
                    "upload_files": false,
                    "share_files_with_team": true,
                    "watch_videos": false
                }
            ],
            "price": "€100",
            "reporting": [
                {
                    "detailed_reports": true,
                    "weekly_data_reports": true,
                    "create_your_own_reports": true
                }
            ]
        },
        "starter": {
            "application_integration": [
                {
                    "install_new_apps": false,
                    "install_custom_apps": true
                }
            ],
            "blog": [
                {
                    "create_your_own_blog": true,
                    "upload_images": false
                }
            ],
            "description": "Good place to start",
            "file_storgae": [
                {
                    "upload_files": false,
                    "share_files_with_team": true,
                    "watch_videos": false
                }
            ],
            "price": "€3",
            "reporting": [
                {
                    "detailed_reports": false,
                    "weekly_data_reports": true,
                    "create_your_own_reports": false
                }
            ]
        }
    }
}

To easily get started, copy this curl and import directly on postman, insomnia etc.

curl --location --request GET 'http://localhost:8080/v1/pricing?sort=true&plans=starter,advanced,enterprise'

To run tests

npm run test

pricing-plan's People

Contributors

flw-olufemi avatar olufemiobafunmiso avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.