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.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:
$ 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!
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/privatecontains helper packages for deployment and packages used by multiple other packages. Specifically:cloudflarecontains helpers to work with Cloudflaredockerhandles building, tagging and deploying of our Docker imageseditor-helpers(de-)stringifies editor statesgcloudcontains helper sto to work with Google Cloud Platformlegacy-editor-to-editorconverts legacy editor state to editor statemarkdowndefines our Serlo-flavored markdown as used in the legacy editor
packages/publiccontains packages that are deployed somehow. Specifically:clientcontains our assets used in the client (e.g. JavaScript bundle & stylesheet)cloudflare-workersdefines our Cloudflare Workereditor-rendereris the server-side renderer for our editorlegacy-editor-rendereris the server-side-renderer for our legacy editorserveris the serlo.org backendstatic-assetscontains static assets (e.g. images)
yarn buildbuilds our packages (only needed for deployment)yarn build:dockerbuilds our docker images (only needed for deployment)yarn dump:sqlto update the docker initialization file of the sql database with the current database stateyarn format:jsformats all non-PHP source codeyarn format:phpformats all PHP source code (requiresyarn startbeforehand)yarn lint:jslints all non-PHP source codeyarn lint:phplints all PHP source code (requiresyarn startbeforehand)yarn mysqlconnects to the running MySQL database (requiresyarn startbeforehand)yarn test:jsruns all non-PHP unit testsyarn test:phpruns all PHP unit tests (requiresyarn startbeforehand)yarn test:e2eruns all end-to-end tests (requiresyarn startbeforehand)yarn licenseupdates license headers in source filesyarn callows to run composer commands, seeyarn c --help(requiresyarn start)yarn c-devallows to run composer commands (only used for dev tools), seeyarn c --help(requiresyarn start)
