Skip to content

Conversation

@TheCommandCat
Copy link
Owner

@TheCommandCat TheCommandCat commented Jul 15, 2025

This PR adds full support for managing multiple concurrent election events instead of a single global event. Here’s what’s new:

šŸš€ Features

  • šŸ“… Multi‐Event CRUD
    • Endpoints:
    • GET /api/admin/events
    • POST /api/admin/events
    • PUT /api/admin/events/:eventId
    • DELETE /api/admin/events/:eventId
      • Public:
    • GET /public/events
    • GET /public/events/:eventId
  • šŸ”‘ Event‐Scoped Data
    • All collections (members, mm‐members, rounds, votes, cities) now include an eventId field
    • Queries automatically filter by eventId to isolate each event’s data
  • šŸ§‘ā€šŸ’» UI Changes
    • Admin Events List page for creating, editing, deleting and selecting events
    • Per‐event admin console at /admin/events/:eventId/...
    • Voter UI prompts user to select an active event before joining
  • šŸ”„ Routing & Guards
    • Middleware validates eventId on all API routes
    • Legacy single‐event routes redirect to the new events list

šŸ› ļø Refactors

  • šŸ—ƒļø Database schema extended: every record now stores eventId: ObjectId
  • šŸ”„ Updated service layers and React hooks to pass and consume eventId
  • šŸ“¦ Removed hardcoded ā€œsingle eventā€ logic throughout backend and frontend

āœ… Migration & Backwards Compatibility

  • Existing data is back‐filled with a default eventId so single‐event setups continue working
  • Admin flows fall back to the ā€œdefaultā€ event if no other events exist

Closes #8

@TheCommandCat TheCommandCat force-pushed the multi-event branch 3 times, most recently from d629639 to 3180df6 Compare July 18, 2025 08:05
This commit includes several refactorings and improvements across the backend and CI configurations:

- Updates dependencies and configurations for improved stability and performance.
- Implements enhanced error handling and logging for easier debugging.
- Improves code readability and maintainability by applying consistent formatting.
- Addresses minor bugs and inconsistencies in the backend logic.
- Improves round locking and unlocking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support N events

2 participants