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

wordpress-rest-admin

v0.2.1

Published

A frontend for admin area of WordPress, using [WP REST API](https://v2.wp-api.org/) and [React](https://reactjs.org/). It works with Self-Hosted WordPress.

Downloads

26

Readme

WordPress REST Admin

A frontend for admin area of WordPress, using WP REST API and React. It works with Self-Hosted WordPress.

Alt Screenshot

This project was bootstrapped with Create React App.

Features

  • Login (using JWT WP REST Plugin)
  • Dashboard
  • Posts(List, Edit, Add New, Trash)
  • Pages(List, Edit, Add New, Trash)
  • Media Upload(Images)
  • Categories and Tags
  • Comments
  • Users
  • Profile
  • Settings
  • Code generator to create your own page

Usage

Backend - what needs to be done first

Make sure you have WP REST API and JWP plugin installed in your wordpress

WP REST API

  • https://v2.wp-api.org/
  • Note that WordPress (4.7 or later) has this installed by default

JWT Authentication for WP REST API

git clone and npm start

  • Run these commands just to see how it works
git clone https://github.com/rnaga/wordpress-rest-admin.git .
npm install
npm start
  • Visit http://localhost:3000

Quick start with docker-compose.yml

  • Use docker-compose to start wordpress-rest-admin along with wordpress and MySQL
git clone https://github.com/rnaga/wordpress-rest-admin.git .
docker-compose up --build

Once all containers are up, visit http://localhost:3000 and login with the following creds

Site URL: http://localhost
Username: demo
Password: demo

Use as a React Component

cd /path/to/your/project
npm install
npm i wordpress-rest-admin
  • and render it
import WPAdmin from 'wordpress-rest-admin/WPAdmin';
import contents from 'wordpress-rest-admin/contents';
import loginLogo from './WordpressLogo.svg';
import headerLogo from './WordpressLogo.png';

...

<WPAdmin
  loginLogo={loginLogo}
  headerLogo={headerLogo}
  defaultContent={defaultContent}
  contents={contents}
/>

See example here

How to create your own page

npm install yo -g
  • clone this repo, and install generator (generator-wordpress-rest-admin)
git clone https://github.com/rnaga/wordpress-rest-admin.git . 
cd ./generator
npm link

There is "generator" directory in this repo. Go under the directory, then run "npm link" as above

  • Go to "src" directory under your React project, and run yo command (Choose your icon from here)
yo wordpress-rest-admin:contents [mypage]

It creates new files(components) under "contents" directory (see blow)

Alt Screenshot

  • Import and pass your new page to WPAdmin component
import mypage from './contents/mypage';

....

<WPAdmin contents={{mypage}} />
  • Start your project, and visit http://localhost:3000

Alt Screenshot

  • Update components(List.js, Edit.js and Create.js) as needed to change output

How to import existing pages into your project

This is useful in case you want to modify existing pages

yo wordpress-rest-admin:contents --copy-from=[content]

where "content" is one of the following.

categories  comments  dashboard  pages  posts  media profile  settings  tags  users

See example here

Supported Browsers

By default, the generated project uses the latest version of React.

You can refer to the React documentation for more information about supported browsers.