A modern multi-vendor ecommerce platform built with Next.js, TypeScript, and Supabase.
First, install the dependencies:
npm installThen, run the development server:
npm run devOpen http://localhost:3000 with your browser to see the result.
- Frontend: Next.js 14+ (App Router), React, TypeScript
- Styling: Tailwind CSS
- Backend: Supabase (Postgres, Auth, Storage, RLS)
/app- Next.js app router pages and layouts/components- Reusable React components/lib- Utility functions and Supabase client setup/supabase- Database migrations and schema
The platform automatically converts expired subscriptions to free plans. To enable this:
-
Run the migration: Execute
supabase/migrations/add_subscription_expiration.sqlin your Supabase SQL Editor -
Set up cron job: Choose one of the following options:
Option A: Vercel Cron (Recommended for Vercel deployments)
- Add to
vercel.json:
{ "crons": [{ "path": "/api/cron/check-subscriptions", "schedule": "0 * * * *" }] }- Set environment variable:
CRON_SECRET(optional, for security)
Option B: External Cron Service
- Set up a cron job to call:
GET https://your-domain.com/api/cron/check-subscriptions - Include header:
Authorization: Bearer YOUR_CRON_SECRET(if CRON_SECRET is set) - Recommended schedule: Every hour (
0 * * * *)
Option C: Supabase pg_cron (If enabled)
- Uncomment the pg_cron section in the migration file
- The function will run automatically every hour
- Add to
-
Environment Variables:
CRON_SECRET(optional): Secret token for securing the cron endpoint