Skip to content

feat: implement team routes and membership management#314

Open
Harxhit wants to merge 2 commits into
Dev-Card:mainfrom
Harxhit:feat/teams-api
Open

feat: implement team routes and membership management#314
Harxhit wants to merge 2 commits into
Dev-Card:mainfrom
Harxhit:feat/teams-api

Conversation

@Harxhit
Copy link
Copy Markdown
Collaborator

@Harxhit Harxhit commented May 24, 2026

Summary

Closes #44

Implements backend support for Team / Group Cards as described in Product Doc 5.4.

This PR introduces team management APIs, public team profiles, membership management, and QR generation for team pages. Team creation now uses Prisma transactions to ensure atomic writes and prevent partial state.

Additionally, reusable slug utilities were introduced and integrated into the team flow, with related slug generation improvements also applied to events for consistency.

Schema

Added:

  • Team
  • TeamMember

Including:

  • Team ↔ Owner relation
  • Team ↔ TeamMember relation
  • User ↔ Team membership relation
  • Composite membership uniqueness constraint
  • Indexing for Team.slug and TeamMember.userId

APIs

Implemented:

  • POST /api/teams

    • authenticated team creation
    • automatic unique slug generation
    • owner membership creation
  • GET /api/teams/:slug

    • public team profile
    • member profiles and platform links
  • POST /api/teams/:slug/members

    • owner-only member management
    • duplicate and ownership validation
  • DELETE /api/teams/:slug/members/:userId

    • owner removal
    • self-removal support
  • PATCH /api/teams/:slug

    • owner-only team updates
  • DELETE /api/teams/:slug

    • owner-only deletion
  • GET /api/teams/:slug/qr

    • QR generation for team pages

Validation & Error Handling

Added:

  • Zod validation for create/invite/update flows
  • ownership guards
  • authentication and authorization checks
  • Prisma and QR generation error handling

TODO / Follow-up

  • Owner self-removal is currently blocked.
  • Ownership transfer / assigning next owner should be implemented before allowing owner leave/delete flows.

@Harxhit Harxhit marked this pull request as draft May 24, 2026 10:47
@Harxhit Harxhit added gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. critical Includes schema, architecture, or other critical core functionality changes. labels May 24, 2026
@Harxhit Harxhit marked this pull request as ready for review May 24, 2026 11:05
@Harxhit Harxhit requested a review from ShantKhatri May 24, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

critical Includes schema, architecture, or other critical core functionality changes. gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

backend: implement team/group DevCard API for hackathon teams

1 participant