MCPcopy Index your code
hub / github.com/Kanba-co/kanba

github.com/Kanba-co/kanba @1.06

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.06 ↗ · + Follow
285 symbols 878 edges 103 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Local API Routes Deployment Guide

Overview

This application now uses local Next.js API routes instead of Supabase Edge Functions for Stripe integration. This makes deployment simpler and allows you to use standard .env files for configuration.

Environment Variables Setup

1. Create .env.local file

Copy .env.example to .env.local and fill in your actual values:

cp .env.example .env.local

2. Required Environment Variables

Supabase Configuration

  • NEXT_PUBLIC_SUPABASE_URL - Your Supabase project URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY - Your Supabase anonymous key
  • SUPABASE_SERVICE_ROLE_KEY - Your Supabase service role key (server-side only)

Stripe Configuration

  • STRIPE_SECRET_KEY - Your Stripe secret key (server-side only)
  • NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY - Your Stripe publishable key
  • STRIPE_WEBHOOK_SECRET - Your Stripe webhook secret

Site Configuration

  • NEXT_PUBLIC_SITE_URL - Your site URL (for production)
  • NEXTAUTH_URL - Your site URL (same as above)
  • NEXTAUTH_SECRET - A random secret for NextAuth

Local Development

  1. Install dependencies:
npm install
  1. Set up your environment variables in .env.local

  2. Run the development server:

npm run dev
  1. Test Stripe webhooks locally using Stripe CLI:
stripe listen --forward-to localhost:3000/api/stripe/webhook

Production Deployment

Netlify Deployment

  1. Build Settings:
  2. Build command: npm run build
  3. Publish directory: .next

  4. Environment Variables: Add all the environment variables from your .env.local file to Netlify's environment variables section.

  5. Stripe Webhook Setup:

  6. Create a webhook endpoint in your Stripe dashboard
  7. Point it to: https://your-domain.netlify.app/api/stripe/webhook
  8. Select the following events:
    • checkout.session.completed
    • customer.subscription.created
    • customer.subscription.updated
    • customer.subscription.deleted
    • invoice.payment_succeeded
    • invoice.payment_failed

Vercel Deployment

  1. Deploy to Vercel:
npx vercel
  1. Environment Variables: Add all environment variables through Vercel dashboard or CLI

  2. Stripe Webhook Setup:

  3. Point webhook to: https://your-domain.vercel.app/api/stripe/webhook

API Endpoints

The application now uses these local API routes:

  • POST /api/stripe/checkout - Creates Stripe checkout sessions
  • POST /api/stripe/webhook - Handles Stripe webhook events

Benefits of Local API Routes

  1. Simpler Deployment - No need to deploy separate edge functions
  2. Environment Variables - Standard .env file support
  3. Better Debugging - Easier to debug locally
  4. Framework Integration - Better integration with Next.js
  5. No Vendor Lock-in - Can deploy to any platform that supports Next.js

Troubleshooting

  1. Webhook Issues:
  2. Ensure STRIPE_WEBHOOK_SECRET matches your Stripe webhook endpoint
  3. Check webhook logs in Stripe dashboard
  4. Verify webhook URL is correct

  5. Environment Variables:

  6. Ensure all required variables are set
  7. Check for typos in variable names
  8. Verify Supabase service role key has proper permissions

  9. CORS Issues:

  10. API routes include proper CORS headers
  11. Ensure your domain is whitelisted if needed

Security Notes

  • Never expose STRIPE_SECRET_KEY or SUPABASE_SERVICE_ROLE_KEY to the client
  • Use NEXT_PUBLIC_ prefix only for client-side variables
  • Regularly rotate your webhook secrets
  • Monitor webhook delivery in Stripe dashboard

Extension points exported contracts — how you extend this code

Project (Interface)
(no doc)
components/app-sidebar.tsx
User (Interface)
(no doc)
components/user-provider.tsx
ProjectMember (Interface)
(no doc)
components/team-management.tsx
Notification (Interface)
(no doc)
components/notifications.tsx
SortableTaskProps (Interface)
(no doc)
components/kanban-board.tsx
TaskComment (Interface)
(no doc)
components/task-comments.tsx
NavbarProps (Interface)
(no doc)
components/navbar.tsx
ActivityLog (Interface)
(no doc)
components/activity-feed.tsx

Core symbols most depended-on inside this repo

cn
called by 227
lib/utils.ts
eq
called by 61
lib/adapters/postgres.ts
single
called by 20
lib/adapters/postgres.ts
order
called by 18
lib/adapters/postgres.ts
useUser
called by 10
components/user-provider.tsx
limit
called by 9
lib/adapters/postgres.ts
loadProject
called by 9
app/dashboard/projects/[id]/page.tsx
signOut
called by 7
components/user-provider.tsx

Shape

Function 222
Interface 44
Method 15
Class 4

Languages

TypeScript100%

Modules by API surface

app/dashboard/projects/[id]/page.tsx24 symbols
lib/adapters/postgres.ts23 symbols
components/team-management.tsx13 symbols
components/task-comments.tsx10 symbols
hooks/use-toast.ts9 symbols
components/ui/avatar-group.tsx9 symbols
components/notifications.tsx9 symbols
app/dashboard/page.tsx9 symbols
app/api/stripe/webhook/route.ts9 symbols
lib/database.ts8 symbols
components/activity-feed.tsx8 symbols
app/dashboard/projects/new/page.tsx8 symbols

Datastores touched

kanba_dbDatabase · 1 repos
postgresDatabase · 1 repos

For agents

$ claude mcp add kanba \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact