Skip to content

Move Together into a standalone app (apps/together) - #523

Merged
lui7henrique merged 9 commits into
mainfrom
cursor/together-standalone-app-08b6
Oct 9, 2026
Merged

lui7henrique merged 9 commits into
mainfrom
cursor/together-standalone-app-08b6

Conversation

@lui7henrique

@lui7henrique lui7henrique commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Describe your changes

Together moves out of the Plotwist web app into its own Next.js app at apps/together. It's an MVP sandbox that can be deployed, measured, and changed on its own before being integrated back into Plotwist. It still uses the Plotwist API for rooms, votes, and the TMDB proxy; the backend and database are not duplicated.

New app (apps/together)

  • Routes have no /together prefix: /[lang], /[lang]/[code], /vote, /matches. /swipe stays as a redirect to /vote.
  • Invite links don't include a language (https://together.plotwist.app/ABC123); the proxy detects the visitor's language and redirects.
  • Its own dictionaries (7 languages), a small API client, and a language context. It does not import anything from apps/web.
  • There's no Plotwist session on this domain. The old login prompt is now a Plotwist sign-up CTA with UTM tags (utm_source=together). Its copy was rewritten so it no longer promises to import saved preferences.
  • The default region comes from the language (pt-BR → BR, ja-JP → JP).
  • Conversion analytics via GA (NEXT_PUBLIC_MEASUREMENT_ID). Events: room_created, invite_shared, room_joined, voting_started, swipe, match_shown, plotwist_cta_clicked.
  • The internal exploration pages (compare, design-preview) were removed.

Web (apps/web)

  • Together's code, translations, nav item, sitemap entry, and layout exception are removed.
  • Old URLs (/together/... and /<lang>/together/...) get a 308 redirect to NEXT_PUBLIC_TOGETHER_URL (default https://together.plotwist.app), keeping the query string.
  • engines.node: 24.x in apps/web and apps/together. Vercel discontinued the Node 20.x set in the project settings, and any new deploy, main included, was failing before the build started.

Backend

  • CORS and client-guard accept the optional TOGETHER_CLIENT_URL. The production deploy sets it to https://together.plotwist.app as a plain env var, not a new SSM parameter.

Monorepo: together#build added to Turbo, README and .env.example for the new app, CLAUDE.md updated.

Deploy order

  1. Create a Vercel project with root directory apps/together, the domain together.plotwist.app, and the env vars from apps/together/.env.example.
  2. Deploy the backend (new allowed origin).
  3. Merge/deploy web. Before that, old /together links would redirect to a domain that doesn't exist yet.

Verification

  • Together: 77 tests passing, typecheck and build OK
  • Web: typecheck OK; 79/81 tests passing. The 2 failures (videos.test.tsx, which makes a network call, and format.spec.ts, which depends on the environment's ICU data) are in files this PR doesn't touch
  • Backend build OK
  • Biome: changed files clean
  • Vercel preview for web: READY on Node 24
  • Dev server: / → /pt-BR, /ABC123?source=whatsapp → /pt-BR/ABC123?source=whatsapp, room pages are noindex

Issue ticket number and link

N/A

Checklist before requesting a review

  • I have performed a self-review of my code
  • If it's an essential feature, I've tested it thoroughly.
  • Do we need to implement analytics? Yes, GA conversion events were added to the Together app.
  • Will this be part of a product update? No, Together becomes a separate sandbox and leaves the Plotwist navigation.
Open in Web Open in Cursor 

cursoragent and others added 8 commits October 9, 2026 22:38
Create apps/together (Next.js 16) with its own root layout, locale proxy,
dictionaries, language context, API/TMDB clients and React Query/sonner
providers. Move the Together routes, components, services and tests from
apps/web with git mv, drop the /together route prefix and make invite
links locale-neutral. Remove the compare/design-preview explorations and
the Plotwist session/preferences prefill (default region now follows the
page locale).

Co-authored-by: Luiz Henrique <7henrique18@gmail.com>
Add a typed track() helper that forwards to gtag only when it is loaded,
inject the gtag script when NEXT_PUBLIC_MEASUREMENT_ID is set, and track
room_created, invite_shared, room_joined, voting_started, swipe,
match_shown and plotwist_cta_clicked at the existing user actions.

Replace the sign-in prompt with a dismissible Plotwist CTA linking to
Plotwist sign-up with together UTM tags, and rewrite its copy in all
seven locales so it no longer implies an import of saved services.

Co-authored-by: Luiz Henrique <7henrique18@gmail.com>
Permanently redirect /together, /together/*, /<locale>/together and
/<locale>/together/* to NEXT_PUBLIC_TOGETHER_URL (default
https://together.plotwist.app), keeping the locale when present and the
query string. Drop the Together nav item, sitemap entry, layout chrome
exception, dictionary sections and Together dictionary contract tests.

Co-authored-by: Luiz Henrique <7henrique18@gmail.com>
Add an optional TOGETHER_CLIENT_URL (URL, trailing slash trimmed) to the
app config and accept it in production CORS origins and the production
Origin/Referer client guard, which would otherwise reject requests from
the new domain with 403.

Co-authored-by: Luiz Henrique <7henrique18@gmail.com>
Add together#build to turbo (NEXT_PUBLIC_* env, .next outputs) and pass
NEXT_PUBLIC_TOGETHER_URL to web#build, exclude the new app's build output
from Biome, stop tracking its tsbuildinfo, and add a README, .env.example
and a CLAUDE.md entry.

Co-authored-by: Luiz Henrique <7henrique18@gmail.com>
Match apps/web, which tracks the file exactly as next dev writes it.

Co-authored-by: Luiz Henrique <7henrique18@gmail.com>
Co-authored-by: Luiz Henrique <7henrique18@gmail.com>
Co-authored-by: Luiz Henrique <7henrique18@gmail.com>
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
plotwist Ready Ready Preview Oct 9, 2026 10:57pm UTC

Request Review

@lui7henrique
lui7henrique marked this pull request as ready for review October 9, 2026 22:54
Co-authored-by: Luiz Henrique <7henrique18@gmail.com>
@lui7henrique
lui7henrique merged commit 5d15dc3 into main Oct 9, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 06994883 Deployed Oct 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants