Skip to content

Feature/connect to community bot#2

Draft
Zaqttack wants to merge 3 commits intomainfrom
feature/connect-to-community-bot
Draft

Feature/connect to community bot#2
Zaqttack wants to merge 3 commits intomainfrom
feature/connect-to-community-bot

Conversation

@Zaqttack
Copy link

Summary

  • Adds a coworking-space live status feature with a bottom-right toast (Open / Closed / Unknown).
  • Introduces a server-side proxy endpoint for Discord bot status so the API token is not exposed to clients.
  • Adds .env.example
  • Updates status polling/caching behavior to a 120-second cadence.

Why

  • Surface coworking availability quickly to users on /coworking-space.
  • Keep STATUS_API_TOKEN server-side and secure.

Related Issue

  • n/a

Changes Made

  • Added app/api/discord-status/route.ts
    • Calls Discord bot status endpoint with bearer token from server env.
    • Normalizes response to safe payload (open|closed|unknown, updatedAt).
    • Adds cache headers (s-maxage=120, stale-while-revalidate=60).
  • Updated components/coworking-space/hero-section.tsx
    • Added bottom-right status toast UI.
    • Shows status (Open / Closed / Unknown) and relative update text.
    • Polls /api/discord-status every 120 seconds.
  • Updated .gitignore to keep .env.example committed while ignoring other .env*.

How To Test

  1. Create .env.local from .env.example and set:
    • STATUS_API_TOKEN
  2. Run app locally:
    • npm ci
    • npm run dev
  3. Open /coworking-space:
    • Confirm bottom-right toast appears.
    • Confirm status shows Open/Closed (or Unknown when token/endpoint unavailable).
    • Confirm relative timestamp text renders.
  4. Validate polling/cache behavior:
    • Keep page open >2 minutes and confirm status refreshes.
    • Hit /api/discord-status directly and inspect response shape.

Checklist

  • I have tested these changes locally
  • I have added/updated tests where appropriate
  • I have updated docs/README where appropriate
  • This PR includes no unrelated changes
  • I have considered security/privacy impact

Breaking Changes

  • None
  • Yes (describe below)

Screenshots (if UI changes)

image

Notes for Reviewers

  • STATUS_API_TOKEN must be set in Vercel project environment variables (repo secrets alone are not enough).
  • Token is never sent to client; browser only calls internal /api/discord-status.
  • Current design intentionally uses 120s polling + 120s server cache to balance freshness and upstream load.

@Zaqttack Zaqttack requested a review from jessebubble February 12, 2026 04:19
@Zaqttack Zaqttack added the enhancement New feature or request label Feb 12, 2026
@vercel
Copy link

vercel bot commented Feb 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v0-nextdevsa Ready Ready Preview, Open in v0 Feb 12, 2026 4:20am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant