Skip to content

lymagics/shop-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shop API

Shopping api written with Python and APIFlask. This api implements:

  • User registration
  • Token authentication
  • Product creation(admin only)
  • Cart creation
  • Adding product to the cart
  • Product purchases with Stripe Checkout
  • OpenAPI specification

Project documentation is avaliable at http://{your_host}/docs

340e733e-5ea4-444e-b6f3-37fb2e25a452

To run this project locally follow this steps:

  1. Clone this repository:
    git clone https://github.com/lymagics/shop-api.git
  1. Go to project directory and create python virtual invironment:
    cd shop-api
    python -m venv venv
  1. Activate virtual environment and install requiremenst:
    venv/Scripts/activate
    pip install -r requirements.txt
  1. Go to stripe checkout, create account and get stripe secret key.
  2. Create .env file and fill it with .env.example variables. Dismiss STRIPE_WEBHOOK_SECRET for now.
  3. Apply database migration:
    flask db upgrade
  1. Populate database with purchase statuses:
    flask populate statuses
  1. Run flask local server:
    flask run
  1. Run ngrok:
    ngrok http 5000
  1. Go back to stripe checkout, go to dashboard and create webook with your ngrok url.
  2. Complite .env file with STRIPE_WEBHOOK_SECRET.

Releases

No releases published

Packages

No packages published

Languages