WordPress Multisite subdirectory stack for the Nayi / Mangali / Bhajantri state portal. Pilot hubs: Bhadradri Kothagudem (/bhadradri-kothagudem/) and Khammam (/khammam/).
Capital Core checklist (Hyderabad · Medchal-Malkajgiri · Rangareddy): see docs/PHASE1-CAPITAL-CORE-LAUNCH.md. Also summarised under Network Admin → TCN Network.
cp .env.example .env
docker compose up -d
docker compose --profile setup run --rm wpcliThen open:
- http://localhost:8080/
- http://localhost:8080/gaurava-vedika/
- http://localhost:8080/khammam/
- http://localhost:8080/bhadradri-kothagudem/
- Admin:
admin/admin(local only)
Seed heritage registry (once):
docker compose run --rm --entrypoint wp wpcli --user=admin eval-file wp-content/tcn-scripts/seed-gaurava.php
docker compose run --rm --entrypoint wp wpcli --user=admin eval-file wp-content/tcn-scripts/seed-protective-vidya-b2b.php
docker compose run --rm --entrypoint wp wpcli --user=admin eval-file wp-content/tcn-scripts/seed-pravasa.php- Pravasa dashboard: http://localhost:8080/pravasa/
- Citation verify:
/pravasa-verify/?token=… - Print certificate:
/pravasa-certificate/?token=…
District hubs now include 5 tabs: Hub · Cultural · Vidya · Rakshana · B2B Co-Op.
Re-run provision anytime: docker compose --profile setup run --rm wpcli
- Install latest WordPress, enable Multisite (subdirectory). Merge
infra/wp-config.multisite.snippet.phpintowp-config.php. SetDOMAIN_CURRENT_SITE,TCN_TELEGRAM_BEARER,TCN_TELEGRAM_BOT_TOKEN. - Use
infra/.htaccess.multisite(Apache) orinfra/nginx.multisite.conf(Nginx). One Let’s Encrypt cert on the apex covers all/district/paths. - Copy
mu-plugins/→wp-content/mu-plugins/. - Copy
themes/tcn-network→wp-content/themes/tcn-network. Network-enable / activate on main site. - Network Admin → TCN Network → Provision / sync pilot district sites (or
wp eval-file scripts/provision-districts.php). - Add each District Admin as Administrator on their site only (
tcn_assign_district_admin( $user_id, $blog_id )). Super Admins stay network-level. - Run Telegram bot:
node telegram-bot/intake-bot.mjswith env vars documented in that file.
POST /wp-json/tcn/v1/telegram/intake— create pending CPT + media sideload + admin inline keyboardPOST /wp-json/tcn/v1/telegram/moderate—{ blog_id, post_id, action: approve|reject }GET /wp-json/tcn/v1/hub/{district}/notices— public notice feed
Local Bearer (Docker): local-dev-bearer-change-me
docker compose run --rm --entrypoint wp wpcli --user=admin eval-file wp-content/tcn-scripts/seed-pilot.php
./scripts/smoke-telegram-rest.sh./scripts/smoke-notice-relay.sh
python3 telegram-bot/notice-relay-bot.pyPOST /wp-json/tcn/v1/relay/noticewith headerX-Relay-Secure-Auth- Publishes CPT
district_notices(templates: utsava / committee / job / achievement) - Bot returns WhatsApp paste text with live URL for volunteers to forward back
./scripts/smoke-smarananjali.sh
# Live bot (step-by-step memorial intake):
node telegram-bot/smarananjali-bot.mjs- Intake:
POST /wp-json/nayi-network-ts/v1/smarananjaliwith headerX-Nayi-Network-Token - Moderate:
POST /wp-json/nayi-network-ts/v1/smarananjali/moderate - Creates draft CPT
tcn_smarana→ Admin Approve → publish + WhatsApp forward link - Models B/C/D (Google Forms posters, Markdown static, custom
wp_smarananjalitable) are documented alternatives — not required while Model A is live
- Create a bot with BotFather; put the token in
.envasTCN_TELEGRAM_BOT_TOKENand setTCN_TELEGRAM_DEFAULT_ADMIN_CHAT_IDto the District Admin group id. - Also set the same token into WordPress:
docker compose run --rm --entrypoint wp wpcli config set TCN_TELEGRAM_BOT_TOKEN "$TCN_TELEGRAM_BOT_TOKEN" --type=constant - Run:
TCN_WP_BASE=http://localhost:8080 TCN_BEARER=local-dev-bearer-change-me TELEGRAM_BOT_TOKEN=... TCN_VOLUNTEER_IDS=YOUR_TG_USER_ID TCN_ADMIN_CHAT_ID=... node telegram-bot/intake-bot.mjs - In Telegram:
/submit notice khammamthen title + body lines; approve via inline buttons.
php tests/self-check.php