Build and Deploy an E-commerce REST API with Django, Stripe & PostgreSQL

Build and Deploy an E-commerce REST API with Django, Stripe & PostgreSQL

2.319 Lượt nghe
Build and Deploy an E-commerce REST API with Django, Stripe & PostgreSQL
In this full-step tutorial, we’ll build a scalable and production-ready E-commerce REST API using Django Rest Framework (DRF) and deploy it to Railway with a live PostgreSQL database. We’ll also integrate Stripe for secure payments, implement a cart system, handle wishlist functionality, add ratings & reviews, and much more! 🔹 What You’ll Learn: ✅ Set up Django, DRF & PostgreSQL for a robust backend ✅ Customize the User Model for authentication ✅ Build Product & Category models, serializers & views ✅ Implement Cart & Wishlist functionalities ✅ Add Reviews & Ratings with full CRUD operations ✅ Integrate Stripe for Payments (Checkout & Webhooks) ✅ Deploy the API on Railway with a live database ✅ Test API endpoints with Postman 💻 Tech Stack: Django, DRF, PostgreSQL, Stripe, Railway, Ngrok 🧑‍💻Source Code: https://github.com/CodeWithClinton/yt_ecommerce_api_2025 🔗Live Url: https://nextshoppit.vercel.app/ 📌 Timestamps for Easy Navigation: 00:00:00 - Introduction 00:03:40 - Setting up a virtual environment & creating a Django project 00:12:52 - Customizing the user model 00:16:24 - Setting up Django REST Framework, models & media configuration 00:26:04 - Creating Product & Category serializers 00:33:44 - Building views, URLs, models & serializers for products & categories 00:53:22 - Managing the admin panel & populating the database 01:06:57 - Creating Cart & CartItem models and serializers 01:21:27 - Adding items to the cart 01:29:17 - Setting up Postman for API testing 01:29:59 - Testing the "Add to Cart" functionality 01:35:52 - Updating cart item quantities 01:39:50 - Testing cart item updates in Postman 01:44:05 - Implementing the reviews & rating system 01:56:18 - Adding reviews & ratings 02:15:22 - Deleting reviews & ratings 02:19:24 - Testing the reviews & ratings endpoint 02:27:20 - Updating & deleting reviews and ratings 02:32:50 - Testing review updates & deletions 02:39:09 - Adding products to the wishlist 02:50:39 - Testing the wishlist endpoint 02:54:35 - Removing items from the cart 02:56:37 - Testing cart item deletions 02:59:06 - Implementing product search 03:07:57 - Testing the search functionality 03:09:11 - Integrating Stripe for payments 03:15:28 - Storing Stripe credentials using environment variables 03:20:00 - Continuing Stripe integration 03:33:56 - Testing Stripe payment endpoints 03:40:44 - Checking Stripe's transaction dashboard 03:43:09 - Setting up Stripe Webhooks 03:46:50 - Handling Stripe Webhooks & order fulfillment 03:59:04 - Using Ngrok to expose localhost to the internet 04:08:52 - Configuring Webhook URLs in Stripe 04:15:59 - Recap of Stripe integration 04:18:43 - Setting up a live PostgreSQL database 04:35:40 - Deploying the API on Railway 04:58:14 - Updating Stripe’s Webhook URL 05:01:35 - Conclusion