Overview
Chronos Calendar can be run as a web application (Vite dev server) or as a native desktop app (Electrobun). This guide covers both deployment methods with detailed configuration steps.Web Application
React + Vite frontend with FastAPI backend, suitable for browser-based access
Desktop Application
Electrobun-powered native app with system keychain integration
System Requirements
For Web Development
- Node.js: 18.x or higher
- npm: 9.x or higher (comes with Node.js)
- Python: 3.11 or higher
- pip: Latest version
- Git: For version control
For Desktop Builds
All of the above, plus:- Bun: Latest version (Electrobun dependency)
- Platform-specific tools:
- macOS: Xcode Command Line Tools
- Linux: Build essentials (
build-essentialon Ubuntu/Debian) - Windows: Visual Studio Build Tools
The desktop app uses Electrobun, which requires Bun runtime. Install from bun.sh.
Initial Setup
Install Backend Dependencies
Set up the Python environment:Key dependencies from
requirements.txt:Using a virtual environment is strongly recommended to isolate dependencies.
Create Supabase Project
Set up your Supabase backend:
- Create a project at supabase.com
- Note your credentials from Settings > API:
- Project URL:
https://xxxxx.supabase.co - Service Role Key (secret, not anon key)
- Project URL:
- Enable Google Auth in Authentication > Providers
- Set up database tables (if not using migrations):
google_accounts- Store connected Google accountsgoogle_account_tokens- Store encrypted OAuth tokenscalendars- Calendar metadataevents- Calendar events (encrypted)todos- Todo items (encrypted)todo_lists- Todo list containersrevoked_tokens- Track revoked session tokens
Configure Google Cloud
Set up Google Calendar API access:
- Create or select a project in Google Cloud Console
- Enable Google Calendar API:
- Navigate to APIs & Services > Library
- Search for “Google Calendar API”
- Click Enable
- Create OAuth 2.0 Credentials:
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Application type: Web application
- Name: “Chronos Calendar”
- Add Authorized Redirect URIs:
- Copy credentials:
- Client ID:
xxxxx.apps.googleusercontent.com - Client Secret:
xxxxx
- Client ID:
backend/app/routers/auth.py:135-136):access_type: "offline" ensures you receive a refresh token for long-term calendar access.Web Application
Development Mode
Run both frontend and backend in development mode:- Frontend:
http://localhost:5174 - Backend:
http://localhost:8000 - API Docs:
http://localhost:8000/docs(auto-generated Swagger UI)
Production Build
Build optimized production bundles:For production hosting, configure the environment variables and use a process manager like systemd or Docker to run the application.
Desktop Application
Install Electrobun
First, install Bun (Electrobun dependency):Desktop Configuration
Electrobun config (frontend/src-electrobun/electrobun.config.ts):
urlSchemes array defines the custom URL protocol (chronoscalendar://) used for OAuth callbacks.
Development Mode
Run the desktop app in development:package.json:11):
Production Build
Build platform-specific desktop apps:package.json:12-13:
Desktop-Specific Features
The desktop app includes platform-specific code: Keychain Integration (frontend/src/main.tsx:47-57):
backend/app/routers/auth.py:275-373):
The desktop app stores OAuth tokens in the system keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service) for enhanced security.
Vite Proxy Configuration
The frontend proxies API requests to the backend (frontend/vite.config.ts:17-33):
- Routes
/api/*requests to the backend - Strips
/apiprefix before forwarding - Removes cookie domain restrictions for localhost development
Testing the Installation
Backend Tests
Run the test suite:Manual Testing
Verify each component:Test Authentication
- Open
http://localhost:5174 - Click “Sign in with Google”
- Complete OAuth flow
- Verify session cookies in DevTools
- Check
/auth/sessionendpoint returns user data
Test Calendar Sync
- After authentication, navigate to calendar view
- Click sync or wait for auto-sync
- Open Network tab, filter for EventSource
- Verify events stream via SSE
- Check events appear in the UI
Troubleshooting
Module Import Errors (Python)
Module Import Errors (Python)
If you see
ModuleNotFoundError:Node Module Errors
Node Module Errors
If you see
Cannot find module errors:Electrobun Build Failures
Electrobun Build Failures
Desktop build issues:Platform-specific:
- macOS: Install Xcode Command Line Tools:
xcode-select --install - Linux: Install build essentials:
sudo apt-get install build-essential - Windows: Install Visual Studio Build Tools
Database Connection Issues
Database Connection Issues
Supabase connection problems:
- Verify
SUPABASE_URLandSUPABASE_SERVICE_ROLE_KEY - Check if your Supabase project is paused (free tier)
- Test connection manually:
OAuth Redirect Errors
OAuth Redirect Errors
Google OAuth redirect mismatch:
- URIs must exactly match (no trailing slashes)
- Check both Google Cloud Console and
.envfile - For desktop: Ensure
chronoscalendar://is registered - Clear browser cookies and try again
CSRF Token Errors
CSRF Token Errors
If you see 403 CSRF errors:
- Check
CSRF_SECRET_KEYis set and consistent - Verify
CSRF_COOKIE_NAMEmatches frontend expectations - Ensure cookies are enabled in browser
- The frontend auto-retries with CSRF bootstrap (see
AuthContext.tsx:49-60)
Next Steps
API Reference
Explore all available endpoints and their schemas
Configuration
Deep dive into environment variables and settings
Architecture
Understand the system design and data flow
Deployment
Deploy to production with Docker and cloud providers
For quick setup without detailed configuration, see the Quickstart guide.