This is the main repository for All About Berlin. It contains the templates, content and backend to render the website.
The frontend is a static website built with ursus, a purpose-built static site generator. This is the website you see when you visit allaboutberlin.com. The ursus static site generator is in a separate repository.
Directory structure:
./frontendcontains all files needed to render the website./frontend/templatescontains the templates used to generate the website's pages. That's also where the frontend code for the calculators is stored../frontend/templates/servicesfor the templates of A Good Start
./frontend/contentcontains the website's content: guides, tools, glossary entries, images etc../frontend/content/servicesfor the content of A Good Start
./frontend/extensionscontains ursus extensions and linters that are specific to All About Berlin../frontend/scriptscontains utility scripts. Usemise runto run them.
The backend a REST API built with Django and Django REST Framework. The API handles form submissions, email scheduling and other dynamic features. It also proxies APIs for newsletter subscriber management and currency conversions.
Most tools on the website entirely run in the browser, so they don't call the API.
The website is served by Caddy. All requests first go through Caddy, and are routed to the frontend and backend services. The Caddy configuration is under ./proxy.
When running in production, the server responds to https://allaboutberlin.com and https://agoodstart.de.
When running locally, the server responds to https://localhost (All About Berlin) and https://services.localhost (A Good Start).
This project uses mise to set up the development environment and run various task. You must install it first.
- Run
mise installto install required tools. - Run
mise setupto install local dependencies, set up commit hooks, etc. - Run
mise devto start docker, build the website and start a local server. This will build and start the project inside docker containers. The website is served athttps://localhost. The frontend/backend are reloaded on changes.
You can also run mise site to only run a minimal frontend. It's much faster than running docker, and it's enough for frontend development and content changes.
See the production README.
mise test runs all available tests.
mise test-ui only runs the UI tests. Run mise update-snapshots to generate new visual testing snapshots when the UI changes.
Run mise test-api to only run the backend and API tests.
There are frontend unit tests. You can see them at https://localhost/tests/unit. These are run with the other tests.
mise lint runs the project's various linters. It's run automatically before committing.
mise format automatically applies certain linting rules.
See the notes for contributors.