Monolith that still serves parts of serlo.org. Head over to api.serlo.org and frontend for new development.
You need Docker, Node.js v16 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 / Unix:
$ 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!
You can use the following users at
http://de.serlo.localhost:4567. The password
for all users is 123456
. Their names correspond to the roles they have:
login
german_reviewer
german_helper
english_langhelper
admin
Interrupt the yarn start
command to stop webpack and run yarn stop:server
to
stop the docker containers.
This repository is managed as a monorepo consisting of the following packages. Check out their READMEs for package-specific details:
packages/private
contains helper packages for deployment and packages used by multiple other packages. Specifically:cloudflare
contains helpers to work with Cloudflaredev-tools
contains npm packages that are only needed for development (to speed up builds of docker images)docker
handles building, tagging and deploying of our Docker imageseditor-helpers
(de-)stringifies editor statesedtr-io
contains the Edtr.io integrationedtr-io-storybook
contains a Storybook to start the Edtr.io integration in isolationgcloud
contains helpers 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 editormathjax
contains helpers to work with Mathjax
packages/public
contains packages that are deployed somehow. Specifically:client
contains our assets used in the client (e.g. JavaScript bundle & stylesheet)editor-renderer
is the server-side renderer for our editorlegacy-editor-renderer
is the server-side renderer for our legacy editornotifications-job
handles the delivery of notification emailsserver
is the serlo.org backendstatic-assets
contains static assets (e.g. images)
yarn build
builds our packages (only needed for deployment)yarn deploy:images
deploys the docker images to our Container Registry (only needed for deployment)yarn deploy:packages
deploys the packages to our Package Registry (only needed for deployment)yarn format
formats all source codeyarn lint
lints all source codeyarn license
updates license headers in source filesyarn mysql
connects to the running MySQL database (requiresyarn start
beforehand)yarn mysql:dump
updates the docker initialization file of the sql database with the current database state (requiresyarn start
beforehand)yarn mysql:import-anonymous-data
imports the latest anonymized dump (requiresyarn start
beforehand, only works on Unix currently)yarn mysql:rollback
resets the database (requiresyarn start
beforehand)yarn oauth
runs a OAuth workflow to manually test Hydra integrationyarn test:e2e
runs all end-to-end tests (requiresyarn start
beforehand)- Use
HEADLESS=false yarn test:e2e
to run the tests in an actual browser. - Use
HEADLESS=false SLOWMO=<number> yarn test:e2e
to introduce a<number>
of milliseconds delay between actions in tests.
- Use
yarn test:js
runs all non-PHP unit testsyarn test:php
runs all PHP unit testsyarn migrate:up
runs all the database migration scriptsyarn c
allows running composer commands, seeyarn c --help
yarn start
spins up the development environment