Summary of "Build & Deploy a Full Stack AI Short Video Ads Generator | PERN Stack, Gemini API, SaaS Project"

Project overview

Core technologies & services used

Product features implemented

Credit model example: image generation ≈ 5 credits, video generation ≈ 10 credits (configurable in backend).

Tutorial contents — chapters & key tasks

  1. Frontend
    • Use Pixel IO React template; set up client project structure, Tailwind, favicon, assets
    • Build navigation (React Router), hero, features, pricing, FAQ, CTA, footer
    • Create pages: generate, community, my generations, result, plans, loading
    • Implement UploadZone component (TypeScript types, preview, remove)
    • Implement generator form (project name, product name, description, aspect ratio, prompt) and UI loading states
  2. Auth & billing (Clerk)
    • Add ClerkProvider to frontend with publishable key and theme
    • Replace static auth UI with Clerk components; add user menu (generate, my generations, community, plans)
    • Integrate Clerk Pricing Table and server-side plan mapping
  3. Backend basics (Express + TypeScript)
    • Create server with tsconfig, start scripts, dotenv, and CORS
  4. DB & ORM (Neon + Prisma)
    • Create Neon project, set DATABASE_URL, write Prisma schema (User, Project)
    • Run prisma migrate and prisma generate; create Prisma client
  5. Clerk webhooks & middleware
    • Add @clerk/express middleware to server
    • Implement auth middleware to protect routes and augment request types
    • Create webhook controller to:
      • upsert/delete users on user.created / user.updated / user.deleted
      • handle payment/subscription events to increment credits based on plan slug
    • Configure webhook endpoint in Clerk dashboard (use forwarded URL or public endpoint)
  6. Controllers / routes
    • User controllers: get credits, list projects, get project by id, toggle publish
    • Project controllers:
      • create project: accept multipart/form-data via multer, verify/decrement credits, upload source images to Cloudinary, create temporary DB record, call Gemini to generate combined image, upload result to Cloudinary, update DB, refund on failure
      • create video: verify/decrement credits, fetch generated image, call video model, poll operation until ready, download video, upload to Cloudinary, update DB
      • get published projects / delete project
  7. Sentry
    • Install @sentry/node, add instrumentation in server.ts, create a debug error route
    • Demonstrate Sentry dashboard and “Fix with Sentry” assistance
  8. Frontend ↔ Backend integration
    • Configure Axios with VITE_BASE_URL
    • Obtain Clerk token in frontend (useAuth/getToken) and attach Authorization: Bearer for protected API calls
    • Implement API calls: create project, fetch project, generate video, get user projects, delete, toggle publish
    • Show credits and redirect to result page after generation
  9. Deployment (Hostinger VPS) — full walkthrough
    • VPS setup: Ubuntu server, domain, SSH access
    • Install Node/NPM, Nginx, Git, PM2, Certbot; configure UFW firewall rules
    • Clone repo into /var/www, create .env files for server & client with Neon/Clerk/Cloudinary/Gemini keys and Clerk webhook signing secret
    • Server: npm install, PM2 start via npm script, pm2 save, pm2 startup
    • Client: npm install, npm run build; configure Nginx site for frontend root to /var/www//client/dist
    • Create separate Nginx site for API subdomain (api.example.com) proxy_pass to localhost:5000; enable sites and reload nginx
    • Obtain SSL with certbot for domain and subdomains; verify renewal
    • Common post-deploy fix: increase client_max_body_size in nginx.conf if uploads hit 413 errors
    • Update Clerk webhook endpoint to permanent API subdomain (api.example.com/api/clerk)
    • Demo: sign up, generate image/video, credits deducted (image −5, video −10), download generated media

Practical notes & gotchas

Resources & artifacts shared

Main speakers / sources

If you want, I can extract and produce any of the following as clean artifacts:

Category ?

Technology


Share this summary


Is the summary off?

If you think the summary is inaccurate, you can reprocess it with the latest model.

Video