A FastAPI backend for Telora - an innovative Shopify app that uses voice AI to collect customer feedback through automated phone calls.
- Shopify OAuth Integration: Complete OAuth flow for Shopify app installation
- Webhook Handling: Processes Shopify webhooks for orders, customers, and app events
- Supabase Integration: PostgreSQL database with Supabase for data management
- Voice AI Ready: Infrastructure prepared for voice AI feedback collection
- Python 3.9+
- Shopify Partner Account
- Supabase Account
-
Clone the repository
git clone <your-repo-url> cd telora-backend
-
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Environment Configuration
cp env.example .env
Update
.envwith your actual credentials (see Configuration section below). -
Run the application
uvicorn app.main:app --reload
The API will be available at http://localhost:8000
- Create a new app in your Shopify Partner dashboard
- Set App URL:
https://your-domain.com - Set Redirect URL:
https://your-domain.com/auth/shopify/callback - Configure scopes:
read_products,read_orders,read_customers,write_orders
- Create a new project in Supabase
- Get your credentials from Settings > API
- Database URL format:
postgresql://postgres:[email protected]:5432/postgres
Update your .env file with the following:
# Shopify Configuration
SHOPIFY_API_KEY=your_app_api_key
SHOPIFY_API_SECRET=your_app_secret_key
SHOPIFY_APP_URL=https://your-deployed-domain.com
# Supabase Configuration
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your_anon_key
SUPABASE_SERVICE_KEY=your_service_role_key
DATABASE_URL=postgresql://postgres:[email protected]:5432/postgres
# Security
SECRET_KEY=your_random_secret_keyGET /auth/shopify/install?shop={shop_domain}- Generate Shopify install URLGET /auth/shopify/callback- Handle OAuth callbackGET /auth/shopify/store/{shop_domain}- Get store informationDELETE /auth/shopify/store/{shop_domain}- Uninstall store
POST /webhooks/shopify/orders-create- New order webhookPOST /webhooks/shopify/orders-updated- Order update webhookPOST /webhooks/shopify/customers-create- New customer webhookPOST /webhooks/shopify/app-uninstalled- App uninstall webhook
GET /- API rootGET /health- Health check endpoint
curl "http://localhost:8000/auth/shopify/install?shop=example-store.myshopify.com"This returns an installation URL that you can use to install the app on a Shopify store.
| Column | Type | Description |
|---|---|---|
| id | Integer | Primary key |
| shop_domain | String | Store domain (unique) |
| shop_name | String | Store name |
| access_token | Text | OAuth access token |
| scope | String | Granted permissions |
| is_active | Boolean | Store status |
| created_at | DateTime | Creation timestamp |
| updated_at | DateTime | Last update timestamp |
| String | Store email | |
| phone | String | Store phone |
| country | String | Store country |
| currency | String | Store currency |
| timezone | String | Store timezone |
- Create a new Heroku app
- Set environment variables in Heroku dashboard
- Deploy using Git or GitHub integration
- Connect your GitHub repository
- Set environment variables
- Deploy automatically
FROM python:3.9
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]This backend provides the foundation for your Shopify app. To complete the Telora app, you'll need to:
- Implement Voice AI Service: Integrate with services like Twilio, OpenAI, or similar
- Add Customer Models: Create database models for customer feedback data
- Build Frontend: Create a React/Next.js frontend for the Shopify app interface
- Add Analytics: Implement feedback analytics and reporting
- Implement Calling Logic: Add the voice AI calling functionality
pytestblack app/
isort app/mypy app/- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
[Add your license here]
For questions and support, please create an issue or contact the development team.