Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 27, 2022 10:00 am GMT

An E-commerce API

One of my most recent projects is an E-commerce API that has helped me solidify more advanced concepts in Django and Django Rest Framework. I learned to work in a dockerized environment and use Nginx, Gunicorn ... inside Docker to make my application production ready.

Basic Functionalities

  • Registration using either phone number or email
  • Basic E-commerce features.
  • Payment integration using Stripe.
  • Caching using a Redis backend.
  • Sending emails asynchronously using Celery and Redis as a message broker.
  • Custom permissions set for necessary endpoints.
  • Documentation using DRF Spectacular
  • Dockerized for local development and production

Technologies Used

  • Django Rest Framework
  • PostgreSQL
  • Celery
  • Redis
  • Nginx
  • Docker
  • Stripe

This project makes use of:

  • Viewsets
  • Custom permissions
  • Nested serializers and so on. If you would like to strengthen your skills, I highly recommend you to check it out

I used Docker for local development and it has been so great! And then, with some adjustments, the application is production ready.

Tip: you can export your database schema to a SQL file using the command below:

docker exec -i [container_id] pg_dump -U [postgres_user]  --schema-only [database_name] > [target_path]
Enter fullscreen modeExit fullscreen mode

And then use this tool https://dbdiagram.io/ to generate ER diagram while playing around with the SQL code.

ER Diagram

Link to GitHub repo: https://github.com/earthcomfy/django-ecommerce-api

I welcome any suggestion. Follow me to get upcoming tutorials.

This blog is posted using Scattr


Original Link: https://dev.to/codersalman/an-e-commerce-api-274b

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To