A modern pet food subscription platform built with Next.js, Prisma, PostgreSQL, and Stripe.
- 🔐 Authentication: NextAuth with email/password
- 🐾 Pet Profiles: Manage multiple pets with health information
- 🛍️ Product Catalog: Browse dog and cat food products
- 📦 Subscription Management: Weekly, bi-weekly, and monthly deliveries
- 💳 Payment Processing: Stripe integration for recurring payments
- 📧 Email Notifications: Resend integration for order confirmations
- 🎨 Modern UI: Built with Tailwind CSS and shadcn/ui
- Frontend: Next.js 14 (App Router), TypeScript, Tailwind CSS
- Backend: Next.js API Routes, Prisma ORM, PostgreSQL
- Authentication: NextAuth.js
- Payments: Stripe
- Email: Resend
- UI Components: shadcn/ui, Radix UI
- Node.js 18+ and pnpm
- PostgreSQL database
- Stripe account
- Resend account (for emails)
-
Clone the repository
git clone <repository-url> cd kibbledrop
-
Install dependencies
pnpm install
-
Set up environment variables
cp env.example .env.local
Update
.env.localwith your actual values:DATABASE_URL: Your PostgreSQL connection stringNEXTAUTH_SECRET: Generate a random secret keySTRIPE_SECRET_KEY: Your Stripe secret keySTRIPE_PUBLISHABLE_KEY: Your Stripe publishable keyRESEND_API_KEY: Your Resend API key
-
Set up the database
# Push the schema to your database pnpm db:push # Seed the database with sample products pnpm db:seed
-
Run the development server
pnpm dev
-
Open your browser Navigate to http://localhost:3000
POST /api/auth/register- User registrationGET/POST /api/auth/[...nextauth]- NextAuth endpoints
GET /api/pets- Get user's petsPOST /api/pets- Create new pet profilePUT /api/pets/:id- Update pet profileDELETE /api/pets/:id- Delete pet profile
GET /api/products- Get products (with filtering)- Query params:
petType,category,featured
- Query params:
GET /api/subscription- Get user's subscriptionsPOST /api/subscription- Create new subscriptionPUT /api/subscription/:id- Update subscriptionDELETE /api/subscription/:id- Cancel subscription
POST /api/stripe/checkout- Create Stripe checkout session
- User: Authentication and profile data
- PetProfile: Pet information and health details
- Product: Product catalog with categories
- Subscription: Subscription details and delivery info
- SubscriptionItem: Items within each subscription
- User has many PetProfiles
- User has many Subscriptions
- Subscription has many SubscriptionItems
- SubscriptionItem belongs to Product
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Yes |
NEXTAUTH_URL |
Your app's base URL | Yes |
NEXTAUTH_SECRET |
Secret for NextAuth | Yes |
STRIPE_SECRET_KEY |
Stripe secret key | Yes |
STRIPE_PUBLISHABLE_KEY |
Stripe publishable key | Yes |
RESEND_API_KEY |
Resend API key for emails | Yes |
# Push schema changes
pnpm db:push
# Reset and seed database
pnpm db:seed
# Open Prisma Studio
npx prisma studio- Update the Prisma schema in
prisma/schema.prisma - Run
pnpm db:pushto apply changes - Create API routes in
app/api/ - Update frontend components as needed
- Connect your repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push to main branch
- Ensure PostgreSQL database is accessible
- Set all required environment variables
- Build and deploy using platform-specific commands
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.