This project is still a work in progress. It is intenedd to become a B2B site built with FastAPI application that integrates with Shopify's Customer Accounts API using a confidential client. Follow the instructions below to clone the repository, install dependencies, and run the application.
Before you begin, ensure you have the following installed:
- Python 3.12
- Poetry
- Ngrok
- Shopify Plus store with a Headless sales channel setup to use a Confdential customer accounts client
First, clone the repository to your local machine:
git clone https://github.com/JimmyMckegger/b2bHeadless.git
cd customerAccounts
poetry install
ngrok http 8000
Replace th values in the .env.example
file and rename the file to .env
SHOP_ID=123123123
CLIENT_ID=shp_asdf234asdf123sadf123
CLIENT_SECRET=3c50fsadfkljhsadfkljhasdfkjhd
DOMAIN=your-ngrok-domain.ngrok-free.app
poetry shell && uvicorn main:app --reload
Example script:
#!/bin/zsh
new tmux session and detach
SESSION="customer_accounts_api"
tmux new-session -d -s $SESSION
# Split the window into two panes vertically
tmux split-window -v
# Select pane 0, navigate to the project directory, and start ngrok
tmux select-pane -t 0
tmux send-keys -t $SESSION "cd ~/path/to/project/b2bHeadless" C-m
tmux send-keys -t $SESSION "ngrok http 8000 --domain=your-domain.ngrok-free.app" C-m
# Select pane 1, navigate to the project directory, and start uvicorn
tmux select-pane -t 1
tmux send-keys -t $SESSION "cd ~/path/to/project/b2bHeadless" C-m
tmux send-keys -t $SESSION "poetry run uvicorn main:app --reload" C-m
# Attach to the tmux session
tmux attach-session -t $SESSION