A full-stack SaaS platform that allows users to create and manage their blogs easily.
- Frontend: Next.js 15 with App Router, React, TypeScript
- Styling: Tailwind CSS, Shadcn UI
- Authentication: Kinde Auth
- Database: PostgreSQL with Prisma ORM
- Payment Processing: Stripe
- Image Storage: UploadThing
- Deployment: Vercel
Create a .env file in the root directory with the following variables:
# Database
DATABASE_URL="postgresql://..."
DIRECT_URL="postgresql://..."
# Authentication (Kinde)
KINDE_CLIENT_ID=""
KINDE_CLIENT_SECRET=""
KINDE_ISSUER_URL=""
KINDE_SITE_URL=""
KINDE_POST_LOGOUT_REDIRECT_URL=""
KINDE_POST_LOGIN_REDIRECT_URL=""
# Stripe
STRIPE_SECRET_KEY=""
STRIPE_WEBHOOK_SECRET=""
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=""
# uploadthing
UPLOADTHING_SECRET=""
UPLOADTHING_APP_ID=""This project uses Prisma ORM with PostgreSQL. Before running the application, you need to set up the database and run migrations.
- Ensure you have a PostgreSQL database running
- Update the
DATABASE_URLandDIRECT_URLin your.envfile with your database credentials
If you're setting up the project for the first time or encounter database-related errors (like "table does not exist"), follow these steps:
-
Check if migrations exist:
ls prisma/migrations
-
If no migrations exist, create the initial migration:
npx prisma migrate dev --name init
-
Generate Prisma client:
npx prisma generate
-
Verify database sync (optional):
npx prisma db push
If you encounter errors like:
The table 'public.Site' does not exist in the current databasePrismaClientKnownRequestError
This typically means:
- Your Prisma schema defines models that don't exist in the database yet
- The
DIRECT_URLenvironment variable might be missing from your.envfile - Migrations haven't been run
Solution: Run the migration steps above to create all necessary tables including:
UserSitePostSubscription
First, ensure your database is set up and migrations are run, then start the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Inter, a custom Google Font.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.