No description
- Svelte 46.9%
- JavaScript 21.3%
- TypeScript 15.1%
- CSS 11.3%
- Dockerfile 3.3%
- Other 2.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/workflows | ||
| .vscode | ||
| apps | ||
| packages/database | ||
| sql | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .mcp.json | ||
| .npmrc | ||
| CLAUDE.md | ||
| docker-compose.prod.yml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| package-lock.json | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
Guernsey Tides App (seas.gg)
A SvelteKit application that displays tides, weather, sea temperatures, and pool cleaning schedules for Guernsey.
Architecture
This is a monorepo with npm workspaces containing:
- apps/web - SvelteKit frontend application
- apps/tide-scraper - Standalone service that scrapes tide data
- apps/sea-temp-scraper - Standalone service that scrapes sea temperature (uses Playwright)
- apps/weather-service - Standalone service that fetches weather from Open-Meteo
- packages/database - Shared database package with Drizzle ORM
Development Setup
1. Install dependencies
npm install
2. Set up environment variables
cp .env.example .env
# Edit .env and add your scraping URLs
Required environment variables:
DATABASE_URL- PostgreSQL connection string (default:postgresql://dev:devpass@localhost:5432/tides)TIDE_URL- URL to scrape tide data fromSEA_TEMP_URL- URL to scrape sea temperature from
3. Start development environment
npm run dev
This will:
- Start PostgreSQL in Docker (
docker-compose.db.yml) - Wait for database to be ready
- Start all Node services with hot reload:
- Tide scraper (port: node process)
- Sea temperature scraper (port: node process)
- Weather service (port: node process)
- Web app (port 5173)
Each service runs as a separate Node process with tsx watch for hot reloading. Services are color-coded in the terminal output.
Individual Service Commands
# Database only (Docker)
npm run db:dev
# Individual services
npm run tide:dev # Tide scraper
npm run sea-dev:dev # Sea temperature scraper
npm run weather:dev # Weather service
npm run web:dev # Web app only
Database Setup
The database schema is managed by Drizzle ORM. To set up the database:
# Start the database
npm run db:dev
# Push schema changes (development only)
npm run db:migrate
# View database with Drizzle Studio
npm run db:studio
Production
For production deployment, use the full Docker Compose:
docker compose up -d
This runs all services in Docker containers.
Project Structure
seas-gg/
├── apps/
│ ├── web/ # SvelteKit web app
│ ├── tide-scraper/ # Tide scraping service
│ ├── sea-temp-scraper/ # Sea temperature scraping service
│ └── weather-service/ # Weather fetching service
├── packages/
│ └── database/ # Shared Drizzle ORM package
├── docker-compose.db.yml # Dev: PostgreSQL only
├── docker-compose.yml # Prod: All services
└── package.json # Workspace root
Environment Variable Reference
| Variable | Default | Description |
|---|---|---|
DATABASE_URL |
postgresql://dev:devpass@localhost:5432/tides |
PostgreSQL connection |
TIDE_URL |
- | URL to scrape tide data |
SEA_TEMP_URL |
- | URL to scrape sea temperature |
TIDE_SCRAPER_INTERVAL_MINUTES |
60 |
How often to scrape tides |
SEA_TEMP_SCRAPER_INTERVAL_MINUTES |
30 |
How often to scrape sea temp |
WEATHER_SERVICE_INTERVAL_MINUTES |
15 |
How often to fetch weather |
TIDE_SCRAPER_DAYS_AHEAD |
30 |
Days of tide data to fetch |
WEATHER_SERVICE_DAYS_AHEAD |
7 |
Days of weather to fetch |