How dreamographer/zensync-client works
Project Type and Purpose
• It’s a full-stack web application built with Next.js (using the new app directory structure) intended for real-time collaboration.
• Key functionalities include user authentication (login, signup, verify email), a collaborative dashboard, document publishing with public previews, and real-time meeting rooms (integrating features like audio and shared canvas).
Analyzing the File Structure
• The top level includes configuration files (Dockerfile, ESLint, Tailwind, PostCSS, and TS configs) indicating both development environment setup and containerized deployment.
• The src directory is the heart of the application. Within it:
• The /app subdirectory is organized by logical route groups:
▪ "(auth)" handles login, signup, and email verification.
▪ "(landing)" serves the marketing/landing page.
▪ "(main)" splits into sub-sections like "dashboard," "room" (for real-time collaboration in whiteboard or meeting scenarios), and "public" (for published document previews).
• The /api subdirectory under /app contains endpoints such as:
▪ edgestore – likely handling collaborative state storage.
▪ generate – possibly powering document publishing or AI auto-complete features.
▪ livekit – integrating audio connectivity for meeting rooms.
• Dedicated directories for UI components exist (dashboard, editor, room, landing-page, global, videoRoom, etc.), which keep the frontend modular and reusable.
• A /Types folder defines TypeScript types. This ensures strong typing for core entities like document structures, user interfaces, and workspace details.
• Integration with Liveblocks (see liveblocks.config.ts) suggests real-time state sharing among collaborative clients.
a. Main Components:
• Frontend Client:
• Built with Next.js and React.
• Separated user areas: Authentication, Landing Page, Dashboard, Collaborative Room, and Public Preview.
• API Layer / Backend Endpoints:
• RESTful or Route-based API endpoints (e.g., /api/edgestore, /api/generate, /api/livekit) handling data mutations, collaboration state, AI-based operations, and media connectivity.
• Real-Time Collaboration Services:
• Liveblocks integration for real-time state management (e.g., cursor presence, collaborative whiteboard changes).
• Possibly third-party services (e.g., Livekit for audio connectivity).
• Containerization & Deployment:
• Dockerfile indicates that the app is containerized for deployment.
• GitHub Actions (in .github/workflows) for CI/CD processes.
• Static Assets:
• Public directory with logos, banners, and feature imagery.
b. Relationships & Interactions:
• The Frontend interacts with the API endpoints to fetch and update document data, workspace details, and collaboration state.
• Real-time updates propagate via Liveblocks and direct API calls.
• The dashboard serves as the hub where navigation triggers various interactions (e.g., switching workspaces, editing documents, joining a collaborative room).
• For the meeting room, there’s integration with Livekit (audio streaming) and real-time sharing of whiteboard content.
• Authentication flow connects the (auth) routes with secure API endpoints.
c. Architectural Patterns / Design Principles:
• Use of Next.js app directory indicates server-side rendering (SSR) and client-side interactivity.
• Separation of concerns: distinct modules for auth, landing, main functionality (dashboard, room) keep UI and business logic separate.
• API endpoints serve as a microservice-like interface within the project.
• Containerization and CI/CD pipelines promote robust deployment practices.
d. Relevant Technologies and Frameworks:
• Next.js for routing, SSR, and API handling.
• React for building interactive UIs.
• Tailwind CSS for styling.
• Liveblocks for managing real-time collaboration state.
• Possibly AI integration (auto-complete) via endpoints like /api/generate.
• Livekit for handling audio and media streaming.
• TypeScript for static type safety.