The platform that powers republik.ch. A tailored solution for a membership based online magazine.
If you are a Republik reader (thank you!) and you have any issues or feature requests, please do kindly direct them to our support team. Unfortunately we can also not currently accept external contributions to our codebase, as we are a small team and want to keep our focus on improving and maintaining the product for all of our readers. Thank you for your interest in case you were considering it, we are impressed.
This turborepo uses Yarn as a package manager. It includes the following apps and packages:
www: providing the public frontendpublikator: providing publication management interfaceadmin: providing the customer management interfaceapi: providing the graphql apiassets: fetching, compressing and resizing assets
The frontends are Next.js apps, the backends use Express.js.
styleguide: a React component library shared by all frontends and used by theapito render newslettersbackend-modules/*: packages used by theapiandassetsservermdast/*: packages used to work with mdast (previously in it's own monorepo)eslint-config-*: multiple eslint configurations which are used accross our appsnextjs-apollo-client: a reusable Nextjs / Apollo Client setuptsconfig: a package to store shared typescript configurationsicons: A package to make SVG-files available as react.js components to be used across our frontends.
All packages and apps support TypeScript and plain ECMAScript.
The logo and fonts are the property of their owners (logo—Project R, GT America—GrilliType and Rubis—Nootype), and may not be reproduced without permission.
The www, publikator app and styleguide are BSD-3-Clause licensed. The api, assets app and all backend-modules are AGPL-3.0 licensed. See respective license files in subfolders.
This turborepo has some additional tools already setup for you:
To get started you'll need:
- yarn v1.22
- Node.js v24
- Docker
All apps and the styleguide provide an .env.example, the provided default values should be enough to get started:
cp apps/www/.env.example apps/www/.env
cp apps/publikator/.env.example apps/publikator/.env
cp apps/admin/.env.example apps/admin/.env
cp apps/api/.env.example apps/api/.env
cp apps/assets/.env.example apps/assets/.envMigrating from Individual Repos
You may copyover your environment from the individual repos with one manual edit:
cp ../republik-frontend/.env apps/www/.env
cp ../publikator-frontend/.env apps/publikator/.env
cp ../republik-admin-frontend/.env apps/admin/.env
cp ../styleguide/.env packages/styleguide/.env
cp ../backends/.env apps/api/.env
echo "PORT=5010" >> apps/api/.env
cp ../backends/servers/assets/.env apps/assets/.envThe COOKIE_NAME env-variable can be defined in apps/api and apps/www. It's crucial that the value defined in the apps/www file matches the one of the API that you're developing against.
If these two env-variables don't match, www will be stuck in a redirection loop when trying to open the URL /.
docker compose upyarn install
yarn build
yarn dev:setupTo develop all apps and packages, run the following command:
docker compose upAnd in a second shell
yarn devPlease be patient on boot. It might take a minute for everything to compile and a few nodemon restarts before everything runs smoothly.
If you don't want all apps to run when using the dev script, you can use the filter flag.
(see the Turborepo documentation)
For example if you only want to run the republik frontend run yarn dev --filter=@orbiting/www-app.
In most cases you have certain dependencies that should be run as well, for example the styleguide if you're developing in the frontend. In that case simply append ... directly after the filter, to ensure that the additionally to the filtered app, all dependencies are executed as well. (For example in www run: yarn dev --filter=@orbiting/www-app...)
For start only frontend and api use:
yarn dev --filter=@orbiting/www-app... --filter=@orbiting/api-app...<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
You can use yarn commit to generate a message via an interactive prompt.
Types
Always changelog relevant: feat, fix, perf
Others: docs, chore, style, refactor, test
Scope is optional.
The body should include the motivation for the change and contrast this with previous behavior.
The footer should contain any information about Breaking Changes and is also the place to reference GitHub issues that this commit Closes.
Don't care about developing the backend? Just want to test something against our production backend? We have yet another proxy for that:
# terminal 1
yarn yaproxy
# terminal 2
yarn dev:www
(Obvious )Warning: whatever you do here is for realz, if you login to your account and change things they are changed on republik.ch!
The environment variable SERVER is used to determine which app to build and run on deploy. If SERVER is missing the api app is run.
A heroku-prebuild script runs scripts/prune.sh which runs turbo prune with the correct scope and moved the pruned apps and packages to the root directory.
A heroku-postbuild script is used to add a Procfile for running the scheduler on heroku for the api app.