Option A — Phase 0: Prerequisites (Detailed Plan)
This document is the detailed plan for Phase 0 of AppiFire AI Chat (Option A). Complete these before starting Phase 1. High-level overview: Option-A-Tech-Stack-and-Tasks.md.
Phase 0 objective
Section titled “Phase 0 objective”Have all accounts, tools, and infrastructure ready so you can create the Shopify app and connect it to Postgres and OpenRouter in Phase 1.
1. Create Shopify Partner account and development store
Section titled “1. Create Shopify Partner account and development store”1.1 Create Shopify Partner (developer) account
Section titled “1.1 Create Shopify Partner (developer) account”| Step | Action |
|---|---|
| 1 | Go to partners.shopify.com. |
| 2 | Click Join now. |
| 3 | Sign in with email or Google. |
| 4 | Choose: Account type: Developer. Company name: your product or company name. Purpose: Build apps for the Shopify App Store. |
Outcome: You land in the Shopify Partner Dashboard. Here you will create apps, development stores, and manage API keys.
1.2 Create a development store
Section titled “1.2 Create a development store”| Step | Action |
|---|---|
| 1 | In Partner Dashboard, go to Stores. |
| 2 | Click Add store. |
| 3 | Select Development store. |
| 4 | Store details: Store name (e.g. appifire-ai-chat-test), Password protection: enabled (default). |
| 5 | Click Create store. |
Outcome: A real Shopify store, free, with full admin. It can install unpublished apps — use it for all Phase 1 testing.
Checklist:
- Partner account created and logged in.
- At least one development store created; note the store URL (e.g.
your-store.myshopify.com).
2. Install Node.js 18+ and Shopify CLI; run shopify login
Section titled “2. Install Node.js 18+ and Shopify CLI; run shopify login”2.1 Install Node.js
Section titled “2.1 Install Node.js”| Step | Action |
|---|---|
| 1 | Install Node.js 18 or later (nodejs.org or via nvm/homebrew). |
| 2 | Verify in terminal: node -v and npm -v. |
2.2 Install Shopify CLI and App package
Section titled “2.2 Install Shopify CLI and App package”| Step | Action |
|---|---|
| 1 | Run: npm install -g @shopify/cli @shopify/app |
| 2 | Verify: shopify version |
2.3 Log in to Shopify via CLI
Section titled “2.3 Log in to Shopify via CLI”| Step | Action |
|---|---|
| 1 | Run: shopify login |
| 2 | In the browser that opens, sign in with the same email as your Partner account. |
| 3 | Confirm in terminal that login succeeded. |
Outcome: CLI can create apps, deploy extensions, and run the local dev server against your Partner account.
Checklist:
- Node.js 18+ installed (
node -v). - Shopify CLI and app package installed (
shopify version). -
shopify logincompleted successfully.
3. Sign up for OpenRouter.ai; get API key; add credits
Section titled “3. Sign up for OpenRouter.ai; get API key; add credits”3.1 Create account and get API key
Section titled “3.1 Create account and get API key”| Step | Action |
|---|---|
| 1 | Go to openrouter.ai. |
| 2 | Sign up / log in. |
| 3 | Open Keys (or API keys section) and create a new API key. |
| 4 | Copy and store the key securely (you will use it as OPENROUTER_API_KEY in the backend). |
3.2 Add credits
Section titled “3.2 Add credits”| Step | Action |
|---|---|
| 1 | In OpenRouter dashboard, go to Billing or Credits. |
| 2 | Add credits (amount depends on your testing plan). |
Why: All AI usage (embeddings + chat) for Option A goes through OpenRouter; one bill and one key for both.
Checklist:
- OpenRouter account created.
- API key created and saved securely.
- Credits added to the account.
4. Choose hosting for backend + Postgres; provision Postgres with pgvector
Section titled “4. Choose hosting for backend + Postgres; provision Postgres with pgvector”4.1 Choose a hosting strategy
Section titled “4.1 Choose a hosting strategy”You need:
- A PostgreSQL database with the pgvector extension (for vectors).
- A place to run your backend app (Phase 1). It can be the same provider or different.
Common options:
| Option | Postgres + pgvector | Backend host | Notes |
|---|---|---|---|
| Railway | Railway Postgres (pgvector supported) | Same project | Simple; one dashboard. |
| Render | Render Postgres (add pgvector) | Web Service (Node) | Free tier for DB; paid for always-on. |
| Supabase | Supabase (Postgres + pgvector) | Separate (e.g. Fly.io, Render) | Good free tier; DB and app decoupled. |
| Neon | Neon (Postgres + pgvector) | Separate (e.g. Fly.io, Render) | Serverless Postgres; good for dev. |
| DigitalOcean | Managed DB (add pgvector) | Droplet or App Platform | More control; you manage. |
| Fly.io | Fly Postgres (pgvector) | Fly app | Single provider for both if desired. |
Recommendation for Phase 0: Pick one provider and create only the database now. Create the backend app in Phase 1 and connect it to this DB.
4.2 Provision Postgres and enable pgvector
Section titled “4.2 Provision Postgres and enable pgvector”| Step | Action |
|---|---|
| 1 | In your chosen provider, create a new PostgreSQL database. |
| 2 | Note the connection string (e.g. postgresql://user:pass@host:5432/dbname). You will use it as DATABASE_URL. |
| 3 | Enable pgvector: run CREATE EXTENSION IF NOT EXISTS vector; in the DB (via provider SQL console or psql). For schema-qualified vector types use CREATE EXTENSION IF NOT EXISTS vector WITH SCHEMA public;. |
Docker / Dokploy / self-hosted: Use a Postgres image that includes pgvector (e.g. pgvector/pgvector:pg15 or pgvector/pgvector:pg16). Standard postgres:15 does not include it; the extension will be missing and you will get “extension vector is not available”.
Verification: Connect with psql or a GUI and run:
CREATE EXTENSION IF NOT EXISTS vector WITH SCHEMA public;SELECT * FROM pg_extension WHERE extname = 'vector';You should see one row for vector.
4.3 (Optional) Create an empty database or schema
Section titled “4.3 (Optional) Create an empty database or schema”Some providers create an empty DB by default. If not, create a database (e.g. shopify_ai_chatbot) for the app. Do not create tables yet — Phase 1 will add migrations for the full schema.
Checklist:
- Hosting provider chosen for Postgres (and later backend).
- Postgres instance created; connection string saved as
DATABASE_URL. - pgvector extension enabled (
CREATE EXTENSION vector). - (Optional) Dedicated database created for the app.
Phase 0 completion checklist
Section titled “Phase 0 completion checklist”Before starting Phase 1, confirm:
- Shopify: Partner account + at least one development store.
- Local: Node.js 18+, Shopify CLI installed,
shopify logindone. - OpenRouter: Account, API key saved, credits added.
- Database: Postgres provisioned, pgvector enabled,
DATABASE_URLknown.
Next: Option-A-Phase-1.md — Shopify app skeleton and database migrations.