Join our community

Get access to the complete guide to developing and deploying fast, production-ready Nuxt apps.

7-11 Create CoursePurchase in the Database

In this lesson, we solve step one by creating the CoursePurchase object.

First, we add the model to our Prisma schema. The key fields here are verified, which defaults to false, the paymentId, and the userEmail.

Then, we create the CoursePurchase object in the paymentIntent endpoint. This way we can be sure that it exists before the Stripe webhook fires (we implement the webhook in the next lesson).

This course was originally built with Nuxt 3, but it's no longer being maintained. You can still follow the lessons, but make sure to use the exact dependency versions listed in the course repository to avoid breaking changes.

If you’re looking for the most up-to-date and fully supported version, we recommend Mastering Nuxt: Full Stack Unleashed , which uses Nuxt 4 and actively being maintained.