Skip to content

Dichgrem/calendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

168 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calendar — Self-Hosted Calendar with CalDAV Sync

Go backend + Preact frontend. CalDAV bidirectional sync with DAVx5,
ICS import/export fidelity, single-binary deployment. No dependencies at runtime.

Go License Docker

中文 README


How It Works

flowchart TD
    A[📱 DAVx5 / Android] -- CalDAV --> B[⚙️ Calendar Server]
    C[🌐 Web Browser] -- REST API --> B
    D[📥 ICS Files] -- Import/Export --> B
    
    B -- PROPFIND/REPORT/PUT/DELETE --> E[🗄️ SQLite]
    B -- Raw ICS storage --> E
    B -- Query --> E
    
    F[🐳 Docker Hub] -- Pull --> G[☁️ Server Deployment]
Loading
  1. CalDAV — DAVx5 syncs events bidirectionally via standard PROPFIND/REPORT/PUT/DELETE/MKCALENDAR methods.
  2. Web App — React SPA with custom MonthGrid (zero third-party calendar library), dark mode, lunar calendar.
  3. ICS Import/Export — Raw VEVENT text stored verbatim in raw_ics column: VALARM, X-FOSSIFY-*, TRANSP all preserved on round-trip.
  4. Single Binary — Frontend embedded via go:embed. No external web server or CDN needed.

Features

  • Docker + single-binary deployment
  • Custom-developed MonthGrid view
  • Built-in support for the Chinese lunar calendar and public holidays
  • Event search via Ctrl+/ shortcut
  • High-fidelity ICS support: preserves VALARM, X-FOSSIFY-*, and TRANSP
  • CalDAV two-way synchronization (verified on Android using DAVx5)
  • Scheduled backups and configuration export
  • Light/dark modes and bilingual support (Chinese/English)
  • slog structured logging (circular buffer, level-based filtering)---

Quick Start

# Clone and build
git clone https://github.com/Dichgrem/calendar.git
cd calendar
just build

# Run
./bin/server

Visit http://localhost:3000. Register an account, then connect DAVx5 to http://localhost:3000/dav/.


Docker

# Pull from Docker Hub
podman pull brantcoat/calendar:latest
podman compose up -d

# Or build locally
just docker-build

Environment Variables

Variable Default Description
PORT 3000 HTTP listen port
DATABASE_URL ./data/calendar.db SQLite database path
SECURE_COOKIES false Set true behind HTTPS
USER_DEFAULT_LANGUAGE zh-CN Default UI language
USER_DEFAULT_FIRST_DAY_OF_WEEK 1 Week start (0=Sun, 1=Mon)
USER_DEFAULT_DATE_FORMAT zh Date format
USER_DEFAULT_SHOW_LUNAR_CALENDAR true Enable lunar calendar

Commands

just dev            # Start Go development server
just dev-debug      # Start Go server + Vite HMR + Preact DevTools
just build          # Build frontend + Go binary
just test           # Run Go tests
just lint           # Lint (go vet + biome check + tsc)
just format         # Format (go fmt + biome format)
just docker-build   # Build Docker image
just docker-up      # Docker Compose start

📚 Documentation

Document Description
Usage Guide Desktop & mobile setup, CalDAV pairing, backup/restore
API Reference REST API endpoints, CalDAV protocol, error codes
Developer Guide Build from source, just commands, frontend HMR
Project Structure Code layout, packages, architecture decisions
Log System Log levels, debug mode, log viewer

About

Self-host web-based calendar with CalDAV synchronization support

Topics

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors