/smoking_shop

back-end for e-commerce

Primary LanguagePython

Description

This back-end provides endpoints for working with e-commerce website, including registration, phone verification and authorisation with JWT-tokens, searching products, adding them to cart, using promocedes and creating orders. Also it provides admin-panel, that allows to create new products or categories, and also verify clients by their Id. App has next roles:

  • any
  • authorised
  • admin

what has been developed:

  • JWT-aythentication
  • user verification by phone and passport/id
  • CRUD for categories and products (Non-admin users can only read)
  • Searching filters and sting search
  • Creating promocode (for admin)
  • Cart CRUD and promocode applying (for authenticated)
  • Order creating
  • Notifications for admin

Technologies

Back-end part was developed with Django Rest Framework
Postgresql was used as dbms
For copying catalog was used beautifulsoup for websccrapping and aiohttp for requests
Docker and docker compose were used for containerisation
Nginx was used as a web server

Starting

create .env-app file with

SECRET_KEY
DEBUG
ALLOWED_HOSTS
POSTGRES_HOST
TWILIO_VERIFY_SERVICE_SID
TWILIO_ACCOUNT_SID
TWILIO_AUTH_TOKEN

and .env-db file with

POSTGRES_DB
POSTGRES_USER
POSTGRES_PASSWORD

then use comands:

pip install -r requirements.txt
docker build -t ss_web .
docker compose up

Usage

Account

register

image

phone verify

image

get token

image

Products

create (by user)

image

create (by admin)

image

get one

image

get all

image

get by text request

image

Categories

create (by user)

image

create (by admin)

image

get one

image

get all

image

Cart

add item

image image

remove

image image

create promocode (by admin)

image

use promocode (by user)

image image