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.orgOn Linux or macOS, just open a terminal and run the following commands:
$ cp docker-compose.dist.yml docker-compose.ymlOn Windows, please add
127.0.0.1 de.serlo.localhost
127.0.0.1 en.serlo.localhostto 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 mDNSResponderRun 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:
logingerman_reviewergerman_helperenglish_langhelperadmin
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/privatecontains helper packages for deployment and packages used by multiple other packages. Specifically:cloudflarecontains helpers to work with Cloudflaredev-toolscontains npm packages that are only needed for development (to speed up builds of docker images)dockerhandles building, tagging and deploying of our Docker imageseditor-helpers(de-)stringifies editor statesedtr-iocontains the Edtr.io integrationedtr-io-storybookcontains a Storybook to start the Edtr.io integration in isolationgcloudcontains helpers to work with Google Cloud Platformlegacy-editor-to-editorconverts legacy editor state to editor statemarkdowndefines our Serlo-flavored markdown as used in the legacy editormathjaxcontains helpers to work with Mathjax
packages/publiccontains packages that are deployed somehow. Specifically:clientcontains our assets used in the client (e.g. JavaScript bundle & stylesheet)editor-rendereris the server-side renderer for our editorlegacy-editor-rendereris the server-side renderer for our legacy editornotifications-jobhandles the delivery of notification emailsserveris the serlo.org backendstatic-assetscontains static assets (e.g. images)
yarn buildbuilds our packages (only needed for deployment)yarn deploy:imagesdeploys the docker images to our Container Registry (only needed for deployment)yarn deploy:packagesdeploys the packages to our Package Registry (only needed for deployment)yarn formatformats all source codeyarn lintlints all source codeyarn licenseupdates license headers in source filesyarn mysqlconnects to the running MySQL database (requiresyarn startbeforehand)yarn mysql:dumpupdates the docker initialization file of the sql database with the current database state (requiresyarn startbeforehand)yarn mysql:import-anonymous-dataimports the latest anonymized dump (requiresyarn startbeforehand, only works on Unix currently)yarn mysql:rollbackresets the database (requiresyarn startbeforehand)yarn oauthruns a OAuth workflow to manually test Hydra integrationyarn test:e2eruns all end-to-end tests (requiresyarn startbeforehand)- Use
HEADLESS=false yarn test:e2eto run the tests in an actual browser. - Use
HEADLESS=false SLOWMO=<number> yarn test:e2eto introduce a<number>of milliseconds delay between actions in tests.
- Use
yarn test:jsruns all non-PHP unit testsyarn test:phpruns all PHP unit testsyarn migrate:upruns all the database migration scriptsyarn callows running composer commands, seeyarn c --helpyarn startspins up the development environment