Scrims · Overview
2 modules · 22 exports · 4 repositories · 12 e2e tests · 3 routes
Teams post when they are looking for a scrim (a practice match), other teams request to play and the poster accepts one. The accepted pairing gets a match page with a chat and map-by-map tracking.
A post (ScrimPost) is made by a side: a team or a pick-up of users. Another side makes a request (ScrimPostRequest) to it and accepting one books the scrim, the post’s side playing as ALPHA and the request’s as BRAVO. The rules are listed under Behaviour below, each with the tests that establish it.
Lifecycle
Section titled “Lifecycle”stateDiagram-v2 [*] --> Open: posted on /scrims/new Open --> Open: requests sent and withdrawn Open --> [*]: deleted, or another scrim of its players booked Open --> Booked: a request accepted Booked --> Canceled: canceled before the start Booked --> Locked: tracking idle long enough after the start Canceled --> [*] Locked --> [*]
/scrims lists posts until 3 hours past their start, booked ones only to their players. A post nobody accepted is never deleted, it just stops being listed.
Map-by-map
Section titled “Map-by-map”flowchart LR submit["A side submits its map list"] --> pool["Pool: union of the submitted lists"] pool --> next["Next map generated, avoiding played ones"] next --> report["Winner reported"] report --> next next -. "pick or replay a map" .-> next report -. "undo the latest report" .-> next
Every change is broadcast through the scrim’s chat room so both sides’ pages update.
Behaviour
The rules the e2e tests establish, from the JSDoc of their describes.
Posting
A post is made as a team or as a pick-up of users the author picks, who are saved for later posts. Its card shows the start window and the tournament whose maps are played, and marks a post only an association can see.
Requests
Other teams request a post from the Available tab, picking the start when the post has a start window, and can withdraw the request while it is pending. The post's owner is notified of each request.
Accepting
Accepting a request books the scrim: it moves to the Booked tab with a page of its own, the requester is notified and the owner's other pending posts starting within an hour of it are deleted.
Canceling
A booked scrim is canceled from its page with a reason, and is then shown as canceled.
Filters
Filters (here LUTI divisions) narrow the Available tab and can be saved as the user's default. Once the user edits the filters the page's own wins over the saved default.
Map-by-map
Once booked, each side submits a map list (the post's tournament or a map pool) and maps are generated one at a time from the lists, each reported map generating the next. The latest report can be undone and the current map swapped for a replay of the previous one. Stats count the reported maps from the viewer's side.
Availability
The members' weekly availability suggests starts when posting and shows how much of the viewer's roster could play each post. A slot one player short of a full team is still offered, as one to grab a sub for.
Routes
3 of 3 pages rendered by an e2e test in the last pnpm run docs:capture.