Files
calendars/CLAUDE.md
Sylvain Zimmer 81954a4ead (invitations) add invitation RSVP links in HTML emails (#10)
Also include many fixes and scalingo deployment
2026-02-19 18:15:47 +01:00

5.9 KiB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

La Suite Calendars is a modern calendar application for managing events and schedules. It's a full-stack application with:

  • Backend: Django 5 REST API with PostgreSQL
  • Frontend: Next.js 15 with React 19
  • CalDAV Server: SabreDAV (PHP-based) for calendar protocol support : https://sabre.io/dav/
  • Authentication: Keycloak OIDC provider

In this project, you can create events, invite people to events, create calendars, and invite others to share and manage those calendars, allowing them to add and manage events as well. Every invitation sends an email with an ICS file attached; this also happens for event updates and cancellations.

Common Commands

Development Setup

make bootstrap          # Initial setup: builds containers, runs migrations, starts services
make run                # Start all services (backend + frontend containers)
make run-backend        # Start backend services only (for local frontend development)
make stop               # Stop all containers
make down               # Stop and remove containers, networks, volumes

Backend Development

make test-back -- path/to/test.py::TestClass::test_method  # Run specific test
make test-back-parallel                                     # Run all tests in parallel
make lint                                                   # Run ruff + pylint
make migrate                                                # Run Django migrations
make makemigrations                                         # Create new migrations
make shell                                                  # Django shell
make dbshell                                                # PostgreSQL shell

Frontend Development

make frontend-development-install   # Install frontend dependencies locally
make run-frontend-development       # Run frontend locally (after run-backend)
make frontend-lint                  # Run ESLint on frontend
cd src/frontend/apps/calendars && yarn test              # Run frontend tests
cd src/frontend/apps/calendars && yarn test:watch        # Watch mode

E2E Tests

make run-tests-e2e                           # Run all e2e tests
make run-tests-e2e -- --project chromium --headed  # Run with specific browser

Internationalization

make i18n-generate         # Generate translation files
make i18n-compile          # Compile translations
make crowdin-upload        # Upload sources to Crowdin
make crowdin-download      # Download translations from Crowdin

Architecture

Backend Structure (src/backend/)

  • calendars/ - Django project configuration, settings, Celery app
  • core/ - Main application code:
    • api/ - DRF viewsets and serializers
    • models.py - Database models
    • services/ - Business logic
    • authentication/ - OIDC authentication
    • tests/ - pytest test files

Frontend Structure (src/frontend/)

Yarn workspaces monorepo:

  • apps/calendars/ - Main Next.js application
    • src/features/ - Feature modules (calendar, auth, api, i18n, etc.)
    • src/pages/ - Next.js pages
    • src/hooks/ - Custom React hooks
  • apps/e2e/ - Playwright end-to-end tests

CalDAV Server (docker/sabredav/)

PHP SabreDAV server providing CalDAV protocol support, running against the shared PostgreSQL database.

IMPORTANT: Never query the SabreDAV database tables directly from Django. Always interact with CalDAV through the SabreDAV HTTP API (PROPFIND, REPORT, PUT, etc.).

Development Services

Service URL / Port Description
Frontend http://localhost:8920 Next.js Calendar frontend
Backend API http://localhost:8921 Django REST API
CalDAV http://localhost:8922 SabreDAV CalDAV server
Nginx http://localhost:8923 Reverse proxy (frontend + API)
Redis 8924 Cache and Celery broker
Keycloak http://localhost:8925 OIDC identity provider
PostgreSQL 8926 Database server
Mailcatcher http://localhost:8927 Email testing interface

Key Technologies

Backend

  • Django 5 with Django REST Framework
  • Celery with Redis for background tasks
  • pytest for testing (use bin/pytest wrapper)
  • Ruff for linting/formatting (100 char line length for pylint compatibility)

Frontend

Code Style

Python

  • Follow PEP 8 with 100 character line limit
  • Use Django REST Framework viewsets for APIs
  • Business logic in models and services, keep views thin
  • Use select_related/prefetch_related for query optimization

TypeScript/React

  • Feature-based folder structure under src/features/
  • Use React Query for server state management as possible, if it is not possible, don't worry.
  • Use the vercel-react-best-practices skill when you write a react code
  • Please, make many tiny files and separate components in differentes files
  • Check for Lint and TypeScript errors before telling me that you have finished

Git

  • Maximum line length: 80 characters.
  • Each commit must have a title and a description.
  • The commit title should start with a Gitmoji, then the area in parentheses (e.g. back, front, docs), then your chosen title.

Workflow

  • Be sure to typecheck when you're done making a series of code changes
  • Prefer running single tests, and not the whole test suite, for performance