Next.js 14 + Supabase dashboard with AI sync endpoints and optional Google Calendar integration.
npm install # or pnpm install / yarn
cp .env.example .env.localFill .env.local with your Supabase project values and an AI_SECRET_TOKEN.
- Create a new Supabase project at https://supabase.com
- Open the SQL editor in your Supabase dashboard
- Run
supabase/schema.sqlto create the database schema - Run
supabase/policies.sqlto set up Row Level Security policies - In Project Settings → API, copy:
- Project URL →
NEXT_PUBLIC_SUPABASE_URL - anon/public key →
NEXT_PUBLIC_SUPABASE_ANON_KEY - service_role key →
SUPABASE_SERVICE_ROLE_KEY
- Project URL →
npm run devVisit http://localhost:3000
curl -X POST http://localhost:3000/api/ai-sync \
-H "Authorization: Bearer $AI_SECRET_TOKEN" \
-H "content-type: application/json" \
-d '{
"tasks":[
{
"title":"Send vendor report",
"details":"Allen Woods requested Q4 numbers",
"source":{
"sender":"allen.woods@brinker.com",
"subject":"Q4 report",
"message_id":"<abc123>",
"date":"2025-10-07T12:00:00Z"
},
"due":"2025-10-09T17:00:00Z",
"priority":"High",
"status":"Todo",
"tags":["Brinker","Allen Woods"]
}
]
}'curl -H "Authorization: Bearer $AI_SECRET_TOKEN" \
"http://localhost:3000/api/ai-sync?since=2025-10-07T00:00:00Z"- Go to Google Cloud Console
- Create a new project or select existing
- Enable the Google Calendar API
- Create OAuth 2.0 credentials
- Set authorized redirect URI to:
http://localhost:3000/api/calendar/auth - Copy Client ID and Client Secret to your
.env.local:
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REDIRECT_URI=http://localhost:3000/api/calendar/auth
GOOGLE_CALENDAR_ID=primary
GOOGLE_OAUTH_SCOPES=https://www.googleapis.com/auth/calendar.events
GOOGLE_ENCRYPTION_KEY=your-32-character-encryption-key- Start the dev server and visit
/api/calendar/authto authorize - After authorization, you can click "Add to Calendar" on tasks with due dates
- Push your code to a Git repository (GitHub, GitLab, or Bitbucket)
- Import the project into Vercel
- Add all environment variables from
.env.examplein Vercel's project settings - Deploy!
In Vercel, you can configure cron jobs to hit your /api/ai-sync endpoint for automated task synchronization.
Example schedule (in vercel.json):
{
"crons": [
{
"path": "/api/ai-sync",
"schedule": "0 6-10,12,14,18 * * *"
}
]
}auburn-hills-taskboard/
├─ src/
│ ├─ app/
│ │ ├─ api/
│ │ │ ├─ ai-sync/route.ts # AI sync endpoint
│ │ │ ├─ tasks/route.ts # Tasks CRUD (GET/POST)
│ │ │ ├─ tasks/[id]/route.ts # Individual task (PATCH/DELETE)
│ │ │ ├─ calendar/auth/route.ts # Google OAuth flow
│ │ │ └─ calendar/add/[id]/route.ts # Add task to calendar
│ │ ├─ globals.css
│ │ ├─ layout.tsx
│ │ └─ page.tsx
│ ├─ components/
│ │ ├─ Filters.tsx # Status & priority filters
│ │ ├─ TaskCard.tsx # Individual task display
│ │ └─ TaskList.tsx # Task grid layout
│ ├─ lib/
│ │ ├─ calendar.ts # Encryption utils for Google tokens
│ │ ├─ supabaseBrowser.ts # Client-side Supabase
│ │ ├─ supabaseServer.ts # Server-side Supabase
│ │ └─ utils.ts # Validation & utilities
│ └─ types.ts # TypeScript types
├─ supabase/
│ ├─ schema.sql # Database schema
│ └─ policies.sql # Row Level Security policies
└─ public/
- Task Management: Create, update, and delete tasks with status tracking
- Priority & Status Filters: Filter tasks by priority (High/Med/Low) and status (Todo/In Progress/Waiting/Done)
- AI Sync API: RESTful API for programmatic task creation and updates
- Google Calendar Integration: One-click calendar event creation
- Email Source Tracking: Track task origins from email (sender, subject, message ID)
- Tags & Due Dates: Organize tasks with tags and deadlines
- Real-time Updates: SWR-based data fetching for responsive UI
- Framework: Next.js 14 (App Router)
- Database: Supabase (PostgreSQL)
- Styling: Tailwind CSS
- Data Fetching: SWR
- Validation: Zod
- Calendar: Google Calendar API
- TypeScript: Full type safety
MIT