-
Notifications
You must be signed in to change notification settings - Fork 37
Excalidraw onboarding doc added #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andr0306
wants to merge
1
commit into
koldovsky:main
Choose a base branch
from
andr0306:homework
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,271 @@ | ||
| # Excalidraw Onboarding | ||
|
|
||
| ## 1. Project Overview | ||
|
|
||
| Excalidraw is an open-source drawing and whiteboard project. It lets people create diagrams, wireframes, notes, and sketches with a hand-drawn look. | ||
|
|
||
| It solves a simple problem: making visual ideas easy to create and share without using heavy design software. The project includes both the reusable Excalidraw library and the full web app used on `excalidraw.com`. | ||
|
|
||
| Main features: | ||
|
|
||
| - Infinite canvas for free-form drawing | ||
| - Hand-drawn visual style | ||
| - Shapes, arrows, lines, text, and free-draw tools | ||
| - Image support | ||
| - Export to formats like PNG and SVG | ||
| - Collaboration support in the app | ||
| - Local-first behavior and shareable links | ||
| - Localization support | ||
|
|
||
| ## 2. Tech Stack | ||
|
|
||
| Frontend: | ||
|
|
||
| - TypeScript | ||
| - React | ||
| - Vite | ||
| - Sass / CSS | ||
|
|
||
| Project and tooling: | ||
|
|
||
| - Yarn workspaces for the monorepo | ||
| - Vitest for tests | ||
| - ESLint for linting | ||
| - Prettier for formatting | ||
| - esbuild for package builds | ||
|
|
||
| Libraries and services used in the app: | ||
|
|
||
| - Firebase | ||
| - Socket.IO client | ||
| - Jotai | ||
| - Sentry | ||
|
|
||
| Backend: | ||
|
|
||
| - There is no main backend in this repository. | ||
| - The web app connects to external services for collaboration, storage, sharing, AI-related features, and analytics. | ||
|
|
||
| ## 3. How to Run the Project Locally | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - Node.js 18 or newer | ||
| - Yarn 1.22.x | ||
| - Git | ||
|
|
||
| The root `package.json` uses `yarn@1.22.22`, so it is best to match that version. | ||
|
|
||
| ### Installation | ||
|
|
||
| From the project root: | ||
|
|
||
| ```bash | ||
| corepack enable | ||
| corepack prepare yarn@1.22.22 --activate | ||
| yarn install | ||
| ``` | ||
|
|
||
| If `corepack` is not available, install Yarn 1.22.x another way and then run: | ||
|
|
||
| ```bash | ||
| yarn install | ||
| ``` | ||
|
|
||
| ### Start the app | ||
|
|
||
| To start the main web app: | ||
|
|
||
| ```bash | ||
| yarn start | ||
| ``` | ||
|
|
||
| This runs the app from `excalidraw-app/`. | ||
|
|
||
| ### Build the project | ||
|
|
||
| Build everything: | ||
|
|
||
| ```bash | ||
| yarn build | ||
| ``` | ||
|
|
||
| Build only the app: | ||
|
|
||
| ```bash | ||
| yarn build:app | ||
| ``` | ||
|
|
||
| Build the internal packages: | ||
|
|
||
| ```bash | ||
| yarn build:packages | ||
| ``` | ||
|
|
||
| ## 4. Project Structure | ||
|
|
||
| This repo is a monorepo. The main parts are: | ||
|
|
||
| - `packages/excalidraw/` | ||
| Main reusable React component library published as `@excalidraw/excalidraw`. | ||
|
|
||
| - `excalidraw-app/` | ||
| Full web app for `excalidraw.com`. This is where app-only behavior lives, such as collaboration-related UI and production app setup. | ||
|
|
||
| - `packages/common/` | ||
| Shared helpers and shared logic used across packages. | ||
|
|
||
| - `packages/element/` | ||
| Element-related logic for shapes and drawing data. | ||
|
|
||
| - `packages/math/` | ||
| Math helpers used by the editor. | ||
|
|
||
| - `packages/utils/` | ||
| General utility functions. | ||
|
|
||
| - `examples/` | ||
| Small example integrations, including Next.js and browser script usage. | ||
|
|
||
| - `scripts/` | ||
| Repo-level build and helper scripts. | ||
|
|
||
| - `public/` | ||
| Static public assets. | ||
|
|
||
| - `vitest.config.mts` | ||
| Test configuration and local package aliases. | ||
|
|
||
| - `tsconfig.json` | ||
| Main TypeScript configuration. | ||
|
|
||
| - `package.json` | ||
| Root scripts for running, building, linting, and testing the monorepo. | ||
|
|
||
| ## 5. Development Workflow | ||
|
|
||
| ### How to make changes | ||
|
|
||
| 1. Pick the right area first. | ||
| 2. Use `packages/*` for editor or library changes. | ||
| 3. Use `excalidraw-app/` for app-specific changes. | ||
| 4. Make your changes in small, focused commits. | ||
| 5. Run checks before opening a pull request. | ||
|
|
||
| ### Development mode | ||
|
|
||
| Use: | ||
|
|
||
| ```bash | ||
| yarn start | ||
| ``` | ||
|
|
||
| Useful scripts from the repo root: | ||
|
|
||
| ```bash | ||
| yarn test:typecheck | ||
| yarn test:update | ||
| yarn test:code | ||
| yarn test:other | ||
| yarn fix | ||
| ``` | ||
|
|
||
| What they do: | ||
|
|
||
| - `yarn test:typecheck` checks TypeScript types | ||
| - `yarn test:update` runs app tests and updates snapshots | ||
| - `yarn test:code` runs ESLint | ||
| - `yarn test:other` checks formatting with Prettier | ||
| - `yarn fix` auto-fixes formatting and lint issues where possible | ||
|
|
||
| ## 6. Environment Configuration | ||
|
|
||
| The project already includes tracked environment files: | ||
|
|
||
| - `.env.development` | ||
| - `.env.production` | ||
|
|
||
| These define many app URLs and feature flags used by Vite. | ||
|
|
||
| Important notes: | ||
|
|
||
| - Local-only overrides should go in `.env.local` or `.env.development.local` | ||
| - Do not commit personal or temporary local values | ||
| - The development config points the collaboration server to `http://localhost:3002` | ||
| - The development config points the AI backend to `http://localhost:3016` | ||
| - If some app features do not work locally, check whether the related service is running and whether the matching `VITE_APP_*` variable is set correctly | ||
|
|
||
| ## 7. Testing | ||
|
|
||
| Testing is available in this repo. | ||
|
|
||
| Main tools: | ||
|
|
||
| - Vitest | ||
| - ESLint | ||
| - Prettier | ||
| - TypeScript compiler | ||
|
|
||
| Useful commands: | ||
|
|
||
| ```bash | ||
| yarn test | ||
| yarn test:update | ||
| yarn test:coverage | ||
| yarn test:typecheck | ||
| yarn test:code | ||
| yarn test:other | ||
| ``` | ||
|
|
||
| The app also has test files inside `excalidraw-app/tests/`, and the root Vitest config uses a `jsdom` test environment. | ||
|
|
||
| ## 8. Common Issues / Tips | ||
|
|
||
| - If `yarn` is missing, enable it with Corepack and use Yarn 1.22.22. | ||
| - If install fails, make sure your Node.js version is 18 or newer. | ||
| - If the app starts but collaboration does not work, check the WebSocket server URL in the environment config. | ||
| - If AI or other connected features fail locally, check the related `VITE_APP_*` variables. | ||
| - If formatting or lint checks fail, run `yarn fix`. | ||
| - If TypeScript errors look unrelated to your change, run a clean install and try again. | ||
| - The app and the library live in the same repo. Make sure you edit the right place before changing files. | ||
|
|
||
| ## 9. Contribution Basics | ||
|
|
||
| Create a branch: | ||
|
|
||
| ```bash | ||
| git checkout -b your-branch-name | ||
| ``` | ||
|
|
||
| Make changes and run checks: | ||
|
|
||
| ```bash | ||
| yarn test:typecheck | ||
| yarn test:update | ||
| ``` | ||
|
|
||
| Commit your work: | ||
|
|
||
| ```bash | ||
| git add . | ||
| git commit -m "Describe your change" | ||
| ``` | ||
|
|
||
| Create a pull request: | ||
|
|
||
| 1. Push your branch to GitHub. | ||
| 2. Open a pull request against `master`. | ||
| 3. Add a clear title and short description. | ||
| 4. Mention any testing you ran. | ||
|
|
||
| ## Quick Start Summary | ||
|
|
||
| If you want the shortest path to a running app: | ||
|
|
||
| ```bash | ||
| corepack prepare yarn@1.22.22 --activate | ||
| yarn install | ||
| yarn start | ||
| ``` | ||
|
|
||
| For most editor work, start by looking in `packages/excalidraw/`. For app-only work, start in `excalidraw-app/`. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect target branch name.
The documentation instructs contributors to open PRs against
master, but this PR itself targets themainbranch. This inconsistency will mislead new contributors about which branch to target.🔧 Proposed fix
2. Open a pull request against `master`. +2. Open a pull request against `main`.📝 Committable suggestion
🤖 Prompt for AI Agents