# @akarui/aoi.panel

> The aoi.panel module provides a panel component for the aoi.js library using express.

Latest version **0.0.10** (published 2024-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @akarui/aoi.panel
pnpm add @akarui/aoi.panel
yarn add @akarui/aoi.panel
bun add @akarui/aoi.panel
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2024-07-28 |
| First published | 2022-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=16.9.0 |
| Dependencies | 4 |
| Unpacked size | 3.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Leref |
| Maintainers | wiltark, bumblebee3, leref |
| Keywords | aoi.js, aoi.js panel, aoi.panel, panel, express, discord, discord bot panel, aoi, dbdjs, akarui, akaruidevelopment, dashboard |

## Links

- npm: https://www.npmjs.com/package/@akarui/aoi.panel
- Repository: https://github.com/AkaruiDevelopment/aoi.panel
- Homepage: https://github.com/AkaruiDevelopment/aoi.panel#readme
- Issues: https://github.com/AkaruiDevelopment/aoi.panel/issues
- npm.io page: https://npm.io/package/@akarui/aoi.panel

## Dependencies (4)

- [undici](https://npm.io/package/undici.md) ^6.4.0
- [express](https://npm.io/package/express.md) ^4.18.2
- [body-parser](https://npm.io/package/body-parser.md) ^1.20.2
- [express-session](https://npm.io/package/express-session.md) ^1.17.3

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.10 (latest) — 2024-07-28
- 0.0.9 — 2024-03-14
- 0.0.8 — 2024-01-25
- 0.0.7 — 2024-01-25
- 0.0.6-fixe — 2024-01-01
- 0.0.6 — 2024-01-01
- 0.0.5 — 2023-07-24
- 0.0.4 — 2023-02-27
- 0.0.3 — 2022-08-28
- 0.0.2 — 2022-08-14
- 0.0.1 — 2022-08-09

## README

<p align="center">
  <a href="https://panel.aoijs.org">
    <img width="150" src="https://github.com/aoijs/website/blob/master/assets/images/aoipanel.png?raw=true" alt="aoi.panel">
  </a>
</p>

<h1 align="center">@aoijs/aoi.panel</h1>

![npm](https://img.shields.io/npm/dt/@akarui/aoi.panel?color=blue&label=NPM%20Downloads&logo=npm&logoColor=Green)
![GitHub](https://img.shields.io/github/license/AkaruiDevelopment/panel?color=blue&logo=github)
![GitHub package.json version](https://img.shields.io/github/package-json/v/AkaruiDevelopment/panel?color=blue&label=Git%20Version)
![GitHub last commit](https://img.shields.io/github/last-commit/AkaruiDevelopment/panel?color=blue)
![GitHub repo size](https://img.shields.io/github/repo-size/AkaruiDevelopment/panel)
![GitHub forks](https://img.shields.io/github/forks/AkaruiDevelopment/panel?color=blue&style=social)
![GitHub Repo stars](https://img.shields.io/github/stars/AkaruiDevelopment/panel?style=social)
![GitHub watchers](https://img.shields.io/github/watchers/AkaruiDevelopment/panel?style=social)

### Table of Contents

- [Installation](#installation)
    - [Setup](#setup)

### Installation

```bash
npm i @aoijs/aoi.panel
```

![Login Page](./images/image.png)
### Setup

```javascript
const {Panel} = require("@aoijs/aoi.panel")
const {AoiClient} = require("aoi.js");

const client = new AoiClient({
    intents: ["MessageContent", "Guilds", "GuildMessages"],
    events: ["onMessage", "onInteractionCreate"],
    prefix: "Discord Bot Prefix",
    token: "Discord Bot Token",
    database: {
        type: "aoi.db",
        db: require("@akarui/aoi.db"),
        dbType: "KeyValue",
        tables: ["main"],
        securityKey: "a-32-characters-long-string-here",
    }
});

// Ping Command
client.command({
    name: "ping",
    code: `Pong! $pingms`
});

client.loadCommands("./commands/", true);


const panel = new Panel({
  port:3000,//port
  client:bot,//aoi.js client
  accounts : "/panel.userconfig.js" //accounts file (for security reasons must be a separate file)
})

panel.loadPanel();

```

#### Example userconfig file for panel:

File: `panel.userconfig.js`
```js
module.exports = [
    {
        username: "administratorAccount",
        password: "adminpassword",
        perms: ["admin"]
    }, {
        username: "user",
        password: "user",
        perms: [ "startup"]
    }
]
```
##### Panel Main Page
![Panel Main Page](./images/image2.png)
##### Panel Code Editor
![code editor](./images/image3.png)
##### Panel Terminal
![terminal](./images/image4.png)
##### Panel Code evaluate
![eval1](./images/image6.png)
![eval2](./images/image5.png)


### Making Custom Pages
Panel uses the express.js framework. So all resources of express can be used while making custom pages e.t.c.
```javascript
const app = panel.app;
app.get("/example", (req, res) => {
    res.send("This is an example page.");
})
```

---
_Source: https://npm.io/package/@akarui/aoi.panel · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
