development.mdx 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Development
  2. ## Code Sandbox
  3. - Go to https://codesandbox.io/p/github/excalidraw/excalidraw
  4. - You may need to sign in with GitHub and reload the page
  5. - You can start coding instantly, and even send PRs from there!
  6. ## Local Installation
  7. These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
  8. ### Requirements
  9. - [Node.js](https://nodejs.org/en/)
  10. - [Yarn](https://yarnpkg.com/getting-started/install) (v1 or v2.4.2+)
  11. - [Git](https://git-scm.com/downloads)
  12. ### Clone the repo
  13. ```bash
  14. git clone https://github.com/excalidraw/excalidraw.git
  15. ```
  16. ### Install the dependencies
  17. ```bash
  18. yarn
  19. ```
  20. ### Start the server
  21. ```bash
  22. yarn start
  23. ```
  24. Now you can open [http://localhost:3000](http://localhost:3000) and start coding in your favorite code editor.
  25. ## Collaboration
  26. For collaboration, you will need to set up [collab server](https://github.com/excalidraw/excalidraw-room) in local.
  27. ## Commands
  28. ### Install the dependencies
  29. ```bash
  30. yarn
  31. ```
  32. ### Run the project
  33. ```bash
  34. yarn start
  35. ```
  36. ### Reformat all files with Prettier
  37. ```bash
  38. yarn fix
  39. ```
  40. ### Run tests
  41. ```bash
  42. yarn test
  43. ```
  44. ### Update test snapshots
  45. ```bash
  46. yarn test:update
  47. ```
  48. ### Test for formatting with Prettier
  49. ```bash
  50. yarn test:code
  51. ```
  52. ### Docker Compose
  53. You can use docker-compose to work on Excalidraw locally if you don't want to setup a Node.js env.
  54. ```bash
  55. docker-compose up --build -d
  56. ```
  57. ## Self-hosting
  58. We publish a Docker image with the Excalidraw client at [excalidraw/excalidraw](https://hub.docker.com/r/excalidraw/excalidraw). You can use it to self-host your own client under your own domain, on Kubernetes, AWS ECS, etc.
  59. ```bash
  60. docker build -t excalidraw/excalidraw .
  61. docker run --rm -dit --name excalidraw -p 5000:80 excalidraw/excalidraw:latest
  62. ```
  63. The Docker image is free of analytics and other tracking libraries.
  64. **At the moment, self-hosting your own instance doesn't support sharing or collaboration features.**
  65. We are working towards providing a full-fledged solution for self-hosting your own Excalidraw.