All Projects → surgeharb → strapi-plugins

surgeharb / strapi-plugins

Licence: MIT License
🚀 Open source plugins for Strapi - Node.js Headless CMS

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to strapi-plugins

Binda
Headless CMS based on Ruby on Rails
Stars: ✭ 60 (+140%)
Mutual labels:  admin-panel, headless-cms
.tmux
🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
Stars: ✭ 15,594 (+62276%)
Mutual labels:  customization, plugins
Strapi
🚀 Open source Node.js Headless CMS to easily build customisable APIs
Stars: ✭ 41,786 (+167044%)
Mutual labels:  strapi, headless-cms
Griddle
Simple Grid Component written in React
Stars: ✭ 2,494 (+9876%)
Mutual labels:  customization, plugins
Codestar Framework
A Simple and Lightweight WordPress Option Framework for Themes and Plugins
Stars: ✭ 147 (+488%)
Mutual labels:  plugins, admin-panel
awesome-medusajs
A curated list of awesome resources related to MedusaJS 😎
Stars: ✭ 113 (+352%)
Mutual labels:  plugins, headless-cms
ValliStart
A start menu to replace the un-customizable one that you have right now.
Stars: ✭ 89 (+256%)
Mutual labels:  customization
fetch
Isomorphic Wordpress API client and React hooks - super tiny, super fast.
Stars: ✭ 47 (+88%)
Mutual labels:  headless-cms
spotdlRedesign
spotDL v4 - The spotDL you love and use with plugin support.
Stars: ✭ 17 (-32%)
Mutual labels:  plugins
x64dbg-plugin-template-for-Visual-Studio
x64dbg plugin template for visual studio
Stars: ✭ 20 (-20%)
Mutual labels:  plugins
frontity-twentynineteen
🎨 A Frontity Twentynineteen theme Project
Stars: ✭ 54 (+116%)
Mutual labels:  headless-cms
gatsby-plugin-dynamic-routes
Creating dynamic routes based on your environment and/or renaming existing routes
Stars: ✭ 14 (-44%)
Mutual labels:  plugins
pf4j-update
Update mechanism for PF4J
Stars: ✭ 56 (+124%)
Mutual labels:  plugins
dotfiles
Files that start with a dot (they're very cool).
Stars: ✭ 124 (+396%)
Mutual labels:  customization
strapi-plugin-migrate
Strapi-Plugin-Migrate helps to migrate Strapi data from one environment of your app to another. For example development > staging
Stars: ✭ 71 (+184%)
Mutual labels:  strapi
nextjs-admin-template
Free admin dashboard template based on Next.Js with @paljs/ui component package
Stars: ✭ 266 (+964%)
Mutual labels:  admin-panel
motor-admin
Deploy a no-code admin panel for any application in less than a minute. Search, create, update, and delete data entries, create custom actions, and build reports.
Stars: ✭ 1,145 (+4480%)
Mutual labels:  admin-panel
sql-formatter
TablePlus plugin
Stars: ✭ 18 (-28%)
Mutual labels:  plugins
parse-function
(!! moved to tunnckoCore/opensource multi-package repository !!) 🔱 Parse a function into an object using espree, acorn or babylon parsers. Extensible through Smart Plugins.
Stars: ✭ 37 (+48%)
Mutual labels:  plugins
framework
The target of this framework is to help in all the needs of a full featured API REST, from top to bottom, and at the same time having the best possible performance and security.
Stars: ✭ 88 (+252%)
Mutual labels:  headless-cms

🚀 Cool Strapi Plugins

Amazing Plugin strapi-plugin-graphs-builder for Strapi v4, check it out now!

Getting Started

First clone the project by running:

git clone https://github.com/surgeharb/strapi-plugins.git

Installation

Once the project is cloned locally, navigate to the main directory:

cd strapi-plugins

Make sure that yarn is installed on your machine and run:

yarn install

To start the project in development mode:

yarn develop

If you want to tinker with plugins and watch changes without rebuilding the project multiple times:

yarn develop --watch-admin

Finally, for production make sure to:

# build the project -- production
NODE_ENV=production yarn build

# start Strapi -- production
NODE_ENV=production yarn start

Plugin: Admin Access Rights

Keep in mind that this is a temporary solution as the core team of Strapi is in the latest stages of achieving this the good way in the system.
I made use of the built in Strapi "admin customization" feature.

This feature is available directly when you login as an admin user > Access Rights under Plugins in the Left Panel.

Make it possible in your own Strapi Project!

First, you will have 3 default roles admin, author, editor as a start.

Step 1 - Modify admin database model

Add these roles to the Administrator database model.

From this repo, copy the admin extension into your project's extensions:

cp -R ./extensions/admin ~/your-project/extensions

You can notice a script to override Administrator model. To apply it on every run, edit your package.json scripts as follow:

{
  "scripts": {
    "admin-override": "node ./extensions/admin/override-script.js",
    "develop": "npm run admin-override && strapi develop",
    "start": "npm run admin-override && strapi start",
    "build": "npm run admin-override && strapi build",
    "strapi": "strapi"
  },
}

Make sure the default admin url is not /admin as it admin prefix causes issues in this modification. Issue #1. For this project I changed the url to /dashboard as follows:

// ./config/server.js
module.exports = ({ env }) => ({
  host: env('HOST', '0.0.0.0'),
  port: env.int('PORT', 1337),
  admin: {
    url: '/dashboard'
  }
});

Step 2 - Override admin CRUD controllers

Strapi administrator controllers restrict us from adding a new field while creating/updating admins.

For this I wrote a hook that overrides the controller behavior into letting us add new role on create/update admin.

# if you don't have hooks folder
mkdir ~/your-project/hooks

# copy admin-roles custom hook
cp -R ./hooks/admin-roles ~/your-project/hooks

# enable the hook on Strapi startup
cp ./config/hook.js ~/your-project/config

Kill the process, and restart Strapi instance, then navigate to Manage administrators in the top right menu, and create a new administrator.

Now give new admin a role from the new dropdown that we injected in the model.

P.S. Make sure to keep at least 1 admin role on an administrator!!!

Step 3 - Create admin-access model and components

To manage roles access, create a database model linking plugin uid with the administrator role.

# copy new API models and controllers
cp -R ./api/admin-access ~/your-project/api

# prepare components general folder
mkdir -p ~/your-project/components/general

# copy custom plugin components used by the API
cp ./components/general/plugin-access.json ~/your-project/components/general

Step 4 - Restrict access for roles

Restrict plugin API fetching backend-side

# copy modified content-manager plugin controller
cp -R ./extensions/content-manager ~/your-project/extensions

Remove frontend elements according to provided Roles Manage administrators button and Left Panel Plugins

# copy admin frontend modification in the root of your project
cp -R ./admin ~/your-project

Step 5 - Add "access rights" plugin

# create plugins folder if not exists
mkdir ~/your-project/plugins

# add the newly crafter plugin for access rights
cp -R ./plugins/access-rights ~/your-project/plugins

Optional Step - Add more roles

Add roles in enum array inside extensions/admin/models/Administrator.settings.json
Don't remove first role - admin, it is necessary for the plugin to work properly!

Apply same additions also inside plugins/access-rights/admin/src/containers/HomePage/index.js

// modify this array - do not include first role 'admin'
const [roles, setRoles] = useState(['author', 'editor']);

Voilà! Now kill the process, yarn build and restart Strapi. Login using your main admin user and manage other administrators access.



Do not hesitate to open issues if you encounter any, submit a pull request to improve any bit of the code, or contact me [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].