Prerequisites
Before you begin, ensure you have:- Node.js 18+ and npm installed
- Python 3.11+ with pip
- A Supabase account (free tier works)
- Google Cloud Console access for OAuth credentials
This quickstart focuses on getting the web version running locally. For desktop builds, see the Installation guide.
Quick Setup
Clone and Install
Get the source code and install dependencies:The backend requires these key packages:
fastapi- Modern async web frameworksupabase- Authentication and database clientuvicorn[standard]- ASGI server with performance extrasslowapi- Rate limitingcryptography- Field-level encryption
Set Up Supabase
Create a new Supabase project and get your credentials:
- Go to supabase.com and create a new project
- Navigate to Settings > API and copy:
- Project URL (e.g.,
https://xxxxx.supabase.co) - Service role key (secret key, not anon key)
- Project URL (e.g.,
- Go to Authentication > Providers and enable Google
Configure Google OAuth
Set up OAuth 2.0 credentials for Google Calendar access:
- Visit Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Calendar API:
- Go to APIs & Services > Library
- Search for “Google Calendar API” and enable it
- Create OAuth 2.0 credentials:
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Choose Web application
- Add authorized redirect URIs:
- Copy your Client ID and Client Secret
The Google OAuth setup requires both the Calendar API scope and offline access to receive refresh tokens.
Start the Backend
Launch the FastAPI server:You should see:Verify the API is running:
The backend runs on port 8000 by default. The frontend Vite dev server will proxy
/api/* requests to this backend.Start the Frontend
In a new terminal, launch the Vite dev server:The app will be available at
http://localhost:5174Vite configuration from frontend/vite.config.ts:18-32:First Login
Complete your first authentication:The backend handles the OAuth flow in
- Open
http://localhost:5174in your browser - Click Sign in with Google
- Authorize Chronos Calendar to access your Google Calendar
- You’ll be redirected back with an active session
frontend/src/contexts/AuthContext.tsx:87-106):backend/app/routers/auth.py:117-141, requesting these scopes:First Calendar Sync
After logging in, sync your Google Calendar:
- Navigate to the Calendar view in the app
- Click Sync Calendars or wait for automatic sync
- Your Google Calendar events will stream in via Server-Sent Events (SSE)
- Backend fetches events from Google Calendar API
- Events are encrypted and stored in Supabase
- Real-time updates stream via SSE
- Frontend caches events with TanStack Query
The first sync might take a few seconds depending on the number of calendars and events you have.
Verify Your Setup
Confirm everything is working:Check Backend Health
Check Backend Health
Check Session Cookies
Check Session Cookies
Check CSRF Token
Check CSRF Token
The frontend automatically handles CSRF tokens:
- Check for
chronos_csrfcookie - The AuthContext handles refresh with CSRF bootstrap (from
AuthContext.tsx:49-60):
Check Calendar Sync
Check Calendar Sync
- Open the browser DevTools > Network tab
- Filter for
/calendar/syncrequests - You should see EventSource connections with
text/event-stream - Events stream in real-time with format:
Common Issues
CORS Errors
CORS Errors
If you see CORS errors in the browser console:
- Verify
FRONTEND_URL=http://localhost:5174in.env - Check that
CORS_ORIGINSmatches your frontend URL - Ensure the backend is running on port 8000
- Restart both frontend and backend after
.envchanges
OAuth Redirect Mismatch
OAuth Redirect Mismatch
If Google OAuth fails with redirect URI mismatch:
- Verify the redirect URI in Google Cloud Console exactly matches:
- Check
OAUTH_REDIRECT_URLSin.envmatches the URI - Ensure no trailing slashes
Session Not Persisting
Session Not Persisting
If you’re logged out on page refresh:
- Check browser cookies are enabled
- Verify
COOKIE_SECURE=falsefor local development - Check
COOKIE_SAMESITE=lax(notnoneorstrict) - Clear browser cookies and try again
Database Connection Failed
Database Connection Failed
If the backend can’t connect to Supabase:
- Verify
SUPABASE_URLandSUPABASE_SERVICE_ROLE_KEYare correct - Check your Supabase project is not paused (free tier pauses after inactivity)
- Test the connection with a simple Supabase query
Next Steps
Now that you have Chronos Calendar running:Explore the API
Learn about all available endpoints and their parameters
Set Up Desktop App
Build the Electrobun desktop version with native features
Configure Webhooks
Enable real-time Google Calendar notifications
Deploy to Production
Deploy your instance to production hosting
For a complete development setup with database migrations, testing, and advanced configuration, see the full Installation Guide.