Skip to content

Feature: Create, update, delete, and list events

Summary

CRUD for events in the Event Tracker.

User story

As a student, I want to create and manage events so others can discover and attend them.

Scope

  • Backend: /events REST endpoints (create, list, get, patch, delete).
  • Validation (name, category enum, dateTime, locationName).
  • Sort by dateTime asc; max 200 results.
  • Frontend: forms & pages to create/edit, list & view.

API / Data

  • Model: Event { name, category, description?, dateTime, locationName, latitude?, longitude?, creatorId, attendees[] }
  • Index: { category: 1, dateTime: 1 }

Tasks

  • Backend controllers & routes (with validation).
  • Unit/integration tests (Jest + Supertest).
  • Frontend pages/components (React + TS).
  • Frontend tests (Vitest + RTL).
  • Update README + Wiki.

Acceptance criteria (Given/When/Then)

  • Given valid payload, when POST /events, then 201 with created event.
  • Given events exist, when GET /events, then 200 list sorted by dateTime.
  • Given owner + valid payload, when PATCH /events/:id, then 200 updated.
  • Given owner, when DELETE /events/:id, then 204.
  • Frontend flows allow create, read, update, delete with success/error states.

Test notes

  • Edge: missing required fields → 400; non-owner update/delete → 403; not found → 404.

Dependencies

  • Depends on: “Secure authentication via JWT”.