Skip to main content

BAJAJ TECHNOLOGY SERVICES

Getting Started with Strapi: A Next-Gen CMS

Getting Started with Strapi: A Next-Gen CMS
This article tries to explain how to leverage Strapi plugins to enhance business’s CMS functionality and streamline the development process.
Oct 30, 2024 | 5 min read
Getting Started with Strapi

Headless CMS systems are increasingly popular, with Strapi being one of the most commonly deployed solutions in this area. What makes Strapi versatile and easy to customize is the fact that the core comes with a system of plugins that you can easily use. Plugins empower you to go beyond the limitations of Strapi’s original functionality. You might encounter a situation where additional functionalities are required depending on the nature of your project. In this blog, we’ll guide you through how to get started with Strapi plugins and explain why some of them could be extremely useful like S3 integration, GraphQL, Email plugin etc.

Why Use Strapi Plugins?

Strapi plugin enables the developer to provide new capabilities to the system without adding code to the main program. This modularity is what makes Strapi extremely flexible and customizable since you can use it as per your needs. By using plugins, it is now possible to marry disparate services, improve the management of assets on the content management systems, extend the reach of the APIs, all this without breaking a sweat with regards to development.

Installing Plugins in Strapi

Before we dive into specific plugins, let’s go over the process of installing and managing plugins in Strapi.

  1. Navigate to the Plugins Marketplace
    In the Strapi admin panel, navigate to the “Marketplace” section to view all available plugins. Strapi has a wide range of plugins, both official and community-developed.
  2. Install a Plugin
    To install a plugin, click on the desired plugin from the marketplace and hit “Install.” Strapi will automatically download and integrate it into your project.
  3. Configure the Plugin
    Most plugins come with configuration options. After installation, check the documentation to configure the plugin correctly. This could involve setting environment variables, enabling API routes, or customizing behaviors via the plugin's settings.
  4. Restart Strapi
    After installation, restart your Strapi server to apply the changes and see the new plugin in action.

Useful Strapi Plugins

Having already gone through the fundamental points, we shall now focus on a few of the functional plugins offered by Strapi.

  1. S3 Upload Plugin

Using the S3 Upload plugin there’s an option to remove media assets - images, videos, etc - from the local file system to external storage which in every case is an Amazon S3 bucket. This is especially helpful for projects with a lot of media content or projects that are hosted in scalable platforms.

Pros :

  • Provides a resource which is able to scale in order to accommodate bulky media content.
  • Media  uses the CDN services of Amazon which features very fast response systems
  • Integration with other AWS interfaces is easy.

Installation : 

You can install this plugin via npm:

bash

Copy code

npm install strapi-provider-upload-aws-s3

Configuration : After installation, configure the plugin in ./config/plugins.js by adding your S3 credentials:

javascript

Copy code

module.exports = ({ env }) => ({

  upload: {

    provider: 'aws-s3',

    providerOptions: {

      accessKeyId: env('AWS_ACCESS_KEY_ID'),

      secretAccessKey: env('AWS_ACCESS_SECRET'),

      region: env('AWS_REGION'),

      params: {

        Bucket: env('AWS_BUCKET_NAME'),

      },

    },

  },

});

2. GraphQL Plugin

The GraphQL plugin adds GraphQL support to your Strapi APIs, allowing you to query your content in a more flexible way. GraphQL is a powerful query language that enables clients to request exactly the data they need.

Benefits :

  • Flexible and powerful API querying.
  • Simplified response payloads.
  • Easily customizable GraphQL schema.

Installation : 

To install the GraphQL plugin, run:

bash

Copy code

npm install @strapi/plugin-graphql

Once installed, the plugin automatically exposes GraphQL endpoints for your content types. You can now access your content via GraphQL and even customize the schema if needed.

Written by

Dhiraj Jha
Head - commerce & experience