Skip to content

Project View Page (Participant + Organizer + Judge + Admin β€” Permission-Based)Β #19

@abhishek-nexgen-dev

Description

@abhishek-nexgen-dev

🧠 What are we building?

We are building a Project View Page where users can see and manage projects.

This page is used by:

  • πŸ§‘β€πŸ’» Participants β†’ see their own projects
  • 🏒 Organizers β†’ see all projects in their community/events
  • βš–οΈ Judges β†’ see assigned projects
  • πŸ›‘οΈ Admins β†’ see everything

πŸ‘‰ It is ONE page, but behavior changes based on role.


🎯 Goal

Create a clean, responsive page that:

  • shows a list of projects
  • supports actions (view, edit, delete, score)
  • changes UI based on permissions
  • works for events, hackathons, workshops

🧠 Key Idea (IMPORTANT)

Same Page β†’ Different Role β†’ Different Actions

πŸ—οΈ Where will this page be used?

/participant/projects
/organizer/projects
/community/:id/projects
/event/:id/projects
/judge/projects
/admin/projects

πŸ‘‰ Use one reusable component, not separate pages.


πŸ“¦ Page Layout

Sidebar
Header (title + actions)
-------------------------
Search + Filters
-------------------------
Project Table
-------------------------
Pagination / Empty State

πŸ”Ή Sidebar

Use existing sidebar.

Highlight Projects tab.


πŸ”Ή Header

Show:

  • Page title:

    • "My Projects" (participant)
    • "Community Projects" (organizer)
    • "Assigned Projects" (judge)
  • Button:

    • βž• Create Project (only for participant)

πŸ” Filters & Search


Search

  • search by project name

Filters

  • Status:

    • Draft
    • Submitted
    • Approved
  • Type:

    • Hackathon
    • Event
    • Workshop

Sort

  • Latest (default)
  • Oldest
  • A β†’ Z

πŸ“Š Project Table


Common Columns (for all)

  • Project Name
  • Event Name
  • Type
  • Status
  • Last Updated

Extra Columns (based on role)


πŸ§‘β€πŸ’» Participant

  • Actions:

    • View
    • Edit (only draft)
    • Delete

🏒 Organizer

  • Extra:

    • Owner Name
  • Actions:

    • View
    • Delete

βš–οΈ Judge

  • Extra:

    • Score
  • Actions:

    • View
    • Score

πŸ›‘οΈ Admin

  • Actions:

    • View
    • Delete
    • Suspend

⚑ Actions (What user can do)


πŸ‘οΈ View

  • open project details page

✏️ Edit

  • only participant
  • only draft projects

πŸ—‘οΈ Delete

  • show confirmation modal
  • call delete API

⭐ Score (Judge)

  • open modal
  • submit score

βš™οΈ API


Get Projects

GET /api/v1/projects

Query Example

?communityId=123
&eventId=456
&status=submitted
&page=1

Delete Project

DELETE /api/v1/projects/:id

Score Project

POST /api/v1/projects/:id/score

πŸ” Permissions (VERY IMPORTANT)


Backend must enforce:

  • Participant β†’ only own projects
  • Organizer β†’ only their community
  • Judge β†’ only assigned
  • Admin β†’ all

πŸ‘‰ Do NOT trust frontend role


🧩 States to Handle


Loading

  • show skeleton table

Empty

No projects yet
[ Create Project ]

No Results

No matching projects

Error

  • show message + retry

πŸ›‘οΈ Edge Cases


  • no projects
  • only drafts
  • delete last project
  • API fails
  • unauthorized delete

🎨 UI Requirements


  • responsive (mobile + desktop)
  • clean table layout
  • status badges (color)
  • action menu (3 dots)
  • proper spacing

πŸ§ͺ What to test


  • participant sees only own projects
  • organizer sees community projects
  • judge sees assigned projects
  • admin sees all projects
  • edit only works for drafts
  • delete works with confirmation
  • filters work
  • search works
  • pagination works

πŸ“‚ Suggested File Structure

/projects
  β”œβ”€β”€ index.tsx
  β”œβ”€β”€ components/
  β”‚    β”œβ”€β”€ ProjectTable.tsx
  β”‚    β”œβ”€β”€ Filters.tsx
  β”‚    β”œβ”€β”€ ActionsMenu.tsx
  β”‚    β”œβ”€β”€ DeleteModal.tsx
  β”‚    └── ScoreModal.tsx

πŸš€ Future Improvements (Optional)

  • bulk delete
  • real-time updates
  • analytics
  • project tags

βœ… Done When

  • page works for all roles
  • permissions correctly applied
  • UI responsive
  • API integrated
  • no crashes / edge cases handled

🎯 Priority

πŸ”₯ High (Core feature)


🏁 Final Note

This page is used everywhere in CommDesk.

πŸ‘‰ Keep it:

  • simple
  • clean
  • permission-driven

πŸ‘‰ Focus on:

Correct data + correct permissions > fancy UI

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions