Skip to content

JimmyMcKegger/b2bHeadless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Headless B2B site using Shopify Customer Accounts

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.

Prerequisites

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

Getting Started

1. Clone the Repository

First, clone the repository to your local machine:

git clone https://github.com/JimmyMckegger/b2bHeadless.git
cd customerAccounts

2. Install Dependencies

poetry install

3. Start Ngrok

ngrok http 8000

4. Set Environment Variables

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

5. Run the Application

poetry shell && uvicorn main:app --reload

6. Optionally add an executable script in your PATH to startup the app:

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

Releases

No releases published

Packages

No packages published