# Maddy Admin Panel

A front-end for [Maddy](https://maddy.email), allowing users to manage their account and administrators to manage the server.

<details>
<summary>Screenshots</summary>

## Self-Service account management
<img src=".assets/self-service-dark.png" /> <img src=".assets/self-service-light.png" />

## Administration
### Aliases
<img src=".assets/aliases.png" />

### Users
<img src=".assets/users.png" />

### Audit Log
<img src=".assets/audit.png" />

</details>

## Features

- **Password management** - Users can easily update their account password
- **Aliases** - Users can create and manage their own aliases
  - Normal aliases allow the user to freely choose their alias address from a list of domains. An administrator needs to approve the alias before it can be used.
  - Temporary aliases are randomly generated and can be created by users without administrator approval. It's like a tempmail service, but cooler!
- **Administration** - Admins can easily perform common tasks
  - Creating users, <s>deleting users and resetting their password</s> (todo)
  - Creating and deleting aliases for any user

Authentication is handled using the same database that Maddy uses, so users can use the same password to access their email and the Admin Panel.

### notes to add later
```sql
CREATE TABLE aliases (id INTEGER PRIMARY KEY AUTOINCREMENT, address TEXT NOT NULL, alias TEXT NOT NULL, pending INTEGER DEFAULT 0, temporary INTEGER DEFAULT 0);
CREATE TABLE temp_alias_requests (key TEXT PRIMARY KEY, address TEXT NOT NULL, alias TEXT NOT NULL, expires INTEGER NOT NULL);

CREATE TABLE api_keys (id INTEGER PRIMARY KEY AUTOINCREMENT, address TEXT NOT NULL, label TEXT NOT NULL, token TEXT NOT NULL);
```
