GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - JNyaga/ReadyStore

BranchesTags
Open more actions menu

Latest commit

 

History

62 Commits
62 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
core
core
 
 
likes
likes
 
 
locust_files
locust_files
 
 
media
media
 
 
playground
playground
 
 
store
store
 
 
storefront
storefront
 
 
tags
tags
 
 
wslpdf_images
wslpdf_images
 
 
.gitignore
.gitignore
 
 
.hintrc
.hintrc
 
 
.python-version
.python-version
 
 
Pipfile
Pipfile
 
 
Pipfile.lock
Pipfile.lock
 
 
Readme.md
Readme.md
 
 
build.sh
build.sh
 
 
celery_notes.md
celery_notes.md
 
 
db.sqlite3
db.sqlite3
 
 
manage.py
manage.py
 
 
my_project.dot
my_project.dot
 
 
my_project_visualized.png
my_project_visualized.png
 
 
output.svg
output.svg
 
 
pytest.ini
pytest.ini
 
 
requirements.txt
requirements.txt
 
 
store_visualized.png
store_visualized.png
 
 
test.py
test.py
 
 
urls
urls
 
 

Repository files navigation

Table of Contents

  • READY STORE
    • Installation/Usage locally
      • Requirements:
      • Install redis
      • Install pyenv to manage python in OS:
        • Install pipenv to manage project environment:
      • USAGE:

READY STORE

  • This is a django api created to aid in creation ofecomas application by exposing endpoints which make it easier to access needed services without building entire backend for ecomas.

Ready store API can be accessed at ReadyStore [ReadyStore](https://readystore.onrender.com/)

Or deployed locally 👇

Installation/Usage locally

Requirements:

  • python3.9
  • docker installed -(for redis)
  • mysql installed(with default ports3306 open)
  • Forwindows its preffered to usewsl to run project but it will do with just the normal service

Install redis

Best option is to run redis on docker

docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest

Install pyenv to manage python in OS:

  • Linux(recommended)->How to install 'pyenv' Python version manager on Ubuntu 20.04 (hashnode.dev)
  • Windows->pyenv-windows

After installing as per instruction in above

Run 👇 in powershell or terminal to install python 3.9 to system:

 pyenv install 3.9

Install pipenv to manage project environment:

pip install pipenv

Then clone the project above

git clone https://github.com/JNyaga/ReadyStore.git

In the storefront/settings/dev.py file input the values of your mysql database or any database you may choose(read django docs for other databases). Add the DATABASE setting and do as follows

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': '[YOUR_DATABASE_NAME]',#choose the name you wish for you database(any)
        'HOST': 'localhost',
        'USER': '[YOUR_USERNAME]',
        'PASSWORD': '[YOUR_PASWWORD]'
    }
}
  • Open the folder and run the following commands:
#To install the required modules
pipenv install -r requirements.txt

#Activate the environment
pipenv shell

#Run the migrations
pipenv run python manage.py makemigrations
pipenv run python manage.py migrate

#Populate database
pipenv run python manage.py seed_db

#Create admin user:
pipenv run python manage.py createsuperuser #follow the steps that follows

USAGE:

Access the api at https://readystore.onrender.com

For local to run the API service you run

pipenv run python manage.py runserver

The API has the following endpoints

For endpoints needing auth place the jwt_token in header as follows:

Authorization : JWT '<jwt_token>'

jwt_token gotten when registered user sends POST request to /auth/jwt/create/ with {username, password}

Method Endpoint Auth|No auth|Admin Function
POST /auth/users/ no auth Takes in {"username", "password", "email", "first_name","last_name"} registers a new user and returns the registered user
GET /auth/users/me Auth returns a specific user details
POST /auth/users/reset_password/ no auth Takes in email of registered user and sends email to user containing uid and token in password_reset_confirm_url to aid in reseting password
POST /auth/users/reset_password_confirm/ no auth Takes in uid, token and new_password object.
uid and token are the ones sent(email) in url after visiting the endpoint /auth/users/reset_password/
This endpoint allows changing password of specific user
POST /auth/jwt/create/ no auth Takes a set of user credentials and returns an access and refresh JSON web token pair to prove the authentication of those credentials
GET /store/customers/ admin && auth Returns a list of all customers
POST /store/customers/ admin && auth Allows admin to add a customer
GET /store/customers/<pk>/ admin && auth Retrieves details of customer with id==pk
PUT /store/customers/<pk>/ admin && auth Allows edit details of customer with id==pk
DELETE /store/customers/<pk>/ admin && auth Deletes details of customer with id==pk
GET /store/customers/me/ auth Returns details for a specific customer
PUT /store/customers/me/ auth Allow editing details of specific customer and returns edited details
DELETE /store/customers/me/ auth Allows customer to delete their details
GET /store/products/ no auth returns a list of available products
GET /store/products/<pk>/ no auth returns details of a specific product with id==pk
PUT /store/products/<pk>/ admin && auth Edit details of a product with id==pk
DELETE /store/products/<pk>/ auth && admin Deletes product with id==pk
GET /store/products/<product_pk>/images/ no auth Returns a list of images for a specifik product with id== product_pk
POST /store/products/<product_pk>/images/ auth && admin adds images of specific product with id==product_pk
GET /store/products/<product_pk>/images/<pk>/ no auth return details of image with id==pk for product with id==product_pk
PUT /store/products/<product_pk>/images/<pk>/ auth && admin Takes an image to replace image with id==pk for product with id==product_pk and returns the new image details
DELETE /store/products/<product_pk>/images/<pk>/ auth && admin Deletes image with id==pk for product with id==product_pk and returns the new image details
GET /store/products/<product_pk>/reviews/ no auth returns all reviews of product with id==product_pk
POST /store/products/<product_pk>/reviews/ auth Takes object of review for product with id==product_pk
GET /store/products/<product_pk>/reviews/<pk>/ no auth returns details of review with id==pk for product with id==product_pk
PUT /store/products/<product_pk>/reviews/<pk>/ auth Allow editing of details of review with id==pk for product with id==product_pk
DELETE /store/products/<product_pk>/reviews/<pk>/ auth Deletes review with id==pk for product with id==product_pk
GET /store/collections/ no auth returns a list of all collections
POST /store/collections/ admin && auth Takes a title of collection and returns the collection added.
GET /store/collections/<pk>/ no auth returns the details of collection with id== pk
PUT /store/collections/<pk>/ admin && auth Edit the title details of collection with id== pk
DELETE /store/collections/<pk>/ admin && auth Delete the title details of collection with id== pk
POST /store/carts/ no auth Creates an empty cart object and returns its id
GET /store/carts/<cart_pk>/ no auth Retrieves details of cart with id==cart_pk
DELETE /store/carts/<cart_pk>/ no auth Deletes cart with id==cart_pk
GET /store/carts/<cart_pk>/items/ no auth Lists items in cart with id==cart_pk
POST /store/carts/<cart_pk>/items/ no auth Adds items to cart with id==cart_pk
GET /store/carts/<cart_pk>/items/<pk>/ no auth Gets details of item with id== pk in cart with id==cart_pk
PATCH /store/carts/<cart_pk>/items/<pk>/ no auth Update the quantity detail of item with id== pk in cart with id==cart_pk
DELETE /store/carts/<cart_pk>/items/<pk>/ no auth Delete item with id== pk in cart with id==cart_pk
GET /store/orders/ auth| admin Returns order list of a specific customer or all order if customer is admin
POST /store/orders/ auth Takes in a cart_id and returns an order created from the cart, Deletes the cart
GET /store/orders/<pk>/ auth| admin returns details of particular order with id==pk
PATCH /store/orders/<pk>/ auth && admin Edit details of order with id==pk(payment details)
DELETE /store/orders/<pk>/ auth && admin Deletes order with id==pk

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.