Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*
!.env
!.env.development
!.env.production
!.eslintrc.json
Expand Down
24 changes: 0 additions & 24 deletions .env.development

This file was deleted.

20 changes: 20 additions & 0 deletions .env.development.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
REACT_APP_BACKEND_V2_GET_URL=http://localhost:8080/api/v2/scenes/
REACT_APP_BACKEND_V2_POST_URL=http://localhost:8080/api/v2/scenes/
REACT_APP_LIBRARY_URL=https://libraries.excalidraw.com
REACT_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries/
REACT_APP_STORAGE_BACKEND=http
REACT_APP_HTTP_STORAGE_BACKEND_URL=http://localhost:8080/api/v2
REACT_APP_WS_SERVER_URL=http://localhost:5001
REDIS_PASSWORD=123
REACT_APP_PORTAL_URL=

# put these in your .env.local, or make sure you don't commit!
# must be lowercase `true` when turned on
#
# whether to enable Service Workers in development
REACT_APP_DEV_ENABLE_SW=
# whether to disable live reload / HMR. Usuaully what you want to do when
# debugging Service Workers.
REACT_APP_DEV_DISABLE_LIVE_RELOAD=

FAST_REFRESH=false
17 changes: 0 additions & 17 deletions .env.production

This file was deleted.

14 changes: 14 additions & 0 deletions .env.production.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
REACT_APP_BACKEND_V2_GET_URL=http://localhost:8080/api/v2/scenes/
REACT_APP_BACKEND_V2_POST_URL=http://localhost:8080/api/v2/scenes/
REACT_APP_LIBRARY_URL=https://libraries.excalidraw.com
REACT_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries/
REACT_APP_STORAGE_BACKEND=http
REACT_APP_HTTP_STORAGE_BACKEND_URL=http://localhost:5011/api/v2
REACT_APP_WS_SERVER_URL=http://localhost:5012
REDIS_PASSWORD=
REACT_APP_PORTAL_URL=

# production-only vars
REACT_APP_GOOGLE_ANALYTICS_ID=

REACT_APP_PLUS_APP=
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
.DS_Store
.env.development.local
.env.development
.env.local
.env
.env.production.local
.env.production
.env.test.local
.envrc
.eslintcache
Expand Down
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
FROM node:14-alpine AS build
FROM node:18-alpine AS build

WORKDIR /opt/node_app

FROM build as production_buildstage

COPY package.json yarn.lock ./
RUN yarn --ignore-optional --network-timeout 600000

ARG NODE_ENV=production

COPY . .

ARG NODE_ENV=production
RUN yarn build:app:docker

FROM nginx:1.21-alpine
FROM nginx:1.21-alpine as production

COPY --from=build /opt/node_app/build /usr/share/nginx/html
COPY --from=production_buildstage /opt/node_app/build /usr/share/nginx/html

HEALTHCHECK CMD wget -q -O /dev/null http://localhost || exit 1

FROM build as development
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
# Excalidraw without firebase

This is a fork from the [excalidraw project](https://github.com/excalidraw/excalidraw) with changes inspired and partly taken from [Kilian Decaderincourt](https://gitlab.com/kiliandeca/excalidraw-fork) to enable support for rooms without using firebase.<br />

## Setup with docker

Please copy the .env.development.default or .env.production.default file to .env (or with environment without default at the end) and change it according to your needs, see [react-scripts](https://create-react-app.dev/docs/adding-custom-environment-variables/).

### Development

```
docker-compose up -d
docker-compose exec excalidraw yarn install
docker-compose exec excalidraw yarn start
```

Hint: Collab mode requires a secure context (https). Localhost works as well, but not http over local network.

#### Commands

| Command | Description |
| ------------------ | --------------------------------- |
| `yarn` | Install the dependencies |
| `yarn start` | Run the project |
| `yarn fix` | Reformat all files with Prettier |
| `yarn test` | Run tests |
| `yarn test:update` | Update test snapshots |
| `yarn test:code` | Test for formatting with Prettier |

### Production

```
docker-compose -f docker-compose-prod.yml up -d
```


## Additional licence

The excalidraw [logo](https://thenounproject.com/icon/2357486/) in this repo – created by [Verry](https://thenounproject.com/verry.dsign.creative) – is licenced under [CC BY 3.0 Unported](https://creativecommons.org/licenses/by/3.0/).
<div align="center" style="display:flex;flex-direction:column;"}>
<a href="https://excalidraw.com">
<img width="540" src="./public/og-image-sm.png" alt="Excalidraw logo: Sketch handrawn like diagrams."/>
Expand Down Expand Up @@ -42,3 +81,4 @@ Visit our documentation on [https://docs.excalidraw.com](https://docs.excalidraw
## Who's integrating Excalidraw

[Google Cloud](https://googlecloudcheatsheet.withgoogle.com/architecture) • [Meta](https://meta.com/) • [CodeSandbox](https://codesandbox.io/) • [Obsidian Excalidraw](https://github.com/zsviczian/obsidian-excalidraw-plugin) • [Replit](https://replit.com/) • [Slite](https://slite.com/) • [Notion](https://notion.so/) • [HackerRank](https://www.hackerrank.com/)
```
42 changes: 42 additions & 0 deletions docker-compose-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: "3.8"

services:
excalidraw:
build:
context: .
target: production
container_name: excalidraw
ports:
- "5010:80"
restart: always
stdin_open: true
healthcheck:
disable: true
environment:
- NODE_ENV=production

excalidraw-storage-backend:
build: https://github.com/kitsteam/excalidraw-storage-backend.git#main
ports:
- "5011:8080"
restart: always
environment:
STORAGE_URI: redis://:${REDIS_PASSWORD}@redis:6379
STORAGE_TTL: 2592000000

excalidraw-room:
image: excalidraw/excalidraw-room
restart: always
ports:
- "5012:80"

redis:
image: redis
command: redis-server --requirepass ${REDIS_PASSWORD}
restart: always
volumes:
- redis_data:/data

volumes:
notused:
redis_data:
31 changes: 24 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ version: "3.8"

services:
excalidraw:
stdin_open: true
build:
context: .
args:
- NODE_ENV=development
target: development
container_name: excalidraw
ports:
- "3000:80"
Expand All @@ -16,10 +16,27 @@ services:
environment:
- NODE_ENV=development
volumes:
- ./:/opt/node_app/app:delegated
- ./package.json:/opt/node_app/package.json
- ./yarn.lock:/opt/node_app/yarn.lock
- notused:/opt/node_app/app/node_modules
- node_modules:/opt/node_app/node_modules
- ./:/opt/node_app/

excalidraw-storage-backend:
build: https://github.com/kitsteam/excalidraw-storage-backend.git#main
ports:
- "8080:8080"
environment:
STORAGE_URI: redis://:${REDIS_PASSWORD}@redis:6379
STORAGE_TTL: 2592000000

excalidraw-room:
image: excalidraw/excalidraw-room
ports:
- "5001:80"

redis:
image: redis
command: redis-server --requirepass ${REDIS_PASSWORD}
volumes:
- redis_data:/data
volumes:
notused:
redis_data:
node_modules:
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@
"png-chunks-extract": "1.0.0",
"points-on-curve": "0.2.0",
"pwacompat": "2.0.17",
"qr-code-styling": "1.6.0-rc.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-router-dom": "6.8.1",
"react-scripts": "5.0.1",
"roughjs": "4.5.2",
"sass": "1.51.0",
Expand Down Expand Up @@ -117,7 +119,7 @@
"locales-coverage:description": "node scripts/locales-coverage-description.js",
"prepare": "husky install",
"prettier": "prettier \"**/*.{css,scss,json,md,html,yml}\" --ignore-path=.eslintignore",
"start": "react-scripts start",
"start": "PORT=80 react-scripts start",
"start:production": "npm run build && npx http-server build -a localhost -p 5001 -o",
"test:all": "yarn test:typecheck && yarn test:code && yarn test:other && yarn test:app --watchAll=false",
"test:app": "react-scripts test --passWithNoTests",
Expand Down
Binary file added public/FiraSans-Bold.otf
Binary file not shown.
Binary file added public/FiraSans-Light.otf
Binary file not shown.
Binary file added public/FiraSans-Regular.otf
Binary file not shown.
Binary file added public/GitHub-Mark-32px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions public/SIL_OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ with Reserved Font Name Fira Sans.

Copyright (c) 2014, Telefonica S.A.

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL

-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.

The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the copyright statement(s).

"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.

"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.

5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file modified public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions public/excalidraw-logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
17 changes: 17 additions & 0 deletions public/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,20 @@
font-display: swap;
font-weight: 700;
}

@font-face {
font-family: "FiraSans";
src: url("FiraSans-Regular.otf") format("opentype");
}

@font-face {
font-family: "FiraSans";
font-weight: light;
src: url("FiraSans-Light.otf") format("opentype");
}

@font-face {
font-family: "FiraSans";
font-weight: bold;
src: url("FiraSans-Bold.otf") format("opentype");
}
Loading