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

strapi-plugin-pfapi

v2.6.9

Published

Pfapi plugin provides fast, secure, configurable, and scalable API services for e-commerce web apps.

Downloads

31

Readme

tests release

Strapi plugin pfapi

Pfapi plugin uses pfapi-core library to provide fast, secure, configurable, and scalable API services for e-commerce web apps.

  • Pfapi uses local and Redis caches to achieve single-digit milliseconds on average API response time.
  • IP unlimited / blocked lists, Rate limits and activities log are accessible through the admin panel.
  • API handles for detail and list views are powered by highly configurable components dynamic zone.
  • Configurable filters enable user-friendly UX for users to find what they are looking for.
  • Production environment that runs multiple Strapi servers and Redis cluster is supported and tested.

Requirements

Pfapi plugin is a Strapi version 4 plugin. It requires the in-memory data store Redis. Please refer to Redis getting started to install redis server for your environment.

How to install

yarn add strapi-plugin-pfapi

OR

npm install strapi-plugin-pfapi

Click to see full documentation

Setup Demonstration

With the world cities test data set provided by plugin strapi-plugin-pfapi-data, we can run API calls to demonstrate the idea.

step 1 install Redis server

Please refer to Redis getting started to install redis server on your local computer.

step 2 create strapi app

yarn create strapi-app strapi-pfapi-app --quickstart

OR

npx create-strapi-app strapi-pfapi-app --quickstart

After creating and logging into your Strapi account from the browser, stop the strapi server.

step 3 install plugins

You don't have to install strapi-plugin-pfapi-data for your production.

strapi-plugin-pfapi-data provides a test data set for demo and test

cd strapi-pfapi-app

yarn add strapi-plugin-pfapi strapi-plugin-pfapi-data

yarn develop

OR

npm install strapi-plugin-pfapi strapi-plugin-pfapi-data

npm run develop

step 4 setup api_key and permissions

get your api_key from:

http://localhost:1337/admin/content-manager/collectionType/plugin::pfapi.pfapi-key?page=1&pageSize=10&sort=key:ASC

Please replace Pfapi-Demo-XXXXXXXX with Pfapi-Demo for the convenience of using links posted below.

A role with name PfapiDemo is installed in the above steps.

Go to Settings > USERS & PERMISSIONS PLUGIN > Roles:

http://localhost:1337/admin/settings/users-permissions/roles

click on PfapiDemo,

Under Permissions > World-city

assign find and findOne permissions to PfapiDemo and click save.

OK, we are ready to run demos.

step 5 demos

a) tests content-type name world-cities as path variable

http://localhost:1337/pfapi/world-cities?api_key=Pfapi-Demo

http://localhost:1337/pfapi/world-cities/2148?api_key=Pfapi-Demo

b) tests config handle northern-cities as path variable

handle configs are defined in PfapiHandle.

/pfapi

http://localhost:1337/pfapi/northern-cities?api_key=Pfapi-Demo

http://localhost:1337/pfapi/northern-cities/2148?api_key=Pfapi-Demo

strapi api parameters

http://localhost:1337/pfapi/northern-cities?filters[iso3]=USA&api_key=Pfapi-Demo

c) tests with config handle northern-city with id_field is name

config data defined in PfapiHandles for handle northern-city:

http://localhost:1337/pfapi/northern-city/Anchorage?api_key=Pfapi-Demo

d) test data update

goto http://localhost:1337/admin/content-manager/collectionType/api::world-city.world-city/2148

make some change, for example: change the population from 288000 to 288001

check APIs:

http://localhost:1337/pfapi/northern-cities/2148?api_key=Pfapi-Demo

http://localhost:1337/pfapi/northern-city/Anchorage?api_key=Pfapi-Demo

to see if the cached data was evicted and updated

e) test config update

goto http://localhost:1337/admin/content-manager/collectionType/plugin::pfapi.pfapi-handle/1

make some changes, for example: add or remove country to the fields array

check APIs:

http://localhost:1337/pfapi/northern-cities/2148?api_key=Pfapi-Demo

http://localhost:1337/pfapi/northern-cities/2148?api_key=Pfapi-Demo