Strapi's admin panel and plugins system aim to be an easy and powerful way to create new features.
The admin panel is a [React](https://facebook.github.io/react/) application which can embed other React applications. These other React applications are the `admin` parts of each Strapi's plugins.
## Environment setup
To enable local plugin development, you need to start your application with the front-end development mode activated:
```bash
$ cd my-app
$ yarn develop --watch-admin
```
## API
### Strapi global variable
The administration exposes a global variable that is accessible for all the plugins.
#### `strapi.backendURL`
Retrieve the back-end URL. (e.g. `http://localhost:1337`).
#### `strapi.currentLanguage`
Retrieve the administration panel default language (e.g. `en-US`)
#### `strapi.languages`
Array of the administration panel's supported languages. (e.g. `['ar', 'en', 'fr', ...]`).
#### `strapi.lockApp()`
Display a loader that will prevent the user from interacting with the application.
#### `strapi.unlockApp()`
Remove the loader so the user can interact with the application
#### `strapi.notification`
Display a notification (works with i18n message id). Use this command anywhere in your code.
| blockerComponent | node | Props can be either `null` or React node (e.g. `() => <div />`) |
| blockerComponentProps | object | Props to provide to customise the [blockerComponent](https://github.com/strapi/strapi/blob/58588e10e5d15921b0966e20ce1bc6cde70df5cc/packages/strapi-helper-plugin/lib/src/components/BlockerComponent/index.js#L81-L86) |
| description | string | Plugin's description retrieved from the package.json |
| id | string | Id of the plugin from the `package.json` |
| initializer | node | Refer to the [Initializer documentation](#initializer) |
| injectedComponents | array | Refer to the [Injected Component documentation](#injected-components) |
The component is generated by default when you create a new plugin. Use this component to execute some logic when the app is loading. When the logic has been executed this component should emit the `isReady` event so the user can interact with the application.
The routing is based on the [React Router V5](https://reacttraining.com/react-router/web/guides/philosophy), due to it's implementation each route is declared in the `containers/App/index.js` file.
::: tip
Each route defined in a plugin must be prefixed by the plugin's id.
:::
**Route declaration :**
Let's say that you want to create a route `/user` with params `/:id` associated with the container UserPage.
The administration panel uses [styled-components](https://styled-components.com/) for writing css.
### i18n
[React Intl](https://github.com/yahoo/react-intl) provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.
**Usage**
We recommend to set all your components text inside the translations folder.
The example below shows how to use i18n inside your plugin.
**Define all your ids with the associated message:**