EurekaPad is a specialized note-taking application designed to provide a superior experience for STEM students. It offers a comprehensive set of features tailored to technical note-taking, with a focus on essential tools such as interactive math equations, dynamic graphs, and runnable code blocks.
-
Clone the repository:
git clone https://github.com/zeyu2001/eurekapad cd eurekapad -
Install dependencies:
pnpm install -
Set up environment variables:
- Refer to the Notion engineering onboarding page for instructions on setting up environment variables
- Fill in the required values for:
- Clerk (authentication)
- Convex (backend)
- Azure Blob Storage (file uploads)
- Microsoft Cognitive Services (speech recognition)
-
Start the development server:
pnpm dev -
Open http://localhost:3000 in your browser.
- Rich text editing with custom blocks
- Math equation support
- Interactive graphs powered by Desmos
- Runnable code blocks with syntax highlighting
- Real-time collaboration (powered by Convex)
- Document organization with nested structure
- Dark mode support
- Speech-to-text transcription
This project is a turborepo containing the following packages:
apps/eurekapad: Next.js application and Convex backendpackages/eslint-config: Shared ESLint configurationpackages/prettier-config: Shared Prettier configurationpackages/tiptap-extensions: TipTap extensions used in the editor
This monorepo structure allows for shared code between packages and easy cross-package imports, while keeping the codebase organized. Turborepo solves many problems associated with monorepos, with e.g. incremental builds, caching, task orchestration, etc.
app/: Next.js app router and page componentscomponents/: Reusable React componentsconvex/: Convex backend functions and schemahooks/: Custom React hookslib/: Utility functions and helperspublic/: Static assetsstyles/: Global styles and Tailwind CSS configuration
- Editor:
components/editor/index.tsx - Custom Blocks:
- Code:
components/editor/code/ - Math:
components/editor/math/ - Graph:
components/editor/graph/ - Transcription:
components/editor/transcription/
- Code:
- Document Management:
convex/documents.ts - Navigation:
app/(main)/_components/navigation.tsx - Authentication: Implemented using Clerk (see
app/layout.tsx) - File Uploads:
convex/uploads.tsandlib/client-uploads.ts - Speech Recognition:
components/editor/transcription/transcription-block.tsx
- Follow the existing code style and use ESLint and Prettier for consistency.
- Write unit tests for new features using the preferred testing framework.
- Use the custom UI components from
components/ui/when possible. - When adding new environment variables, update both
.env.exampleand the setup instructions in this README. - Keep the
convex/schema.tsfile updated when modifying the database structure. - Use the
useOptimisticDocumentUpdatehook for a better user experience when updating documents. - Use
contex/http.tsfor webhook callbacks.
Migrations are implemented in convex/migrations.ts. See the Convex documentation
for more information on migrations.
To test a migration before running it:
pnpx convex run migrations:deprecateContent '{"dryRun": true, "fn": "migrations:deprecateContent"}'
To run a migration:
pnpx convex run migrations:deprecateContent '{"fn": "migrations:deprecateContent"}'
These can be run in production with the --prod flag, but only after deploying with pnpx convex deploy.
pnpm run dev: Start the development serverpnpm run build: Build the production applicationpnpm run start: Start the production serverpnpm run lint: Run ESLintpnpm run format: Run Prettier to format code