A web app for adding events to Google Calendar using natural language. Type something like "finish problem set 3pm 1hr tomorrow" and it parses the title, date, time, and duration automatically.
- Sign in with your Google account.
- Type an event in natural language:
team meeting 2pm friday— creates a 1-hour eventdentist appointment 9:30am 45m march 15— 45-minute eventsubmit report tomorrow 5pm to 6pm— explicit time range
- The preview updates as you type, showing parsed title/date/time.
- Press Enter or click Add to Google Calendar.
Durations default to 1 hour if not specified. Supports formats like 1hr, 30m, 2 hours, 45 minutes.
- As you type, chrono-node extracts dates and times from natural language.
- A regex parser identifies duration patterns (
1hr,30m, etc.) and calculates end time. - The remaining text becomes the event title.
- On submit, the frontend sends parsed data to a Next.js API route.
- The server authenticates via NextAuth.js and calls the Google Calendar API to create the event.
src/
├── app/
│ ├── page.tsx # Main page, auth check
│ ├── layout.tsx # Root layout with SessionProvider
│ └── api/
│ ├── calendar/route.ts # POST endpoint to create events
│ └── auth/[...nextauth]/route.ts
├── components/
│ ├── EventInput.tsx # Input form with real-time parsing
│ ├── EventPreview.tsx # Shows parsed event details
│ └── Toast.tsx # Success/error notifications
└── lib/
├── auth.ts # NextAuth config, token refresh
├── parse-event.ts # Natural language parsing logic
├── google-calendar.ts # Google Calendar API client
└── types.ts # TypeScript declarations
- Node.js 18+
- Google Cloud project with Calendar API enabled
- OAuth 2.0 credentials (Web application type)
-
Clone the repository:
git clone https://github.com/Guanc27/calendar_quickadd.git cd calendar_quickadd npm install -
Create
.env.localwith your credentials:AUTH_SECRET=<generate with: openssl rand -base64 32> AUTH_GOOGLE_ID=<your-google-client-id> AUTH_GOOGLE_SECRET=<your-google-client-secret> -
In Google Cloud Console, add
http://localhost:3000/api/auth/callback/googleto authorized redirect URIs. -
Start the dev server:
npm run dev
Open http://localhost:3000.
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Production build |
npm start |
Run production server |
npm run lint |
Run ESLint |
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ User Browser │─────▶│ Vercel Edge │─────▶│ Google APIs │
│ │ │ (Next.js app) │ │ (Calendar, │
│ │◀─────│ │◀─────│ OAuth) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
The app is deployed on Vercel, which provides:
- Automatic deployments on git push
- Edge network for fast global delivery
- Serverless functions for API routes
- Free SSL certificates
GCP is used for authentication and calendar access (not hosting):
| Service | Purpose |
|---|---|
| OAuth 2.0 | User authentication via Google account |
| Calendar API | Create events on user's calendar |
Console: console.cloud.google.com
OAuth credentials are configured in APIs & Services → Credentials.
Set these in the Vercel dashboard under Settings → Environment Variables:
| Variable | Description |
|---|---|
AUTH_SECRET |
Random string for encrypting session tokens |
AUTH_GOOGLE_ID |
OAuth client ID from GCP |
AUTH_GOOGLE_SECRET |
OAuth client secret from GCP |
In Google Cloud Console, add these authorized redirect URIs:
- Local:
http://localhost:3000/api/auth/callback/google - Production:
https://<your-app>.vercel.app/api/auth/callback/google
Vercel auto-deploys when you push to main:
git add .
git commit -m "your changes"
git pushManual deploy via CLI:
npx vercel --prodMIT License