# CommunityPortal — the forum's editable code lives here

This is the **home of the community forum's code**. The `custom/` folder next to this
README holds the actual forum you edit; the platform reads it from here.

```
Extra/CommunityPortal/
  README.md          ← this map (not shipped)
  custom/            ← THE FORUM CODE — edit these files
    public-routes.php     router (clean URLs → forum pages)
    twofactor-route.php   2FA challenge hook
    forum/
      _shell.php          shared header/footer + ALL the CSS + helpers
      home.php            landing / question list (Newest·Top·Unanswered)
      question.php        a question + its answers + voting
      ask.php  answer.php action.php   post / answer / vote+accept
      profile.php  search.php          member profiles, search
      login.php  register.php  verify.php  forgot-password.php
      reset-password.php  two-factor.php   auth pages
```

## How this connects to the platform

`projects/admin/community/custom` is a **symlink** to this `custom/` folder. So:

- **Edit here** (`Extra/CommunityPortal/custom/…`) — or in the console's **Custom Files**
  editor — and it's the *same files*. There is only one copy.
- The **build** copies this tree into the app; **Rebuild** on the Community Installer
  page refreshes the download.
- This is a dev-machine convenience only. On a live server the forum runs as the
  **built output** (the installer), so the symlink never goes to production.

## What is NOT in this folder (and why)

The forum is a full app, so some of it isn't loose code:

| Part | Where it lives | How to change it |
|------|----------------|------------------|
| Page layouts, fields, tables | `projects/admin/community/config/*.json` | The console's **Designer / Tables / Pages** |
| Auth, timezone, build target, installer toggle | `security.json`, `misc.json`, `output.json` | Console **Security / Misc / Output** |
| Forum **content** (categories, Q&A) | the **database** | Snapshotted into `database.sql` at build time |

## The workflow

1. Edit the code here in `custom/` (and/or design in the console).
2. **Deliverables → Community Installer** shows *“Changes since last build”* → **Rebuild**.
3. **Download ZIP** (auto-rebuilds if needed) → unzip on a server → open `install.php`.

Live locations: console `ppphp.ppradhan.com`, forum `ppradhan.com/community`.
