Skip to content

feat(events): add Event + User entities, REST API, and MergeAll#373

Closed
mmm-byte wants to merge 2 commits into
nestjs:masterfrom
mmm-byte:feature/events-api
Closed

feat(events): add Event + User entities, REST API, and MergeAll#373
mmm-byte wants to merge 2 commits into
nestjs:masterfrom
mmm-byte:feature/events-api

Conversation

@mmm-byte

Copy link
Copy Markdown

Adds a full Events feature on top of the nestjs/typescript-starter boilerplate:

Domain

  • Event entity (id, title, description?, status, startTime, endTime, timestamps, ManyToMany invitees)
  • User entity (id, name, events: string[], ManyToMany invitedEvents)
  • EventStatus enum: TODO | IN_PROGRESS | COMPLETED

API

  • POST /events create an event
  • GET /events/:id retrieve an event
  • DELETE /events/:id delete an event
  • POST /users/:id/merge-events MergeAll for a user
    • sweeps the user's events, clusters overlaps
    • creates a single merged event spanning min(start)..max(end)
    • appends titles/descriptions with ' | '
    • picks a 'reasonable' status (IN_PROGRESS > COMPLETED > TODO)
    • union of invitees is preserved
    • deletes the originals and rewrites every invitee's events[] list
  • Global ValidationPipe enforces DTO rules

Stack

  • @nestjs/typeorm + better-sqlite3 (zero-setup local DB)
  • class-validator / class-transformer
  • DTO: CreateEventDto, CreateUserDto

Tests (per FAQ #1: both)

  • 13 unit tests (mocked TypeORM repositories) across 3 suites
    • events.service.spec.ts
    • events.controller.spec.ts
    • users.controller.spec.ts
  • 3 e2e tests against a real SQLite file
    • events.e2e-spec.ts boots the full Nest app + supertest
    • exercises create user, create event, get, merge, delete

Docs

  • README.md rewritten with API table, run instructions, curl recipe, and demo-video script

Removes

  • src/app.controller.ts, src/app.service.ts, src/app.controller.spec.ts (Hello World boilerplate replaced by the events feature)
  • test/app.e2e-spec.ts (replaced by test/events.e2e-spec.ts)

mmm-byte added 2 commits July 22, 2026 19:56
Adds a full Events feature on top of the nestjs/typescript-starter boilerplate:

Domain
- Event entity (id, title, description?, status, startTime, endTime,
  timestamps, ManyToMany invitees)
- User entity (id, name, events: string[], ManyToMany invitedEvents)
- EventStatus enum: TODO | IN_PROGRESS | COMPLETED

API
- POST /events                              create an event
- GET  /events/:id                          retrieve an event
- DELETE /events/:id                        delete an event
- POST /users/:id/merge-events              MergeAll for a user
  * sweeps the user's events, clusters overlaps
  * creates a single merged event spanning min(start)..max(end)
  * appends titles/descriptions with ' | '
  * picks a 'reasonable' status (IN_PROGRESS > COMPLETED > TODO)
  * union of invitees is preserved
  * deletes the originals and rewrites every invitee's events[] list
- Global ValidationPipe enforces DTO rules

Stack
- @nestjs/typeorm + better-sqlite3 (zero-setup local DB)
- class-validator / class-transformer
- DTO: CreateEventDto, CreateUserDto

Tests (per FAQ nestjs#1: both)
- 13 unit tests (mocked TypeORM repositories) across 3 suites
  * events.service.spec.ts
  * events.controller.spec.ts
  * users.controller.spec.ts
- 3 e2e tests against a real SQLite file
  * events.e2e-spec.ts boots the full Nest app + supertest
  * exercises create user, create event, get, merge, delete

Docs
- README.md rewritten with API table, run instructions, curl recipe,
  and demo-video script

Removes
- src/app.controller.ts, src/app.service.ts, src/app.controller.spec.ts
  (Hello World boilerplate replaced by the events feature)
- test/app.e2e-spec.ts (replaced by test/events.e2e-spec.ts)
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.

2 participants