# TownPost

TownPost is a trusted local bulletin and community information platform for Silverton, Oregon.

It is not designed to copy Facebook, Reddit, Nextdoor, or other engagement-driven social platforms. The goal is useful local information, source-backed community visibility, safer organization discovery, and fewer scam/predatory patterns.

## Current Status

Alpha / proof-of-concept.

Primary town:

- Silverton, Oregon

Current focus:

1. Make posts and event cards visibly acceptable.
2. Use one canonical renderer.
3. Keep source-backed information useful.
4. Promote verified organizations.
5. Build clear operations documentation.

## Core Product Principles

- Useful first.
- Community second.
- Social engagement third.
- No predatory engagement loops.
- No outrage farming.
- No fake urgency.
- No hidden deletion as a normal workflow.
- Human override for important systems.
- Public source links preserved where practical.

## Stack

- Static frontend
- Vanilla JavaScript
- Supabase backend
- Cloudflare Pages / domain layer
- GitHub source control

## Important Files

- `index.html` — main shell and script load order
- `app.js` — core app bootstrap and routing
- `townpost-renderer.js` — canonical card renderer
- `townpost-content-quality.js` — content quality scoring helpers
- `townpost-magazine-cards.css` — legacy/current card styling
- `OPS_REGISTRY.md` — external systems registry
- `SOURCE_POLICY.md` — source hierarchy and publishing rules
- `DATA_MODEL.md` — database architecture notes
- `RECOVERY.md` — recovery order and failure notes
- `LEGAL.md` — copyright/legal framework

## Environment Variables / Secrets

Do not store actual secret values in this repository.

Track secret names, storage locations, and rotation procedures in `OPS_REGISTRY.md`.

Known public/client values may exist for browser access, but privileged service keys must remain outside the repo.

## Local Setup

This project is currently a lightweight static app.

Typical local preview:

```bash
python3 -m http.server 8000
```

Then open:

```text
http://localhost:8000
```

## Commands

```bash
npm run scrape:sources
```

Runs the source importer.

## Data Flow

```text
Source
→ Source Item
→ Candidate
→ Quality Score
→ Verification
→ Approval
→ Published Card
```

## Moderation Model

TownPost prefers reversible moderation.

Use:

- Hide
- Unpublish
- Review
- Reject
- Archive

Avoid destructive deletion except for clearly invalid test data or explicit owner-approved cleanup.

## Deployment Notes

Deployment currently depends on GitHub + Cloudflare Pages.

Keep legal footer, source policy, and operations links present but quiet.

## Known Issues

- Legacy renderers still exist and are intentionally preserved.
- `townpost-renderer.js` should load last to remain canonical.
- Some imported content is technically valid but low value.
- Organization directories need additional verification.
- Church and veteran registries are seeded but not complete.

## Next Priorities

1. Finish organization directory rendering.
2. Verify individual churches.
3. Verify VFW/veteran resources.
4. Integrate content quality scoring into publishing flow.
5. Improve event cards with date, time, location, title, and official link.
6. Continue source cleanup.

## Operating Rule

If a system exists, it should be discoverable through documentation.
