Skip to content

Refactor/backend - #54

Merged
MohamedRamadanSaudi merged 5 commits into
devfrom
refactor/backend
Mar 6, 2026
Merged

Refactor/backend#54
MohamedRamadanSaudi merged 5 commits into
devfrom
refactor/backend

Conversation

@MohamedRamadanSaudi

Copy link
Copy Markdown
Owner

This pull request refactors the backend codebase to improve modularity and clarity by reorganizing DTOs, updating service dependencies, and cleaning up handler logic. The most important changes include moving DTOs to a dedicated package, updating handler imports and usages, restructuring service initialization for summarization, and removing redundant lobby request handling logic.

DTO and Handler Refactoring

  • All DTO structs previously in internal/types are now moved to a new internal/handlers/dto package, and all handler files are updated to import and use DTOs from this new location. This improves code organization and separation of concerns. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • All handler logic (e.g., LiveKitHandler, LobbyHandler, MeetingHandler, UserHandler) now consistently uses DTOs from the dto package instead of the old types package, including request parsing and response formatting. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]

Service and Repository Initialization

  • The main server initialization logic in main.go is updated to use new repositories (SummarizerSessionRepository, AudioChunkRepository, TranscriptRepository) and to restructure service dependencies for summarization, normalization, and transcription. This enables more granular data management and improves dependency clarity.
  • Worker initialization is updated to use the new session repository instead of the old summarizer repository, ensuring consistency with the new data model.

Lobby Handler Cleanup

  • The LobbyRespondRequest DTO and the corresponding HTTP fallback handler method for approving/rejecting lobby requests are removed, simplifying the lobby join flow and reducing redundant code. [1] [2]

File Renaming and Package Changes

  • DTO files are renamed from types/*.go to handlers/dto/*.go and their package declarations are updated accordingly, reflecting the new organizational structure. [1] [2] [3] [4] [5]

Dependency Chain Updates

  • The summarization, normalization, and transcription services now receive updated dependencies (repositories and services) to match the new architecture, improving maintainability and scalability.

…d transcript repos

Replace the monolithic SummarizerRepository with three focused repositories: SummarizerSessionRepository, AudioChunkRepository, and TranscriptRepository. Update service constructors and logic (summarizer, transcription, normalization, summarization, user, meeting) to use the new repos and adjusted method names, update workers and main wiring accordingly, and remove the old summarizer repository file. This refactor separates concerns for session, chunk, and transcript operations and updates cleanup/status flows to use the new repository interfaces.
- Create internal/handlers/dto package with five files:
  meeting.go, user.go, livekit.go, lobby.go, summarizer.go
- Move all HTTP DTOs and mapper functions from internal/types into dto
- Update handlers (livekit, lobby, meeting, user) to import from dto
- Update services (user, summarizer) to import from dto
- Delete internal/types package
- Break routes.go into auth.go, user.go, meeting.go, livekit.go, lobby.go
  (same package, single SetupRoutes entry point delegates to each)
- Remove POST /lobby/respond (HTTP fallback) — lobby approval is
  handled exclusively over WebSocket; delete RespondToRequest handler,
  LobbyRespondRequest DTO, and related route/middleware wiring
- Remove frontend createUser / updateUser from userAdminService —
  these called POST /users and PATCH /users/:id which never existed
  in the backend; drop unused CreateUserRequest, UpdateUserRequest,
  and UserUpdateResponse types
Replace the boolean fetch lock with a shared fetch promise in userFetcher so concurrent requests return the same promise instead of erroring. This keeps the existing logging and error handling but clears the promise once complete. Update authActions to remove early returns that depended on the old lock, allowing token storage and initialization to proceed even if a user fetch is in progress.
@vercel

vercel Bot commented Mar 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mini-meeting Ready Ready Preview, Comment Mar 6, 2026 11:17pm

@MohamedRamadanSaudi
MohamedRamadanSaudi merged commit 5a02cf6 into dev Mar 6, 2026
4 checks passed
@MohamedRamadanSaudi
MohamedRamadanSaudi deleted the refactor/backend branch March 6, 2026 23:20
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.

1 participant