Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Telangana Community Network (TCN)

WordPress Multisite subdirectory stack for the Nayi / Mangali / Bhajantri state portal. Pilot hubs: Bhadradri Kothagudem (/bhadradri-kothagudem/) and Khammam (/khammam/).

Phase 1 launch

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 wpcli

Then open:

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

District hubs now include 5 tabs: Hub · Cultural · Vidya · Rakshana · B2B Co-Op.

Re-run provision anytime: docker compose --profile setup run --rm wpcli

Drop onto a WordPress install

  1. Install latest WordPress, enable Multisite (subdirectory). Merge infra/wp-config.multisite.snippet.php into wp-config.php. Set DOMAIN_CURRENT_SITE, TCN_TELEGRAM_BEARER, TCN_TELEGRAM_BOT_TOKEN.
  2. Use infra/.htaccess.multisite (Apache) or infra/nginx.multisite.conf (Nginx). One Let’s Encrypt cert on the apex covers all /district/ paths.
  3. Copy mu-plugins/ → wp-content/mu-plugins/.
  4. Copy themes/tcn-network → wp-content/themes/tcn-network. Network-enable / activate on main site.
  5. Network Admin → TCN Network → Provision / sync pilot district sites (or wp eval-file scripts/provision-districts.php).
  6. Add each District Admin as Administrator on their site only (tcn_assign_district_admin( $user_id, $blog_id )). Super Admins stay network-level.
  7. Run Telegram bot: node telegram-bot/intake-bot.mjs with env vars documented in that file.

REST (Bearer)

  • POST /wp-json/tcn/v1/telegram/intake — create pending CPT + media sideload + admin inline keyboard
  • POST /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

Seed + Telegram REST smoke

docker compose run --rm --entrypoint wp wpcli --user=admin eval-file wp-content/tcn-scripts/seed-pilot.php
./scripts/smoke-telegram-rest.sh

Notice board relay (WhatsApp → Telegram → Web)

./scripts/smoke-notice-relay.sh
python3 telegram-bot/notice-relay-bot.py
  • POST /wp-json/tcn/v1/relay/notice with header X-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/smarananjali with header X-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_smarananjali table) are documented alternatives — not required while Model A is live
  1. Create a bot with BotFather; put the token in .env as TCN_TELEGRAM_BOT_TOKEN and set TCN_TELEGRAM_DEFAULT_ADMIN_CHAT_ID to the District Admin group id.
  2. 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
  3. 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
  4. In Telegram: /submit notice khammam then title + body lines; approve via inline buttons.

Check

php tests/self-check.php

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages