# AI use cases for Codflow (bighadj22/codflow)

Repo: [bighadj22/codflow](https://github.com/bighadj22/codflow) | Use cases: 4 | Page: https://dedupedai.com/use-cases/bighadj22-codflow/

CodFlow is an open-source, COD-first e-commerce and delivery platform for Algeria that runs on Cloudflare Workers, D1, R2 and KV.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Launch a COD store on your own Cloudflare account: https://dedupedai.com/use-cases/bighadj22-codflow/self-host-cod-store-on-cloudflare/
- Let an AI agent manage store orders through MCP: https://dedupedai.com/use-cases/bighadj22-codflow/run-store-orders-with-ai-agent/
- Ship COD orders and track them through carrier webhooks: https://dedupedai.com/use-cases/bighadj22-codflow/track-cod-deliveries-with-carriers/
- Optimize Meta ads for confirmed deliveries, not form fills: https://dedupedai.com/use-cases/bighadj22-codflow/optimize-meta-ads-for-real-deliveries/

## How to launch a COD store on your own Cloudflare account with Codflow

Repo: [bighadj22/codflow](https://github.com/bighadj22/codflow) | Difficulty: Advanced | Time: 2 hours | Basis: From the README

Deploy the storefront, merchant dashboard and backend to your Cloudflare account with no per-order fees.

**Who it is for:** An Algerian merchant or developer who wants to sell cash on delivery without paying per-transaction fees or running a VPS.

**The problem:** Western and local platforms charge per-transaction fees, need VPS hosting and lock store data in their systems.

**The outcome:** A local CodFlow store with a storefront, merchant dashboard and backend that you own, ready to move to production.

### Steps

1. Run `git clone https://github.com/bighadj22/codflow.git` and `cd codflow`, then run `npm ci`.
2. Run `wrangler login`, then create resources with `wrangler d1 create my-codflow-db`, `wrangler r2 bucket create my-codflow-images`, `wrangler kv namespace create RATE_LIMIT` and `wrangler kv namespace create OAUTH_KV`.
3. Copy the example env and config files in the root, cod-server, cod-client-astro and cod-astro/theme01 folders, then set your resource names and secrets.
4. In cod-server run `npm run db:setup:local`, then in cod-client-astro run `ADMIN_EMAIL=admin@example.com ADMIN_NAME=Admin npm run seed:admin` and save the generated password and API key.
5. Start the backend with `npm run dev` in cod-server, the dashboard with `npm run dev` in cod-client-astro, and the storefront with `npm run dev` in cod-astro/theme01 on a different port.

### Prompt to paste into your agent

```text
In the repo https://github.com/bighadj22/codflow, follow the codflow-setup runbook at .agents/skills/codflow-setup/SKILL.md to set up a local store in <target folder>. Expected output: the backend, dashboard and storefront running locally, with the admin password and API key reported. Verify that the backend responds at http://localhost:8787.
```

### Caveat

The README says a production deployment needs cod-server on a custom domain, because Worker-to-Worker fetch between workers.dev hosts is blocked.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/bighadj22-codflow/self-host-cod-store-on-cloudflare/

## How to let an AI agent manage store orders through MCP with Codflow

Repo: [bighadj22/codflow](https://github.com/bighadj22/codflow) | Difficulty: Advanced | Time: 3 hours | Basis: From the README

Connect Cursor or another MCP client to your CodFlow store to review and update orders, stock and products.

**Who it is for:** A merchant who wants an AI assistant to handle daily order and inventory work inside their own store.

**The problem:** Daily order, stock and product updates take time in the dashboard, and the merchant wants an assistant to do them with permission checks.

**The outcome:** An MCP-connected assistant that works on store data within the RBAC scopes you grant, with confirmation before sensitive changes.

### Steps

1. Complete the local setup from the codflow-setup runbook so the dashboard and backend are running.
2. In the dashboard, open MCP agent connection management and create a connection for your agent.
3. Connect Cursor (or another supported MCP client) and complete the OAuth login relay from the dashboard.
4. Ask the agent to list recent orders, and confirm any write action it proposes through the elicitation prompt.

### Prompt to paste into your agent

```text
Using the MCP connection from the CodFlow repo at https://github.com/bighadj22/codflow, list the 10 most recent orders in the store at <store URL>. Expected output: a table of order ID, status and total. Verify that the agent did not change any order status.
```

### Caveat

The README lists Claude, Cursor, ChatGPT and LibreChat as compatible, but the exact MCP endpoint setup for each client is not described in the README.

Risk, credentials: The MCP connection uses OAuth login and team API keys, so scope the granted permissions tightly and revoke unused connections.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/bighadj22-codflow/run-store-orders-with-ai-agent/

## How to ship COD orders and track them through carrier webhooks with Codflow

Repo: [bighadj22/codflow](https://github.com/bighadj22/codflow) | Difficulty: Intermediate | Time: 2 hours | Basis: From the README

Create shipments with printable labels and follow delivery status from Algerian carriers in one place.

**Who it is for:** A merchant shipping COD orders who is tired of juggling separate carrier portals.

**The problem:** Each carrier has its own portal, and delivery status is hard to see next to the order.

**The outcome:** Shipments created from the dashboard with real-time status updates and an event log showing how each webhook was handled.

### Steps

1. Add your carrier company in the dashboard with its credentials, then run a stop-desk sync so desk lists cover your wilayas.
2. Open a confirmed order and create a shipment, choosing home delivery or stop-desk pickup.
3. Print the shipment label from the dashboard and hand the parcel to the carrier.
4. Check the webhook event log to confirm each carrier event shows as applied, ignored, unmapped or error.

### Prompt to paste into your agent

```text
In the CodFlow repo at https://github.com/bighadj22/codflow, use the dashboard's delivery tools to create a shipment for order <order ID> with carrier <carrier name>. Expected output: a shipment ID and a printable label. Verify that the webhook event log shows an applied event after the carrier sends its first status update.
```

### Caveat

The README describes HMAC verification only for Yalidine and ZR Express webhooks, so other carriers may not have the same verification.

Risk, credentials: Carrier credentials are stored in the carrier company management area, so use a team account with only the delivery permissions it needs.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/bighadj22-codflow/track-cod-deliveries-with-carriers/

## How to optimize Meta ads for confirmed deliveries, not form fills with Codflow

Repo: [bighadj22/codflow](https://github.com/bighadj22/codflow) | Difficulty: Intermediate | Time: 1 hour | Basis: From the README

Send a Purchase event to Meta only when an order is delivered, so ads learn from real buyers.

**Who it is for:** A merchant running Meta ads who sees many orders refused at the door and wants ads tuned to delivered sales.

**The problem:** Meta Pixel fires on checkout submit, so ads are optimized for orders that may be refused at delivery.

**The outcome:** Meta receives a Purchase event at confirmed delivery, with a test stream available to verify events before going live.

### Steps

1. In the dashboard, open the Meta Pixel and CAPI configuration and enter your pixel details.
2. Choose Purchase at confirmed delivery as the conversion event.
3. Turn on Test Mode so CAPI events go to Meta's test stream (test_event_code) while you verify them.
4. Review the CAPI event audit log (capi_event_log) to confirm each send attempt and its result, then turn Test Mode off.

### Prompt to paste into your agent

```text
In the CodFlow repo at https://github.com/bighadj22/codflow, check the Meta CAPI configuration for store <store name> with Purchase set at delivery. Expected output: the current conversion event, the Test Mode state and the last five entries in the CAPI event log. Verify that Test Mode is on before any live traffic is sent.
```

### Caveat

The README says a production deployment with Worker-to-Worker fetch needs a custom domain for cod-server, so verify your CAPI sends after that is in place.

Risk, credentials: Meta access settings are entered in the dashboard, so keep the token limited to the pixel and restrict who on your team can change it.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/bighadj22-codflow/optimize-meta-ads-for-real-deliveries/
