You need Docker, Node.js v10 and Yarn installed on your system.
Now follow the upcoming instructions.
# Clone the project:
$ git clone https://github.com/serlo/serlo.org.git
$ cd serlo.org
On Linux or macOS, just open a terminal and run the following commands:
$ cp docker-compose.dist.yml docker-compose.yml
On Windows, please add
127.0.0.1 de.serlo.localhost
127.0.0.1 en.serlo.localhost
to your C:\Windows\System32\drivers\etc\hosts.txt
file. Then run ipconfig /flushdns
in cmd.exe and
restart your browser.
On macOS:
$ sudo nano /etc/hosts
# add lines
127.0.0.1 de.serlo.localhost
127.0.0.1 en.serlo.localhost
# flush macOS DNS cache
$ sudo killall -HUP mDNSResponder
Run yarn
to install the dependencies of all packages.
Run yarn start
to start everything needed to run serlo.org locally.
Now, open http://de.serlo.localhost:4567. Happy coding!
Interrupt the yarn start
command to stop webpack and and run yarn stop:server
to stop the docker containers.
This repository is managed as a monorepo consisting of the following packages:
packages/private
contains helper packages for deployment and packages used by multiple other packages. Specifically:cloudflare
contains helpers to work with Cloudflaredocker
handles building, tagging and deploying of our Docker imageseditor-helpers
(de-)stringifies editor statesgcloud
contains helper sto to work with Google Cloud Platformlegacy-editor-to-editor
converts legacy editor state to editor statemarkdown
defines our Serlo-flavored markdown as used in the legacy editor
packages/public
contains packages that are deployed somehow. Specifically:client
contains our assets used in the client (e.g. JavaScript bundle & stylesheet)cloudflare-workers
defines our Cloudflare Workereditor-renderer
is the server-side renderer for our editorlegacy-editor-renderer
is the server-side-renderer for our legacy editorserver
is the serlo.org backendstatic-assets
contains static assets (e.g. images)
yarn build
builds our packages (only needed for deployment)yarn build:docker
builds our docker images (only needed for deployment)yarn dump:sql
to update the docker initialization file of the sql database with the current database stateyarn format:js
formats all non-PHP source codeyarn format:php
formats all PHP source code (requiresyarn start
beforehand)yarn lint:js
lints all non-PHP source codeyarn lint:php
lints all PHP source code (requiresyarn start
beforehand)yarn mysql
connects to the running MySQL database (requiresyarn start
beforehand)yarn test:js
runs all non-PHP unit testsyarn test:php
runs all PHP unit tests (requiresyarn start
beforehand)yarn test:e2e
runs all end-to-end tests (requiresyarn start
beforehand)yarn license
updates license headers in source filesyarn c
allows to run composer commands, seeyarn c --help
(requiresyarn start
)yarn c-dev
allows to run composer commands (only used for dev tools), seeyarn c --help
(requiresyarn start
)