The open-source code of the digital portal of Stadt.Geschichte.Basel.
Welcome to Stadt.Geschichte.Basel, a historical research project at the University of Basel in Switzerland, funded with over 9 million Swiss Francs from public and private sources, running from 2017 to 2025. It is a comprehensive digital and print project that aims to present the multifaceted history of Basel from its earliest beginnings to the present day. Visit Stadt.Geschichte.Basel to see how our digital portal brings Basel's history to life. This live site showcases the practical application of our open-source code, offering an interactive experience of Basel's rich heritage.
Stadt.Geschichte.Basel seeks to bridge research gaps and present historical findings in accessible formats. Our project encompasses an extensive nine-volume book series, an overview volume, a digital portal, and a digital platform for research data. Hosted at the University of Basel, this project aims to make historical research and insights accessible to scholars and the public like never before.
This project is the open-source code of the digital portal of Stadt.Geschichte.Basel. It is a static website built with SvelteKit and hosted on Cloudflare Pages. It uses hypotheses.org as CMS and consumes data from Agendabasel for the agenda.
The digital platform for research data can be found at forschung.stadtgeschichtebasel.ch. The source code for the digital platform can be found here.
- Fast Static Website: The website is built with SvelteKit, providing a fast and responsive user experience.
- Interactive Features: The website includes an interactive map and agenda.
- Accessibility-Focused Design: Ensuring inclusivity for all users by complying with WCAG standards and observing neurodiversity design guidelines. More at our accessibility statement.
Before you begin, ensure you have the following installed on your system:
- Node.js: Version 20 or 24 (required by the project engines configuration)
- Download from nodejs.org
- Check your version:
node --version
- pnpm: Version 9 or higher (package manager)
- Install globally:
npm install -g pnpm@9 - Check your version:
pnpm --version
- Install globally:
- Git: For version control
- Download from git-scm.com
-
Clone the repository
git clone https://github.com/Stadt-Geschichte-Basel/stadtgeschichtebasel.ch.git cd stadtgeschichtebasel.ch -
Install dependencies
Use the package manager pnpm to install all dependencies.
pnpm install
-
Download content from CMS
Run the prebuild script to download the pages, posts, and assets from hypotheses.org.
pnpm run prebuild
This script fetches all necessary content from the CMS and prepares it for the static site generation.
Once installation is complete, you can start the development server:
pnpm run devThe development server will start at http://localhost:5173 (or another port if 5173 is in use). The site will automatically reload when you make changes to the source files.
Understanding the project layout will help you navigate and contribute more effectively:
stadtgeschichtebasel.ch/
├── .github/ # GitHub Actions workflows and templates
│ ├── workflows/ # CI/CD pipelines (build, test, deploy)
│ └── ISSUE_TEMPLATE/ # Issue templates for bugs and features
├── assets/ # Static assets and images
├── src/ # Source code
│ ├── lib/ # Reusable libraries and utilities
│ │ ├── components/ # Svelte components
│ │ ├── data/ # Data utilities and helpers
│ │ └── images/ # Image processing utilities
│ ├── pages/ # Generated pages from CMS (created by prebuild)
│ ├── posts/ # Generated posts from CMS (created by prebuild)
│ ├── routes/ # SvelteKit routes and pages
│ ├── params/ # Route parameter matchers
│ └── app.html # HTML template
├── static/ # Static files served as-is
│ └── files/ # Downloaded assets from CMS
├── tests/ # Test files
├── svelte.config.js # SvelteKit configuration
├── vite.config.js # Vite build tool configuration
├── tailwind.config.ts # Tailwind CSS configuration
├── package.json # Project dependencies and scripts
└── README.md # This file
src/routes/: Contains the application routes following SvelteKit's file-based routing systemsrc/lib/: Shared libraries, components, and utilitiessrc/lib/downloadPostsPagesAssets.mjs: Script that fetches content from hypotheses.org CMSsrc/pages/andsrc/posts/: Auto-generated from CMS (don't edit manually)static/: Public files served directly (images, fonts, etc.).github/workflows/: CI/CD pipelines for testing and deployment to Cloudflare Pages
Run the development server with hot module replacement:
pnpm run devAccess the site at http://localhost:5173 and make changes to see them reflected immediately.
Build the static site for production:
pnpm run buildThis creates an optimized production build in the build/ directory.
Optimize the build with Jampack for production:
rm -Rf build/_jampack/ && pnpm run postbuild # FIXME: Quick fix to make jampack workPreview the production build locally:
pnpm run previewCheck TypeScript types and Svelte components:
pnpm run checkWatch mode for continuous checking:
pnpm run check:watchLint your code (runs Prettier and ESLint):
pnpm run lintFormat your code with Prettier:
pnpm run formatRun end-to-end tests with Playwright:
pnpm run testRun unit tests with Vitest:
pnpm run test:unitIf you need to reset the downloaded content from the CMS:
pnpm run cleanThis removes all downloaded pages, posts, and assets. Run pnpm run prebuild again to re-download them.
-
Fetch latest changes
git pull origin main
-
Update dependencies (if package.json changed)
pnpm install
-
Download latest content (if CMS content changed)
pnpm run prebuild
-
Start development server
pnpm run dev
-
Make your changes in the
src/directory -
Test your changes
pnpm run lint # Check code quality pnpm run check # Check types pnpm run test # Run tests
-
Commit your changes
git add . pnpm run commit # Uses Commitizen for conventional commits
Issue: Development server fails to start with "Port 5173 is already in use"
Solution: Either stop the process using that port or use a different port:
pnpm run dev -- --port 3000Issue: pnpm run prebuild fails or times out
Solution:
- Check your internet connection
- Verify that hypotheses.org is accessible
- Try running the script again (sometimes it's a temporary network issue)
- Clear the generated content and try again:
pnpm run clean pnpm run prebuild
Issue: Build fails after pulling new changes
Solution:
- Clean install dependencies:
rm -rf node_modules pnpm-lock.yaml pnpm install
- Re-download CMS content:
pnpm run clean pnpm run prebuild
Issue: Tests fail with browser-related errors
Solution: Install Playwright browsers:
pnpm exec playwright install --with-depsIssue: pnpm run postbuild fails
Solution: Clear the jampack cache and rebuild:
rm -rf build/_jampack/
pnpm run build
pnpm run postbuildIssue: Errors related to incompatible Node.js version
Solution: Ensure you're using Node.js version 20 or 24. Use nvm to manage versions:
nvm install 20
nvm use 20If you encounter issues not covered here:
- Check existing GitHub Issues
- Search GitHub Discussions
- Create a new issue with:
- Clear description of the problem
- Steps to reproduce
- Your environment (OS, Node version, pnpm version)
- Relevant error messages or logs
This project is built with modern web technologies:
- SvelteKit: Application framework for Svelte
- Svelte: UI component framework
- Vite: Build tool and development server
- Tailwind CSS: Utility-first CSS framework
- Skeleton UI: UI component library
- MDsveX: Markdown preprocessor for Svelte
- Playwright: End-to-end testing framework
- Vitest: Unit testing framework
- Jampack: Post-build optimization tool
- Cloudflare Pages: Hosting platform
- FAQ: Frequently asked questions and answers
- Architecture: Technical architecture and design decisions
- Contributing Guidelines: How to contribute to this project
- Code of Conduct: Our community guidelines
- Security Policy: How to report security vulnerabilities
- Changelog: Project version history
This project is maintained by @Stadt-Geschichte-Basel. Please understand that we won't be able to provide individual support via email. We believe that help is much more valuable if it's shared publicly, so that more people can benefit from it.
| Type | Platforms |
|---|---|
| 🚨 Bug Reports | GitHub Issue Tracker |
| 🎁 Feature Requests | GitHub Issue Tracker |
| 🛡 Report a security vulnerability | GitHub Issue Tracker |
| 💬 General Questions | GitHub Discussions |
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
See also the list of contributors who participated in this project.
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE.md file for details.