Skip to content

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.


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”
StepAction
1Go to partners.shopify.com.
2Click Join now.
3Sign in with email or Google.
4Choose: 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.

StepAction
1In Partner Dashboard, go to Stores.
2Click Add store.
3Select Development store.
4Store details: Store name (e.g. appifire-ai-chat-test), Password protection: enabled (default).
5Click 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”
StepAction
1Install Node.js 18 or later (nodejs.org or via nvm/homebrew).
2Verify in terminal: node -v and npm -v.
StepAction
1Run: npm install -g @shopify/cli @shopify/app
2Verify: shopify version
StepAction
1Run: shopify login
2In the browser that opens, sign in with the same email as your Partner account.
3Confirm 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 login completed 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”
StepAction
1Go to openrouter.ai.
2Sign up / log in.
3Open Keys (or API keys section) and create a new API key.
4Copy and store the key securely (you will use it as OPENROUTER_API_KEY in the backend).
StepAction
1In OpenRouter dashboard, go to Billing or Credits.
2Add 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”

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:

OptionPostgres + pgvectorBackend hostNotes
RailwayRailway Postgres (pgvector supported)Same projectSimple; one dashboard.
RenderRender Postgres (add pgvector)Web Service (Node)Free tier for DB; paid for always-on.
SupabaseSupabase (Postgres + pgvector)Separate (e.g. Fly.io, Render)Good free tier; DB and app decoupled.
NeonNeon (Postgres + pgvector)Separate (e.g. Fly.io, Render)Serverless Postgres; good for dev.
DigitalOceanManaged DB (add pgvector)Droplet or App PlatformMore control; you manage.
Fly.ioFly Postgres (pgvector)Fly appSingle 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”
StepAction
1In your chosen provider, create a new PostgreSQL database.
2Note the connection string (e.g. postgresql://user:pass@host:5432/dbname). You will use it as DATABASE_URL.
3Enable 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.

Before starting Phase 1, confirm:

  • Shopify: Partner account + at least one development store.
  • Local: Node.js 18+, Shopify CLI installed, shopify login done.
  • OpenRouter: Account, API key saved, credits added.
  • Database: Postgres provisioned, pgvector enabled, DATABASE_URL known.

Next: Option-A-Phase-1.md — Shopify app skeleton and database migrations.