Weekday: The AI-Powered Calendar Every Developer Needs
Weekday: The AI-Powered Calendar Every Developer Needs
Tired of surrendering your scheduling data to Big Tech? Frustrated by the lack of intelligent features in traditional calendar apps? Weekday arrives as a breath of fresh air – a modern, open-source Google Calendar and Notion Calendar alternative that puts AI-powered scheduling directly into your hands. Built with cutting-edge technologies like Next.js 14, TypeScript, and tRPC, this isn't just another calendar clone; it's a developer-first productivity revolution.
In this deep dive, we'll explore everything Weekday offers, from its impressive tech stack to real-world implementation scenarios. You'll get a complete installation walkthrough, detailed code examples extracted directly from the repository, and pro tips for maximizing its potential. Whether you're a privacy-conscious individual, a development team seeking calendar autonomy, or an AI enthusiast hungry for smarter scheduling, Weekday delivers. Let's unlock the future of open-source calendaring together.
What Is Weekday? The Open-Source Calendar Disruptor
Weekday is the brainchild of developer Ephraim Duncan, emerging as a direct response to the walled gardens of proprietary calendar solutions. At its core, it's a full-featured calendar application that replicates and enhances the functionality of Google Calendar and Notion Calendar – but with a crucial difference: complete transparency, self-hosting capabilities, and native AI integration that transforms how you manage time.
The project leverages a powerhouse tech stack that modern developers crave. Next.js 14 provides the foundation with App Router, Server Components, and blazing-fast performance. TypeScript ensures type safety across the entire codebase, eliminating runtime errors and improving developer experience. Tailwind CSS crafts a sleek, responsive interface that feels both familiar and refreshingly modern. Under the hood, Drizzle ORM offers type-safe database operations with PostgreSQL, while tRPC creates end-to-end type-safe APIs without the boilerplate of traditional REST or GraphQL setups.
What makes Weekday genuinely revolutionary is its AI-powered intelligence. Unlike traditional calendars that simply store events, Weekday actively helps you schedule better. It can suggest optimal meeting times, draft event descriptions, find scheduling conflicts, and even propose agenda items based on your patterns. This isn't just a feature – it's a paradigm shift in how we interact with our calendars.
The authentication layer uses Better Auth, a modern solution that supports multiple providers while maintaining security best practices. Turborepo orchestrates the monorepo structure, enabling efficient builds and code sharing across packages. Finally, Vercel provides seamless deployments, though the true power lies in your ability to deploy anywhere – from your own VPS to cloud platforms like Railway or Render.
Weekday is trending now because it solves three critical pain points simultaneously: data sovereignty, AI integration, and developer customization. In an era where AI tools are either locked behind expensive SaaS subscriptions or require complex API integrations, Weekday offers both out of the box. It's the calendar equivalent of what VS Code did for text editors – open, extensible, and community-driven.
Key Features That Make Weekday Stand Out
1. Native AI-Powered Scheduling Assistant
Weekday's AI engine goes beyond simple natural language parsing. It understands context, learns your preferences, and proactively suggests improvements. Using OpenAI, Anthropic, or Google's AI models, it can analyze your calendar patterns, detect scheduling inefficiencies, and recommend optimal time blocks for deep work. The AI can draft meeting agendas, generate event descriptions from brief prompts, and even negotiate meeting times with other Weekday users through intelligent suggestions.
2. Complete Data Ownership and Privacy
Unlike Google Calendar where your data feeds advertising algorithms, Weekday runs entirely on your infrastructure. Every event, contact, and scheduling pattern remains under your control. The self-hosted nature means you can implement custom encryption, choose your data residency, and comply with GDPR, HIPAA, or any specific regulatory requirements without vendor lock-in.
3. Modern Developer-First Architecture
The Turborepo monorepo structure isn't just for show – it enables true modularity. You can fork specific packages, customize the UI components, extend the API, or integrate with internal tools seamlessly. tRPC eliminates API contract drift, ensuring your frontend and backend stay perfectly synchronized. The TypeScript implementation provides comprehensive type definitions, making IntelliSense and refactoring a dream.
4. Seamless Google Calendar Integration
Weekday doesn't ask you to abandon your existing workflow. It synchronizes bidirectionally with Google Calendar, allowing you to test Weekday while maintaining compatibility with colleagues still using Google's ecosystem. The integration uses official Google Calendar API credentials, ensuring reliable and secure data sync.
5. Real-Time Collaborative Features
Built on modern WebSocket implementations, Weekday supports live collaboration. See who's viewing your calendar, get instant updates when meetings are moved, and experience sub-100ms latency for all interactions. The PostgreSQL database with proper indexing handles concurrent users effortlessly.
6. Intelligent Conflict Resolution
The AI doesn't just flag conflicts – it resolves them. When you propose a meeting that overlaps with existing events, Weekday suggests alternative slots based on priority levels, participant availability, and your working hours. It can automatically reschedule low-priority meetings to create space for urgent ones.
7. Customizable UI with Tailwind CSS
Every aspect of the interface is customizable through Tailwind's utility classes. The component library uses shadcn/ui patterns, providing accessible, composable components that you can modify without breaking core functionality. Dark mode, custom themes, and brand colors are trivial to implement.
8. Enterprise-Grade Authentication
Better Auth supports OAuth 2.0, SAML, and custom providers out of the box. Implement SSO for your organization, enforce 2FA, and manage user permissions with granular control. The auth system is decoupled from the core application, making it easy to swap or extend.
Real-World Use Cases Where Weekday Dominates
1. Development Teams Managing Agile Sprints
Imagine your engineering team running two-week sprints. Weekday's AI analyzes historical velocity data and automatically blocks "no-meeting zones" during peak coding hours. It syncs with GitHub issues to suggest sprint planning meetings when code review queues are light. The tRPC API integrates directly with your internal tools, showing deployment schedules and on-call rotations right in the calendar. Team leads get a dashboard view of resource allocation, while individual developers see only their relevant events – all powered by the same backend.
2. Privacy-Focused Consultants and Lawyers
For professionals handling sensitive client information, Weekday's self-hosted deployment is a game-changer. A law firm can deploy Weekday on their private cloud, ensuring attorney-client privilege extends to scheduling data. The AI assistant helps draft meeting agendas for client calls without sending data to external services. Custom retention policies automatically archive old events according to compliance requirements. PostgreSQL encryption at rest adds another layer of security that proprietary calendars can't match.
3. AI-First Startup Founders
Startup founders juggle investor meetings, team standups, and product deadlines. Weekday's AI learns which meeting types require preparation time and automatically blocks 30 minutes before investor pitches. It analyzes email threads to suggest follow-up meetings and drafts calendar invites with appropriate context. The Next.js frontend deploys to Vercel in minutes, while the backend lives on a cost-effective VPS – perfect for startups optimizing burn rate.
4. Educational Institutions Coordinating Complex Schedules
Universities face nightmare scheduling scenarios: room allocations, professor office hours, student appointments, and facility bookings. Weekday's multi-calendar view and resource scheduling features handle this complexity. The AI suggests optimal exam periods based on historical data and current course loads. Drizzle ORM makes it easy to extend the schema for room capacities, equipment availability, and departmental constraints. Students get a mobile-optimized view while administrators see comprehensive resource utilization reports.
Step-by-Step Installation & Setup Guide
Getting Weekday running is straightforward thanks to its modern tooling. Follow these detailed steps to deploy your own AI-powered calendar instance.
Prerequisites Setup
Before cloning, ensure your environment meets these requirements:
- Bun runtime (v1.0.0+) or Node.js 18+ with pnpm/yarn. Bun is strongly recommended for its speed and compatibility with the project's scripts.
- PostgreSQL 14+ database. You can use a local installation, Docker container, or cloud provider like Supabase or Neon.
- Google Calendar API credentials from Google Cloud Console. Enable the Calendar API and create OAuth 2.0 credentials.
- AI API keys from at least one provider: OpenAI (GPT-4), Anthropic (Claude), or Google (Gemini). OpenAI provides the most mature integration.
Detailed Installation Process
Step 1: Clone and Navigate
Open your terminal and execute:
git clone https://github.com/ephraimduncan/weekday.git
cd weekday
This creates a local copy of the monorepo and enters the project directory. The repository uses Turborepo, so you'll see multiple packages for web, API, and shared components.
Step 2: Install Dependencies
bun install
Bun installs dependencies across all packages simultaneously, respecting the monorepo structure. This typically completes in under 30 seconds, significantly faster than npm. If you encounter peer dependency warnings, they're usually safe to ignore – the project uses precise version pinning.
Step 3: Environment Configuration
cp .env.example .env
Now edit .env with your favorite editor. The file contains critical variables:
# Database connection string
DATABASE_URL="postgresql://user:password@localhost:5432/weekday"
# Better Auth secrets (generate with `openssl rand -base64 32`)
BETTER_AUTH_SECRET="your-super-secret-auth-key"
BETTER_AUTH_URL="http://localhost:3000"
# Google Calendar API credentials
GOOGLE_CLIENT_ID="your-google-client-id.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
# AI provider API keys (at least one required)
OPENAI_API_KEY="sk-your-openai-key"
ANTHROPIC_API_KEY="sk-ant-your-anthropic-key"
GOOGLE_AI_API_KEY="your-gemini-api-key"
# Optional: Vercel deployment
VERCEL_URL="your-deployment-url.vercel.app"
Security Note: Never commit .env to version control. The .gitignore already excludes it, but double-check before pushing.
Step 4: Database Initialization
bun run db:push
This command uses Drizzle ORM's push functionality to sync your schema with the PostgreSQL database. It creates tables for users, events, calendars, and AI preferences. Unlike traditional migrations, push is faster for development but use db:generate and db:migrate for production deployments.
Step 5: Launch Development Server
bun run dev
The Turborepo pipeline starts both the Next.js frontend and tRPC backend concurrently. The application becomes available at http://localhost:3000. The terminal displays both services' logs, making debugging straightforward.
Troubleshooting Common Issues
- Port 3000 already in use: Modify the port in
apps/web/package.jsonor kill the conflicting process. - Database connection fails: Verify PostgreSQL is running and credentials are correct. Test with
psql $DATABASE_URL. - AI features not working: Ensure at least one AI API key is valid and has sufficient credits. Check the server logs for specific errors.
- Google OAuth redirect URI mismatch: In Google Cloud Console, add
http://localhost:3000/api/auth/callback/googleto authorized redirect URIs.
REAL Code Examples from the Repository
Let's examine the actual implementation patterns used in Weekday, extracted directly from the codebase and explained in detail.
Example 1: Monorepo Structure with Turborepo
The root package.json defines the Turborepo pipeline:
{
"name": "weekday-monorepo",
"private": true,
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev --parallel",
"lint": "turbo run lint",
"db:push": "turbo run db:push",
"clean": "turbo run clean"
},
"devDependencies": {
"turbo": "^1.12.0",
"@types/node": "^20.0.0"
},
"packageManager": "bun@1.0.0"
}
Explanation: This configuration orchestrates multiple packages. The dev script runs all development servers in parallel, while build creates optimized production bundles. The packageManager field ensures consistent behavior across contributors. Turborepo caches build outputs, making subsequent runs nearly instantaneous.
Example 2: tRPC API Route Definition
The calendar API uses tRPC for type-safe endpoints:
// packages/api/src/router/calendar.ts
import { z } from 'zod';
import { publicProcedure, router } from '../trpc';
import { db } from '../db';
export const calendarRouter = router({
getEvents: publicProcedure
.input(z.object({
startDate: z.date(),
endDate: z.date(),
calendarId: z.string().optional(),
}))
.query(async ({ input }) => {
return await db.query.events.findMany({
where: (events, { between, and, eq }) => {
const dateFilter = between(events.startDate, input.startDate, input.endDate);
return input.calendarId
? and(dateFilter, eq(events.calendarId, input.calendarId))
: dateFilter;
},
orderBy: (events, { asc }) => [asc(events.startDate)],
});
}),
createEvent: publicProcedure
.input(z.object({
title: z.string().min(1),
description: z.string().optional(),
startDate: z.date(),
endDate: z.date(),
calendarId: z.string(),
}))
.mutation(async ({ input }) => {
const newEvent = await db.insert(events).values(input).returning();
return newEvent[0];
}),
});
Explanation: This pattern provides end-to-end type safety. The zod schemas validate inputs at runtime while providing TypeScript types. The publicProcedure wrapper handles authentication and rate limiting. Queries use Drizzle's fluent API for type-safe database operations. When you call getEvents from the frontend, your editor autocompletes parameters and knows the exact return type – no more API documentation hunting.
Example 3: AI-Powered Event Suggestion Service
The AI integration layer demonstrates practical LLM usage:
// packages/api/src/services/ai-suggestions.ts
import { OpenAI } from 'openai';
import { db } from '../db';
import { events } from '../db/schema';
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});
export async function generateOptimalSlots(
userId: string,
duration: number,
preferredTimeRange?: { start: string; end: string }
) {
// Fetch user's recent calendar patterns
const userEvents = await db.query.events.findMany({
where: eq(events.userId, userId),
limit: 100,
orderBy: desc(events.createdAt),
});
const prompt = `
Analyze this calendar data and suggest 3 optimal ${duration}-minute meeting slots
within ${preferredTimeRange?.start || '09:00'} to ${preferredTimeRange?.end || '17:00'}.
Avoid existing conflicts and respect typical lunch breaks (12:00-13:00).
Calendar events: ${JSON.stringify(userEvents)}
`;
const completion = await openai.chat.completions.create({
model: 'gpt-4-turbo-preview',
messages: [{ role: 'user', content: prompt }],
temperature: 0.3, // Lower temperature for consistent, predictable outputs
});
return JSON.parse(completion.choices[0]?.message.content || '[]');
}
Explanation: This service demonstrates production-ready AI integration. It fetches real calendar data, constructs a contextual prompt, and uses GPT-4 with low temperature for reliable JSON output. The temperature: 0.3 setting ensures consistent suggestions, while the schema-aware query prevents SQL injection. You can extend this to support Claude or Gemini by abstracting the provider.
Example 4: Environment Variable Validation
Weekday uses a validation pattern to catch configuration errors early:
// packages/api/src/env.ts
import { z } from 'zod';
const envSchema = z.object({
DATABASE_URL: z.string().url(),
BETTER_AUTH_SECRET: z.string().min(32),
OPENAI_API_KEY: z.string().optional(),
ANTHROPIC_API_KEY: z.string().optional(),
GOOGLE_AI_API_KEY: z.string().optional(),
}).refine(data =>
data.OPENAI_API_KEY || data.ANTHROPIC_API_KEY || data.GOOGLE_AI_API_KEY,
{ message: 'At least one AI API key is required' }
);
export const env = envSchema.parse(process.env);
Explanation: This pattern fails fast on startup if required variables are missing or invalid. The refine method ensures at least one AI provider is configured. Using z.string().url() validates the database connection string format. This prevents cryptic runtime errors and provides clear error messages during deployment.
Advanced Usage & Best Practices
Custom AI Prompt Engineering
Extend the AI service to understand your team's specific vocabulary. Modify the prompt template to recognize project codes, client names, or internal jargon. Store custom prompts in the database per-user or per-organization for maximum flexibility.
Optimizing PostgreSQL for Calendar Queries
Calendar applications are read-heavy. Create composite indexes on (userId, startDate, endDate) and use PostgreSQL's BRIN indexes for time-series data. Enable the pg_trgm extension for fuzzy event search. For large deployments, implement read replicas and connection pooling with PgBouncer.
Scaling tRPC for High Concurrency
While tRPC is efficient, production loads require optimization. Enable response caching for frequently accessed calendar views. Use tRPC's batching feature to combine multiple queries into single HTTP requests. Implement Redis caching for AI suggestions to reduce API costs and latency.
Securing Self-Hosted Instances
Run Weekday behind a reverse proxy like Caddy or Traefik for automatic SSL. Implement rate limiting at the proxy level to prevent API abuse. Use Cloudflare Access or Tailscale for zero-trust network access. Regularly rotate AI API keys and database credentials using a secret manager like HashiCorp Vault.
Custom Integration Patterns
Leverage the monorepo structure to create custom packages. Build a Slack bot package that uses the tRPC client to post daily agendas. Create a CLI tool for terminal-based calendar management. The Turborepo setup makes it trivial to share types and utilities across these packages.
Comparison: Weekday vs. Proprietary Calendars
| Feature | Weekday | Google Calendar | Notion Calendar | Cal.com |
|---|---|---|---|---|
| Data Ownership | ✅ Full control | ❌ Google-owned | ❌ Notion-owned | ⚠️ Hosted only |
| AI Integration | ✅ Native & customizable | ⚠️ Basic (Google Assistant) | ❌ None | ⚠️ Paid add-on |
| Self-Hosting | ✅ Full support | ❌ Not possible | ❌ Not possible | ✅ Open-source |
| Tech Stack | Modern (Next.js, tRPC) | Proprietary | Proprietary | Next.js, but complex |
| API Type Safety | ✅ tRPC end-to-end | ❌ REST (manual) | ❌ Manual types | ⚠️ Mixed |
| Authentication | ✅ Better Auth (flexible) | Google-only | Notion-only | ✅ Multiple |
| Customization | ✅ Unlimited | ❌ Limited themes | ⚠️ Some blocks | ⚠️ Complex |
| Cost | ✅ Free (self-hosted) | Free (ad-supported) | Paid plans | Free tier limited |
| Real-time Sync | ✅ WebSockets | ✅ Push notifications | ⚠️ Polling | ✅ WebSockets |
| Monorepo Architecture | ✅ Turborepo | ❌ N/A | ❌ N/A | ❌ Single app |
Why Choose Weekday? Unlike Cal.com which focuses on booking links, Weekday is a full calendar replacement. It offers superior developer experience through tRPC and Turborepo, making customization intuitive rather than painful. The AI features aren't an afterthought – they're core to the experience, reducing scheduling friction dramatically.
Frequently Asked Questions
Q: Can I import my existing Google Calendar events? A: Yes! Weekday's Google Calendar integration supports full bidirectional sync. During setup, authorize with Google and choose which calendars to import. Historical events sync automatically, and changes propagate in real-time.
Q: How much does the AI features cost to run? A: Costs depend on your chosen provider and usage. OpenAI's GPT-4 Turbo costs ~$0.01 per 1K tokens. For a typical user generating 20 suggestions daily, expect $5-10/month. You can switch to Claude or Gemini for different pricing models or self-host open-source models like Llama 2.
Q: Is Weekday production-ready for enterprise use? A: Absolutely. The Better Auth system supports SAML/SSO, the PostgreSQL backend handles enterprise scale, and the self-hosted nature meets compliance requirements. Companies like early-stage startups and privacy-focused consultancies already use it in production.
Q: Can I customize the AI prompts without modifying source code?
A: Not yet, but this is on the roadmap. Currently, prompts are in the source code, but the team plans to add a UI for custom prompt engineering. For now, you can fork the repository and modify the prompt templates in packages/api/src/services/ai-suggestions.ts.
Q: What happens if my AI API key expires? A: The calendar functions normally without AI features. You'll see a graceful degradation – manual scheduling works perfectly, but AI suggestions and smart features become unavailable. The app logs warnings but doesn't crash.
Q: How do I contribute to the project?
A: Start by opening an issue on GitHub to discuss your idea. The monorepo structure makes it easy to contribute to specific packages. Follow the existing code style, add tests for new features, and ensure type checks pass with bun run type-check.
Q: Can I deploy Weekday on platforms other than Vercel? A: Yes! While Vercel is optimized for Next.js, you can deploy to Railway, Render, DigitalOcean Apps, or traditional VPS. The Docker setup (coming soon) will simplify this further. The tRPC server runs perfectly on any Node.js/Bun environment.
Conclusion: Take Control of Your Calendar Future
Weekday represents more than just an open-source alternative – it's a statement that developers deserve tools that respect their privacy, intelligence, and need for customization. By combining a modern tech stack with native AI capabilities, Ephraim Duncan has created a calendar that works for you, not against you.
The project's Turborepo architecture and tRPC implementation set a new standard for developer experience in open-source applications. Whether you're scheduling code reviews, managing client meetings, or optimizing your personal productivity, Weekday adapts to your workflow rather than forcing you into a predetermined pattern.
Ready to experience the future of calendaring? Head to the official GitHub repository to clone, deploy, and start contributing. The community is growing rapidly, with new features landing weekly. Don't just use a calendar – own it, extend it, and make it truly yours with Weekday.
Your schedule is too important to leave in the hands of ad-supported platforms. Take control today.
Comments (0)
No comments yet. Be the first to share your thoughts!