High Level Design - gcivil-nyu-org/team4-mon-fall26 GitHub Wiki
Context
PlayNYU is a web platform for NYU intramural sports, built as a single Django application. This design covers Epic E1 (Accounts, Verification & Profiles), which every other epic depends on, because users must be verified and have a profile before they can join teams or play matches. The flows below show how a user registers and verifies with an NYU email, views and edits a profile, how matchmaking checks a player's game profile, and how a team captain adds a player.
The diagrams use the same components throughout:
| Component | Responsibility |
|---|---|
| Registered / Verified User | A student with an NYU account. Every verified user is a Casual Player first. |
| Client-side Pages | Browser pages (profile, edit profile, matchmaking) that send requests and display results. |
| Server-side Profile Service | Validates the session, owns profile and game profile data, and decides whether a game profile is complete. |
| Server-side Matchmaking Service | Validates the session, asks the Profile Service for the game profile, and manages the matching queue. |
| Server-side Registration Service | Checks NYU email, creates unverified accounts, and verifies them from the email link. |
| Back-end Database | Stores users, profiles and game profiles. The specific database technology is not yet decided. |
| Email Service (SMTP) | Sends the confirmation email to the user's NYU address. |
In every diagram, solid arrows represent requests and dashed arrows represent responses.
Register and Verify
E1-1 View Profile
A registered user opens their profile page, and the client requests the profile for the currently signed-in user from the Profile Service. The service validates the session and looks up that user's profile in the database. If a profile exists, the service returns the saved profile data and the client displays it. If no profile exists, the service returns a “Profile not found” response, and the client displays a missing-profile message with an option to create a profile. Solid arrows in the diagram represent requests; dashed arrows represent responses.
E1-2 Edit Profile
A verified user opens Edit Profile. The server checks that they are signed in and own the profile, loads the current values from the database and shows the edit form. The user changes their details and submits. If validation fails, the update is rejected: errors are shown and nothing is saved. The user corrects the values and resubmits. When validation passes, the changes are saved in the database and the user is redirected to their profile page, which shows the update. Solid arrows are requests and dashed arrows are responses.
E1-3 Matchmaking Reads Game Profile
A registered user clicks "Find random match," and the client sends a match request to the Matchmaking Service. The service validates the session and asks the Profile Service for the user's game profile, rather than reading the database itself. The Profile Service looks up the game profile in the database and owns the rule for whether it is ready for play, so it checks whether the profile is complete. If it is complete, the Profile Service returns the game profile, Matchmaking adds the user to the matching queue (202), and the client displays a "Searching for match" message. If the profile is missing or incomplete, the Profile Service returns ProfileIncomplete, Matchmaking responds with a 409, and the client displays a message telling the user to create their game profile first, with a link to the Edit Profile page. Solid arrows in the diagram represent requests; dashed arrows represent responses.
E1-4 Team Captain Adds a Player
A team captain enters a player’s NYU email on the roster page and clicks “Add player.” The client sends the request to the Team Service, which validates the session and confirms the caller is the team’s captain. The Team Service asks the Profile Service for the verified player, and the Profile Service looks up the player’s profile in the database and returns it. The Team Service saves the roster entry in the database and returns the updated roster, and the client shows the new player on the roster. Solid arrows in the diagram represent requests; dashed arrows represent responses.
User Stories
E1-1 View Profile
- As a verified user, I want to open my profile page and see my saved details so that I can check what captains and other players see.
- As a verified user who has not created a profile yet, I want to see a "Profile not found" message with a Create Profile option so that I know what to do next.
- As a verified user, I want my profile to load only when I am signed in so that my information stays private.
E1-2 Edit Profile
- As a verified user, I want to edit my profile information so that my details stay accurate and up to date.
- As a verified user, I want to see why my update was rejected and know that nothing was saved so that I can fix the problem.
- As a verified user, I want to correct my details and submit again after a rejection so that I can finish my update without starting over.
- As a verified user, I want to be redirected to my profile page after a successful save so that I can see my changes right away.
E1-3 Matchmaking Reads Game Profile
- As a verified player, I want to click "Find random match" and be added to the matching queue when my game profile is complete so that I can start looking for a match.
- As a verified player with a missing or incomplete game profile, I want to be told to create my game profile first, with a link to the edit page, so that I can fix it and try again.
- As a team, I want the Profile Service to be the only place that decides whether a game profile is ready for play so that matchmaking and profiles stay consistent.
E1-4 Team Captain Adds a Player
- As a team captain, I want to add a player to my roster using their NYU email so that I can build my team.
- As a team captain, I want to see the player on my roster right after adding them so that I know it worked.
- As a team, I want only the team’s captain to be able to add players so that rosters cannot be changed by other users.