A web application for collecting email donations for linguistic research. This platform allows participants to donate their emails along with metadata (gender, age, language, country) for scientific analysis in the Mailcom research project at the institute of Romance Studies, Heidelberg University.
Mailcom is a linguistic research project investigating how email communication differs from traditional letter writing. The website provides an interface for research participants to:
- Learn about the research project
- Donate emails with associated metadata
- Access information about data handling and privacy
- View FAQs, blog posts, and project updates
- Framework: SvelteKit (Svelte 5) with TypeScript
- Styling:
- Tailwind CSS v4
- Flowbite Svelte for UI components
- Build Tool: Vite
- Package Manager: pnpm v10.6.3
- Runtime: Node.js 22
- Database: MySQL 9.2.0
- ORM: Drizzle ORM
- Server Adapter:
@sveltejs/adapter-node
- Reverse Proxy: Nginx
- Containerization: Docker & Docker Compose
- SSL/TLS: Configured for HTTPS with certificate-based encryption
- Custom i18n implementation
- Supported languages: German (de), French (fr)
- Language detection from browser preferences
- Persistent language selection via localStorage
- E2E Testing: Playwright
- Unit Testing: Vitest
- World map SVG by behodgson/markedup-svg-worldmap (Creative Commons Attribution-ShareAlike 3.0 Unported)
donation-webserver/
├── src/
│ ├── frontend/ # SvelteKit application
│ │ ├── src/
│ │ │ ├── routes/ # Application routes/pages
│ │ │ ├── lib/ # Shared libraries
│ │ │ │ ├── components/ # Reusable components
│ │ │ │ ├── i18n/ # Translation files
│ │ │ │ └── server/ # Server-side code (DB schema, DB connection)
│ │ │ └── app.html
│ │ ├── static/ # Static assets
│ │ ├── drizzle/ # Database migrations
│ │ └── package.json
│ └── nginx/ # Nginx configuration
│ ├── conf/ # nginx.conf
│ └── keys/ # SSL certificates
├── Dockerfile # Multi-stage Docker build
├── docker-compose.yml # Docker Compose configuration
└── README.md
The application is deployed using Docker Compose with three main services:
- nginx - Reverse proxy handling HTTPS and routing requests to the application
- mailcom - The SvelteKit application (Node.js server)
- db - MySQL database server
- Docker installed
- SSL certificates placed in
src/nginx/keys/ .envfile configured with database credentials and other environment variables
Create a .env file in the project root with the following variables:
# Database Configuration
MYSQL_HOST=db
MYSQL_PORT=3306
MYSQL_USER=your_user
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=your_database
# Application
BUILD_MODE=false
PORT=3000-
Build the Docker image (if not using a pre-built image):
docker build -t iulusoy/donation-webserver-frontend:latest . -
Prepare SSL certificates:
- Place your SSL certificate chain file in
src/nginx/keys/ - Update the certificate path in
src/nginx/conf/nginx.confif needed - The default configuration expects:
mailcom.rose.uni-heidelberg.de.pem.chain
- Place your SSL certificate chain file in
-
Start the services:
docker-compose up -d
-
Verify deployment:
- The application should be accessible at
https://mailcom.rose.uni-heidelberg.de - HTTP requests on port 80 are automatically redirected to HTTPS
- The database will be initialized on first run
- The application should be accessible at
The docker-compose.yml defines:
- nginx: Exposes ports 80 (HTTP) and 443 (HTTPS), mounts nginx config and SSL keys
- mailcom: Runs the application, depends on the database being healthy
- db: MySQL service with health checks, persistent volume storage
Database migrations are handled automatically on container startup via the start script, which runs:
pnpm db:generate- Generates migrations from schemapnpm db:push- Applies migrations to the database
- Node.js 22+
- pnpm 10.6.3+
- MySQL 9.2.0+ (or use Docker Compose for local development)
-
Install dependencies:
cd src/frontend pnpm install -
Configure environment:
- Copy
.env.exampleto.env(if available) or create.envwith database credentials
- Copy
-
Run database migrations:
pnpm db:generate pnpm db:push
-
Start development server:
pnpm dev
-
Access the application:
- Development server:
http://localhost:5173
- Development server:
pnpm dev- Start development serverpnpm build- Build for productionpnpm preview- Preview production build locallypnpm test- Run Playwright testspnpm lint- Lint codepnpm format- Format code with Prettierpnpm db:studio- Open Drizzle Studio (database GUI)pnpm db:generate- Generate database migrationspnpm db:push- Push schema changes to databasepnpm db:migrate- Run database migrations
The application uses two main tables:
donations- Stores donation metadata (gender, age, language, email, country)newsletter- Stores newsletter subscription emails
Schema is defined in src/frontend/src/lib/server/schema.ts using Drizzle ORM.
See LICENSE file for details.
- World map SVG by behodgson/markedup-svg-worldmap (Creative Commons Attribution-ShareAlike 3.0 Unported)
For questions about the research project, visit the contact page on the website or reach out to the Mailcom project team at Heidelberg University via mailcom@rose.uni-heidelberg.de.