Saptrang Creators Community
- Year
- 2026
- Role
- Design and engineering
- Status
- Live

A home for the community
Saptrang brings creators in Gujarat together through events, profiles, groups and a community feed. I built the member-facing site and a separate staff console for verification, event management and check-in.
Both Next.js apps live in a Bun workspace coordinated by Turborepo. Shared packages handle authentication, database access, events, email and storage. Staff and members use different interfaces without duplicating the underlying rules.
How it works
Explore the shared infrastructure, a registration request or an approval email. Select a component for its implementation details.
Shared packages
Turborepo coordinates the two apps and shared packages inside a Bun workspace. Domain logic is shared; member and staff interfaces remain separate.
Claim capacity + write registration
The capacity increment and registration insert run in one data-modifying SQL statement. Concurrent requests recheck capacity on the event row, preventing two claims for the last seat.
Verify signature + claim delivery
The job route verifies the QStash signature, checks that approval remains active and claims the delivery before sending. Stale sending records can be reclaimed.
All implementation notes
Architecture
- Community app
- The member-facing Next.js app owns community pages, event registration and verification requests.
- Staff console
- A separate Next.js app handles staff workflows. Both apps reuse server packages while keeping their interfaces distinct.
- Shared packages
- Turborepo coordinates the two apps and shared packages inside a Bun workspace. Domain logic is shared; member and staff interfaces remain separate.
- Neon
- Drizzle models the records. PostgreSQL owns members, registration capacity and the event-message outbox. Redis does not own these durable records.
- Upstash Redis
- Sliding-window limits are defined per action. Event-level and global registration caps prevent a new event slug from bypassing throttling.
- QStash
- Verification emails use QStash jobs. Scheduled QStash calls also trigger the sweeper that drains the separate database event outbox.
- R2
- Cloudflare R2 holds uploaded bytes. Database records hold references and application state.
- Community app: uses shared server packages (Shared packages).
- Staff console: uses shared server packages (Shared packages).
- Shared packages: reads and writes durable records (Neon).
- Shared packages: checks rate-limit counters (Upstash Redis).
- Shared packages: signs media requests (R2).
- Community app: publishes jobs and receives scheduled calls (QStash).
Registration
- Register for an event
- The server resolves the member session and validates the event request before writing a registration.
- Check request limits
- Upstash Redis applies a per-event sliding window alongside a global cap. The general limiter fails open on a Redis outage; authorization and validation still run.
- Claim capacity + write registration
- The capacity increment and registration insert run in one data-modifying SQL statement. Concurrent requests recheck capacity on the event row, preventing two claims for the last seat.
- Return registration state
- The interface presents the stored registration state. Cancellation releases capacity; waitlist promotion is a separate retryable operation.
- Register for an event: continues to (Check request limits).
- Check request limits: continues to (Claim capacity + write registration).
- Claim capacity + write registration: continues to (Return registration state).
Email delivery
- Approve verification
- Approval state is recorded separately from email delivery. A revoked approval must not produce an outdated approval email.
- Publish QStash job
- The web app publishes a verification job with a deduplication identifier. Provider delivery is tracked separately from queue publication.
- Verify signature + claim delivery
- The job route verifies the QStash signature, checks that approval remains active and claims the delivery before sending. Stale sending records can be reclaimed.
- Send with Resend
- Provider acceptance is not proof that the recipient received the email. The delivery record retains attempt and provider information.
- Track delivery events
- Resend webhook events update the delivery record. Staff can distinguish queue state, provider acceptance and final delivery events.
- Approve verification: continues to (Publish QStash job).
- Publish QStash job: continues to (Verify signature + claim delivery).
- Verify signature + claim delivery: continues to (Send with Resend).
- Send with Resend: continues to (Track delivery events).
Engineering decisions
- Rate limits belong to actions. Upstash Redis applies sliding-window limits, pairing per-event caps with a global cap. If Redis fails, the general limiter stays available; session, role and input checks still protect writes.
- The database owns capacity. A conditional SQL CTE claims a seat and writes the registration in one statement. Cancellation releases capacity; waitlist promotion is separate and retryable.
- Delivery has a lifecycle. Verification emails use signed QStash jobs and Resend delivery events. Event communications use a PostgreSQL outbox drained by a scheduled sweeper, so rescheduling an event can update its pending messages in the database.
The event plan starts with free registrations and explicit consistency rules. Shared Bun tests cover form compilation, ticket tokens, schedules and scan verdicts. Payments would need their own reservation and order model.