Skip to content

Instantly share code, notes, and snippets.

@shricodev
Created June 8, 2025 08:20
Show Gist options
  • Save shricodev/a8e81adee902d7f32944510021863690 to your computer and use it in GitHub Desktop.
Save shricodev/a8e81adee902d7f32944510021863690 to your computer and use it in GitHub Desktop.
Project Understanding (Gemini 2.5 Pro)

Project Title: Collaborative Document Editor

This is a Next.js application for collaborative document editing, built with Liveblocks, Clerk, and Sentry.

File Structure

  • app/: Core application logic (Next.js App Router).
    • (auth)/: Authentication routes (sign-in, sign-up) using Clerk.
    • (root)/: Main application routes (document display, editing).
    • api/: API routes (Liveblocks auth, Sentry).
  • components/: Reusable UI components.
    • editor/: Document editor components.
    • ui/: Generic UI components.
  • lib/: Utility functions and libraries.
    • actions/: Server-side actions (rooms, users).
  • public/: Static assets (icons, images).
  • styles/: CSS files and themes.
  • Configuration Files: next.config.mjs, tailwind.config.ts, liveblocks.config.ts, Sentry configs, etc.

Features

  • User authentication (sign-in, sign-up).
  • Real-time collaborative document editing.
  • Document creation, sharing, and deletion.
  • Notifications.
  • Comments.

Environment Variables

The following environment variables are used in this project. Please ensure they are set up correctly in your environment.

  • CI: Used in next.config.mjs to control the verbosity of Sentry's build logs (e.g., silent: !process.env.CI). Set to true in CI environments to reduce log noise.
  • SENTRY_DSN: Your Sentry Data Source Name for error tracking.
  • NODE_ENV: Specifies the environment (e.g., development, production).

Note: This list might be incomplete. You may need to configure additional environment variables for services like Clerk and Liveblocks. Refer to their respective documentation for more details. Specifically, you will likely need:

  • NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
  • CLERK_SECRET_KEY
  • NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY
  • LIVEBLOCKS_SECRET_KEY

Setup Commands

  1. Clone the repository:
    git clone <repository-url>
    cd <repository-directory>
  2. Install dependencies:
    npm install
    # or
    yarn install
  3. Set up environment variables: Create a .env.local file in the root of the project and add the necessary environment variables.
    CI=
    SENTRY_DSN=
    NODE_ENV=development
    NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
    CLERK_SECRET_KEY=your_clerk_secret_key
    NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY=your_liveblocks_public_key
    LIVEBLOCKS_SECRET_KEY=your_liveblocks_secret_key
  4. Run database migrations (if applicable): (Add details here if database migrations are needed)

Running the Application

  1. Start the development server:
    npm run dev
    # or
    yarn dev
  2. Open your browser and navigate to http://localhost:3000.

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature-name).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature/your-feature-name).
  6. Open a Pull Request.

License

(Add license information here if a license file exists or specify the license, e.g., MIT License.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment