Skip to content

2. Club Routes

Abdullah bin Ammar edited this page May 20, 2025 · 2 revisions

Routes Overview

Authed Routes

Method Route Access Description
GET /create Admin only Displays the form to create a new club.
POST /create Admin only Processes club creation.
GET /:clubId/dashboard Club Admin Loads the club's dashboard.
GET /:clubId/edit Club Admin Displays the edit form for the club.
POST /:clubId/edit Club Admin Updates club details.
GET /:clubId/assign-admin Club Admin Shows the form to assign a new club admin.
POST /:clubId/assign-admin Club Admin Assigns a new admin to the club.

Public Routes

Method Route Access Description
GET / Public Retrieves a list of all clubs.
GET /:clubId Public Fetches details of a specific club.

Key Takeaways

  • Protected routes require authentication (isAuthenticated) and role validation (isAdmin or isClubAdmin).
  • Admins can create clubs and assign admins, while club admins can edit and manage their clubs.
  • Public routes allow users to view club details without logging in.
  • Follows MVC structure by using clubController to handle business logic.

Clone this wiki locally