Skip to content
DO-2K24-27Public

About

The DO Calendar

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

CalenDO - Calendar Management System

CalenDO is a calendar system that imports schedules ("plannings") from iCal sources and shows them in a React web app. It has a read-only Go REST API, an iCal importer that keeps the database in sync, an image generator that renders day views as PNG images, and a Helm chart for Kubernetes.

Project Structure

  • backend/: Go REST API (read-only) serving plannings and events from PostgreSQL
  • frontend/: React + TypeScript + Vite web app (PWA)
  • ical-importer/: Go CLI that imports and syncs iCal feeds into the database (README)
  • image-generator/: Python FastAPI service that renders day-view PNG images (README)
  • helm/: Helm chart for Kubernetes deployment
  • .github/workflows/ci.yml: CI that builds and tests every component, pushes the Docker images and deploys

Features

  • Several plannings (calendars) imported from iCal URLs or files, kept in sync on a schedule (an hourly CronJob in Kubernetes)
  • Recurring events (RRULE/EXDATE/RDATE), all-day events and events that span several days
  • Month, week and day views, with swipe navigation and a current-time cursor
  • Filtering by several plannings at once, plus event search
  • Countdown page (/countdown) to the next break between classes
  • Fullscreen display page (/display) for TV/kiosk screens; pressing F11 on the calendar switches to it automatically
  • Installable PWA with offline support and an API response cache
  • Day-view PNG images generated server-side (image-generator)
  • Read-only REST API documented with Swagger/OpenAPI
  • Docker images for every component and a Helm chart for Kubernetes

Getting Started

Development Environment

You can quickly start the development environment using Docker Compose:

# Start the whole stack: database, API, frontend and image generator
docker-compose up -d

# Or start just the database for local development
docker-compose up -d database
  • The API will be available at http://localhost:8080
  • The frontend will be available at http://localhost:3000
  • The image generator will be available at http://localhost:8000

The database starts empty. To fill it, run make seed in backend/ for sample data, or use the iCal importer with real feeds (for example ./ical-importer sync sync-config.yaml).

Note: the frontend calls the API through the relative path /api. In Kubernetes, the ingress routes /api to the backend. Locally, neither the frontend's nginx config nor the Vite dev server proxies /api right now, so the frontend at :3000 (or npm run dev) cannot reach the API at :8080 without a reverse proxy.

Frontend Routes

  • /: main calendar
  • /countdown: countdown to the next break
  • /display: fullscreen display page (see below)

Fullscreen Display Page

The frontend exposes a chrome-less /display route meant for a TV/kiosk screen, showing just the calendar without the header or footer. It's configured entirely through URL query parameters, so it doesn't require any interaction once loaded:

  • view: month, week, or day (defaults to whatever view was last used on this browser)
  • date: YYYY-MM-DD, the date to center the view on (defaults to today)
  • plannings: comma-separated planning names to filter on, e.g. FISE1,FISA2 (case-insensitive, matched against each planning's name). Omit the parameter to keep the current filter, or pass an empty value (plannings=) to show every planning.
  • save: true to persist the view/plannings from this load to localStorage (like the main calendar page does), then redirect to a bare /display with no query params. Useful to configure a kiosk screen once and have it reload afterwards without needing the parameters again. Defaults to false (nothing is persisted).

Example (one-time setup, then bookmark the resulting bare /display): http://localhost:3000/display?view=week&plannings=FISE1,FISA2&save=true

When the browser goes fullscreen on the main calendar (F11 or the Fullscreen API), the app switches to /display on its own. Leaving fullscreen takes it back to /.

Accessing the API

The API is read-only. Data is written by the iCal importer (or by make seed). The following endpoints are available:

  • Health check: GET /api/health
  • List plannings: GET /api/plannings
  • Get the default planning: GET /api/plannings/default
  • Get a planning: GET /api/plannings/{id}
  • List a planning's events: GET /api/plannings/{id}/events
  • Get one event of a planning: GET /api/plannings/{planningId}/events/{uid}
  • List all events: GET /api/events
  • Get an event: GET /api/events/{id}

API Documentation

The API is documented using Swagger/OpenAPI. After running the server, you can access the Swagger UI at:

http://localhost:8080/swagger/index.html

The Swagger documentation files are generated and not included in version control (they're added to .gitignore). To generate the documentation:

# Navigate to backend directory
cd backend

# Generate Swagger documentation
make swagger

Backend Development

The backend is written in Go. For detailed instructions on running and developing the backend, see the backend README.

Prerequisites

  • Go 1.23 or higher (the Docker image builds with Go 1.24)
  • PostgreSQL database (or use the provided Docker Compose configuration)

Quick Commands

# Navigate to backend directory
cd backend

# Run the API server
make run

# Seed the database with sample data
make seed

# Run tests
make test

Frontend Development

The frontend is built with React, TypeScript, and Vite.

Prerequisites

  • Node.js 18 or higher
  • npm

Quick Commands

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

# Lint
npm run lint

# Build for production
npm run build

# Preview the production build
npm run preview

iCal Importer

A Go CLI that imports events from iCal URLs or files into the database. It creates the plannings automatically and deletes events that were removed from the source. See the iCal importer README.

cd ical-importer
go build -o ical-importer .

# Import one feed
./ical-importer import https://example.com/calendar.ics

# Sync every calendar listed in a config file
./ical-importer sync sync-config.yaml

In Kubernetes it runs as a CronJob (every hour by default), configured through helm/values.yaml.

Image Generator

A Python FastAPI service that renders a planning's day view as a PNG image, using the frontend's theme. See the image generator README.

  • GET /day-view?date=YYYY-MM-DD&width=800&height=1000: returns a PNG image
  • GET /health: health check

It reads events from the API set in BACKEND_URL.

Kubernetes Deployment

For deploying to Kubernetes, use the provided Helm chart:

Prerequisites

  • Kubernetes cluster
  • Helm 3.x installed
  • Docker (for building images)

Key Deployment Steps

# Build the images
docker build -t ghcr.io/do2024-2047/calendo-backend:latest ./backend
docker build -t ghcr.io/do2024-2047/calendo-frontend:latest ./frontend
docker build -t ghcr.io/do2024-2047/calendo-ical-importer:latest ./ical-importer
docker build -t ghcr.io/do2024-2047/calendo-image-generator:latest ./image-generator

# Deploy using Helm
helm install calendo ./helm --namespace <your-namespace> --create-namespace

In practice, CI builds and pushes these images to GHCR (the repositories set in helm/values.yaml) and deploys the chart on push.

The Helm chart includes:

  • Backend API deployment with health checks and autoscaling
  • Frontend deployment with Nginx serving the React application
  • Image generator deployment, with its own ingress
  • iCal importer CronJob and its calendar configuration (ConfigMap)
  • PostgreSQL cluster managed by CloudNativePG (the CNPG operator must be installed on the cluster)
  • One ingress with TLS that routes /api to the backend and everything else to the frontend

Contributing

Contributions are welcome! See CONTRIBUTING.md for how to report issues, run the checks and open a pull request.

License

CalenDO is released under the MIT License.

About

The DO Calendar

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages