Take a look at the Backlog in the Project Page to see our priorities. You are more than welcome to contribute any PR regardless if it's listed or not.
curl -L https://nixos.org/nix/install | sh
nix-shell -v
brew install openjdk@17 sbt nodejs yarn
Assuming you use Git for Windows >= 2.16.2.1 (note this will erase uncommitted changes):
git config --add core.symlinks true
git reset --hard HEAD
choco install nvm yarn sbt openjdk17 python3
nvm install 8.9.1
nvm use 8.9.1
(npm >= 9.0.0 may have issues finding/using python)
sbt
> startAll
open http://localhost:8080
then run ~client/fastOptJS
if you work on client part or ~sbtRunner/reStart;server/reStart
if you work on server part.
you can also open http://localhost:8080/embed.html
to edit the embedded style
Make sure to run bin/scalafmt
to format your code.
You can install a pre-commit hook with bin/hooks.sh
.
├── api | autowire api (rpc server <=> browser)
│ | models for server <=> sbt (akka-remote)
├── balancer | distribute load based on sbt configuration
├── bin | scalfmt runner
├── build.sbt | build definition
├── client | Scala.js & scalajs-react code for the frontend
├── demo | cool examples to try in scastie
├── deployment | production configurations
├── docker | Dockerfile for sbt images
├── instrumentation | Worksheet implementation
├── project | build extras like Deployment or Scala.js packaging and plugins
├── runtime-dotty | see `runtime-scala`
├── runtime-scala | methods exposed inside scastie
├── sbt-runner | remote actor communicating with sbt instance over I/O streams
├── sbt-scastie | sbt plugin to report errors and console output with the `sbt-api` model
├── server | web server
└── utils | read/writte files
Scala.js Client run/save/format +-------------------------------------------+
+-----------------+ AutowireApi +---------------------+ +-------------------------------------------+|
| ScastieBackend | (HTTP) | +------------+ | akka+remote +-------------------------------------------+||
| +--------+ +-----------------> | |LoadBalancer| <------------------+ | SbtActor Sbt(Proccess) |||
| | | | | +------------+ | | | +----------+ +-----------+ |||
| | | | | | +---> | | <-----> |sbt|scastie| ||+
| | | | | | | +----+-----+ I/O Stream +-----------+ |+
| | | | | | +-------------------------------------------+
| | | | | |
| | | | | |
| | | | | |
| | | | | SnippetContainer(DB)|
| | | | | |
| | | | <-----------------+ oauth |
| +--------+ | SnippetProgress | static ressources |
+-----------------+ (sse/websocket) +---------------------+
Editor: http://asciiflow.com/
If you have any questions join us in the gitter channel
ssh [email protected]
ssh [email protected]
ssh [email protected]
docker login
cd ~/scastie-secrets && git pull #optional
cd ~/scastie && git pull && ~/nix-user-chroot-bin-1.2.2-x86_64-unknown-linux-musl ~/.nix bash -l
nix-shell -v
sbt
deploy
ssh [email protected]
ssh [email protected]
tail -F -n1000 output.log
ssh [email protected]
~/log.sh
- You need access to
[email protected]
,https://github.com/scalacenter/scastie-secrets
,http://scala-webapps.epfl.ch:8081
and be a member ofhttps://hub.docker.com/u/scalacenter/
These people have access:
-
see
production.conf
file for current production configuration, notably it uses mongodb instead of local file storage -
Install docker (note that Windows is not recommended due to networking issues)
-
do
docker login
-
bump the version in build.sbt
-
tag and commit the new version
-
Run this command locally:
sbt deploy
-
Make sure everything went well: https://scastie.scala-lang.org
In case anything goes wrong:
ssh [email protected]
ssh [email protected]
ssh [email protected]
./sbt.sh
exit
./server.sh
git commit
sbt "sbtRunner/docker"
docker run \
--network=host \
-e RUNNER_PORT=5150 \
-e RUNNER_HOSTNAME=127.0.0.1 \
-e RUNNER_RECONNECT=false \
-e RUNNER_PRODUCTION=true \
scalacenter/scastie-sbt-runner:`git rev-parse --verify HEAD`