# Mastermind MVP — User Manual

This manual is for day‑to‑day users of the Mastermind MVP dashboard.

## What Mastermind is
Mastermind is a self‑hosted Assistant Project Manager (APM) dashboard that helps you:
- create and manage projects
- import emails into an **Inbox**
- automatically sort/assign emails using rules
- create **draft‑first** documents (PCO and RFI) from emails
- keep an **audit trail** of key actions

It is designed to be private (LAN/Tailscale) and safe by default (no auto‑sending).

---

## Login / Logout
### Login
1. Open the login page:
   - `https://<your-host>/login`
2. Sign in with your **local email + password**.

If Google/Microsoft OAuth is enabled by the admin, you may also see those buttons.

### Logout
- Click **Logout** in the UI (or go to `/logout`).

---

## Home
After logging in, you land on **Home** (`/`). From here you can reach:
- Projects
- Inbox
- Drafts
- Docs

---

## Projects
### View projects
- Go to `/projects`
- You’ll see projects you’re a member of.

### Create a project
1. Go to `/projects`
2. Fill the **Create Project** form (name is required)
3. Submit

Fields you may use:
- **Name** (required)
- **Job #** (optional)
- **Role mode** (defaults to EC)
- **GC name** (optional)
- **City/State** (optional)
- **Keywords** (important for auto-sorting)

### Edit a project
- Open the project: `/projects/<id>`
- Update fields and save

### Project inbox
- From the project page, use **Project Inbox** to view emails already assigned to that project.

---

## Inbox (manual import)
Mastermind currently supports manual email import via `.eml` upload.

### Upload email(s)
1. Go to `/inbox`
2. Use **Upload .eml**
3. Select one or more `.eml` files
4. Submit

Notes:
- The system stores the raw `.eml` and any attachments.
- Uploaded emails initially appear as **Unsorted**.

### Assign an email to a project
1. Open an email from `/inbox`
2. Choose a project in the **Assign** dropdown
3. Submit

### View email details + attachments
- Open `/inbox/<emailId>`
- Attachments can be downloaded from the email page.

---

## Drafts (PCO / RFI)
Drafts are **generated from an email** and then edited by you.

### Create a PCO draft from an email
1. Open an email (`/inbox/<id>`)
2. Click **Create PCO Draft**
3. You’ll be taken to the draft editor

### Create an RFI draft from an email
Same flow, using **Create RFI Draft**.

### Edit + save a draft
- Draft editor pages:
  - `/drafts/pco/<id>`
  - `/drafts/rfi/<id>`
- Edit the title/body
- Click **Save**

### Export a draft
- Use the export links:
  - PCO: `/drafts/pco/<id>/export.md`
  - RFI: `/drafts/rfi/<id>/export.md`

---

## Tips for better sorting
- Put meaningful **keywords** in each Project.
- Ask an admin to create rules (sender domain, subject contains job #, etc.).
- Start simple: one rule per project is often enough.

---

## Troubleshooting
### “Login failed”
- Confirm email and password.
- If you recently changed password, log out and back in.
- Ask an admin to reset your password.

### Upload fails
- Confirm files are `.eml`.
- Try fewer files at once.
- If it consistently fails, ask admin to check disk space.

### I can’t see a project
- You must be added as a project member (admin/owner action).

---

## Glossary
- **Inbox**: Imported emails awaiting sorting/assignment.
- **PCO**: Potential Change Order draft.
- **RFI**: Request For Information draft.
- **Rule**: An automatic matching condition that assigns an email to a project.
- **Audit log**: A record of important actions (imports, assignments, admin changes).