A comprehensive template for building Shopify apps with CRUD operations, featuring AI-powered code generation for rapid development.
Repository: https://github.com/agiprolabs/ShopifyAI-Scaffold
graph TB
A[Shopify Store] --> B[OAuth Flow]
B --> C[FastAPI Backend]
C --> D[Database]
C --> E[Shopify API Client]
C --> F[AI Code Generator]
F --> G[Claude API]
C --> H[CRUD Endpoints]
H --> I[React Frontend]
I --> J[CRUD Components]
I --> K[API Calls]
subgraph "Backend Services"
C
D
E
F
H
end
subgraph "Frontend"
I
J
K
end
- Full-Stack Template: FastAPI backend with React frontend
- Shopify Integration: OAuth authentication, webhooks, API client
- CRUD Operations: Generic models and endpoints for easy extension
- AI Code Generation: Use Claude API to generate CRUD code snippets
- Docker Support: Containerized development environment
- Database: PostgreSQL with SQLAlchemy and Alembic migrations
Integrating an AI API like Claude for generating CRUD code snippets provides several key benefits:
- Accelerated Development: AI can generate boilerplate code instantly, reducing setup time from hours to minutes
- Consistency: Ensures uniform code patterns across different CRUD operations
- Error Reduction: AI-generated code follows best practices and reduces human error
- Focus on Business Logic: Developers can concentrate on unique features rather than repetitive CRUD implementation
- Rapid Prototyping: Quickly test ideas by generating functional code snippets
- Learning Aid: New developers can learn patterns from AI-generated, well-structured code
- Scalability: Easily generate CRUD for new entities as the app grows
# Use the automated kickoff script
export CLAUDE_API_KEY="your_claude_api_key_here"
./kickoff.sh my-awesome-app
# Or without API key (you'll be prompted to add it later)
./kickoff.sh my-awesome-app- Install Shopify CLI:
npm install -g @shopify/cli - Clone from GitHub:
git clone https://github.com/agiprolabs/ShopifyAI-Scaffold.git my-shopify-app - Change to project directory:
cd my-shopify-app - Run
shopify app devto start development with ngrok tunnel - Access your app through the Shopify Admin
- Use the AI code generator to create CRUD operations
This scaffold includes comprehensive AI agent instructions for accelerated development:
.cursorrules: Instructions for AI coding assistants- PRD Template: Generate comprehensive product requirements
- AI Code Generator: Built-in CRUD code generation
.kilocode-instructions.md: Agentic workflow protocols- Automated kickoff:
kickoff.shscript for project initialization - PRD generation: Template and AI prompts for requirements
- Generate PRD: Use
prd-template.mdwith AI assistance - Break down features: Identify CRUD operations for AI generation
- Implement with AI: Use scaffold's AI generator for consistent code
- Test & iterate: Deploy and refine using Shopify CLI
Example PRD Generation Prompt:
Generate a PRD for a Shopify inventory management app using the provided template.
Focus on CRUD operations that can be AI-generated, with specific user stories and acceptance criteria.
npm install -g @shopify/cli# Clone from GitHub
git clone https://github.com/agiprolabs/ShopifyAI-Scaffold.git my-shopify-app
cd my-shopify-app
# Login to Shopify
shopify auth login
# Create a new app (or use existing)
shopify app create
# Copy environment template
cp .env.template .env
# Edit .env with your Claude API key
# CLAUDE_API_KEY=your_claude_api_key
# Start development server with ngrok tunnel
shopify app devThe CLI will:
- Start your backend and frontend servers
- Create ngrok tunnel for OAuth callbacks
- Open your app in the browser
- Handle app registration and configuration automatically
Use the built-in AI code generator:
curl -X POST http://localhost:8000/api/ai/generate-crud \
-H "Content-Type: application/json" \
-d '{
"entity": "Product",
"fields": ["name", "price", "description"],
"operations": ["create", "read", "update", "delete"]
}'The AI will generate:
- Database models
- API endpoints
- Frontend components
- Integration code
- Add the generated models to
backend/app/db/models.py - Create new router in
backend/app/api/ - Include the router in
main.py - Add frontend components to React app
- Test the CRUD operations
# Deploy to Shopify
shopify app deploy
# Or for staging
shopify app deploy --source-control-url=<your-repo-url>shopify-app-scaffold/
├── shopify.app.toml # Shopify CLI configuration
├── .cursorrules # Claude Code instructions
├── .kilocode-instructions.md # KiloCode agent protocols
├── prd-template.md # PRD generation template
├── kickoff.sh # Automated project setup script
├── web/ # App code (Shopify CLI requirement)
│ ├── backend/ # FastAPI backend
│ │ ├── app/
│ │ │ ├── api/ # API routers (CRUD, Shopify, AI)
│ │ │ ├── core/ # Configuration
│ │ │ ├── db/ # Database models & session
│ │ │ └── services/ # Business logic
│ │ ├── requirements.txt
│ │ └── Dockerfile
│ └── frontend/ # React + TypeScript frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ └── App.tsx # Main app
│ ├── package.json
│ └── Dockerfile
├── docker/ # Database setup
│ └── init-db.sql
├── .env.template # Environment variables
└── README.md
POST /api/shopify/install- Start OAuth flowGET /api/shopify/callback- OAuth callbackPOST /api/ai/generate-crud- Generate CRUD codeGET /api/{entity}- List entitiesPOST /api/{entity}- Create entityPUT /api/{entity}/{id}- Update entityDELETE /api/{entity}/{id}- Delete entity
# AI (Claude)
CLAUDE_API_KEY=your_claude_api_key
# Database (optional - defaults to SQLite for development)
DATABASE_URL=sqlite:///./shopify_app.db
# Security
SECRET_KEY=your_secret_key
ENCRYPTION_KEY=your_32byte_encryption_keyNote: Shopify CLI handles Shopify API credentials automatically through the app configuration.
- Fork the repository
- Create a feature branch
- Make changes
- Test thoroughly
- Submit a pull request
MIT License