|
|
@@ -5,7 +5,7 @@ Update it at the end of every work session.
|
|
5
|
5
|
|
|
6
|
6
|
**Last updated:** 2026-11-14
|
|
7
|
7
|
**Current step:** Step 3 — AI generation (built; waiting for a real test with API keys)
|
|
8
|
|
-**Next action:** Add the Anthropic and DeepSeek API keys to `.env`, switch the two providers from `fake` to `claude` and `deepseek`, and test a real generation and a real edit. Then start Step 4
|
|
|
8
|
+**Next action:** In `.env.local` (keys are already added), switch the two providers from `fake` to `claude` and `deepseek`, and test a real generation and a real edit. Then start Step 4
|
|
9
|
9
|
|
|
10
|
10
|
Status marks: `[ ]` not started · `[~]` in progress · `[x]` done
|
|
11
|
11
|
|
|
|
@@ -59,7 +59,7 @@ Changing from Claude to another AI model (or back) must be a settings change, no
|
|
59
|
59
|
|
|
60
|
60
|
- All AI calls go through one place in the code (the "AI layer"). No other code talks to an AI provider directly.
|
|
61
|
61
|
- Each provider (Claude, DeepSeek, others later) is one small "driver" class behind the same interface.
|
|
62
|
|
-- Each task has its own setting in `.env`: which provider and which model. Example:
|
|
|
62
|
+- Each task has its own setting in `.env.local`: which provider and which model. Example:
|
|
63
|
63
|
- `AI_GENERATE_PROVIDER=claude`, `AI_GENERATE_MODEL=claude-sonnet-5-5`
|
|
64
|
64
|
- `AI_EDIT_PROVIDER=deepseek`, `AI_EDIT_MODEL=deepseek-chat`
|
|
65
|
65
|
- Prompts and the store plan format are ours and do not depend on any provider.
|
|
|
@@ -76,8 +76,8 @@ Changing from Claude to another AI model (or back) must be a settings change, no
|
|
76
|
76
|
|
|
77
|
77
|
### How AI generation works (added in Step 3)
|
|
78
|
78
|
|
|
79
|
|
-- All AI calls go through `AiManager`. It reads `config/ai.php`, which reads `.env`.
|
|
80
|
|
-- Three providers exist: `claude`, `deepseek`, and `fake`. The `fake` one needs no key and costs nothing: it returns the built-in sample design. Local `.env` uses `fake` until the real keys are added.
|
|
|
79
|
+- All AI calls go through `AiManager`. It reads `config/ai.php`, which reads `.env.local`.
|
|
|
80
|
+- Three providers exist: `claude`, `deepseek`, and `fake`. The `fake` one needs no key and costs nothing: it returns the built-in sample design. `.env.local` uses `fake` until the real test.
|
|
81
|
81
|
- The DeepSeek driver speaks a common format that many providers share, so most new providers need only a few lines in `config/ai.php`.
|
|
82
|
82
|
- A full design: the AI gets our rules (built from `PlanSchema.php`) and the brand description, and answers with a store plan.
|
|
83
|
83
|
- A chat edit: the AI gets the current plan and the request, and answers with only what to change. We apply that to the plan.
|
|
|
@@ -129,7 +129,7 @@ Changing from Claude to another AI model (or back) must be a settings change, no
|
|
129
|
129
|
|
|
130
|
130
|
### Step 3 — AI generation
|
|
131
|
131
|
|
|
132
|
|
-- [x] Swappable AI layer: one interface, one driver per provider, provider and model chosen per task in `.env`
|
|
|
132
|
+- [x] Swappable AI layer: one interface, one driver per provider, provider and model chosen per task in the settings file
|
|
133
|
133
|
- [x] Test: switch the generation model in settings and confirm it works with no code change (automated test)
|
|
134
|
134
|
- [x] Claude Sonnet 5.5 for first store generation (built with Anthropic's official PHP package; not yet run against the real service)
|
|
135
|
135
|
- [x] DeepSeek for small edits (built; not yet run against the real service)
|
|
|
@@ -206,12 +206,13 @@ Then, from the project folder:
|
|
206
|
206
|
| Check frontend | `npm run check` and `npm run types:check` |
|
|
207
|
207
|
| Rebuild frontend for tests | `npm run build` |
|
|
208
|
208
|
|
|
209
|
|
-- Database: MySQL, database `ai_commerce`, settings in `.env`.
|
|
|
209
|
+- Settings files: `.env` is uploaded to the repository and holds only basic, non-secret settings (secrets and all AI settings are blank). `.env.local` is never uploaded and holds everything needed to run, including keys. When `.env.local` exists the app reads it instead of `.env`, so it must be complete. This is set up in `bootstrap/app.php`.
|
|
|
210
|
+- Database: MySQL, database `ai_commerce`, settings in `.env.local`.
|
|
210
|
211
|
- Local test login: created by `php artisan db:seed`. Email is in `database/seeders/DatabaseSeeder.php`, password in `database/factories/UserFactory.php`.
|
|
211
|
|
-- AI: local `.env` uses the `fake` provider. To use real AI, set `AI_GENERATE_PROVIDER=claude` and `AI_EDIT_PROVIDER=deepseek`, and fill in `ANTHROPIC_API_KEY` and `DEEPSEEK_API_KEY`.
|
|
|
212
|
+- AI: `.env.local` currently uses the `fake` provider. To use real AI, set `AI_GENERATE_PROVIDER=claude` and `AI_EDIT_PROVIDER=deepseek`, and fill in `ANTHROPIC_API_KEY` and `DEEPSEEK_API_KEY`.
|
|
212
|
213
|
- AI jobs need the background worker. `composer run dev` starts it. Without it, a job waits and is marked failed after 10 minutes.
|
|
213
|
214
|
- Emails (such as verification links) are written to `storage/logs/laravel.log`, not sent.
|
|
214
|
|
-- Code repository: `https://git.mirfalah.my/mirfalah-tech/ai_commerce.git` (remote name `origin`). The `.env` file is never uploaded.
|
|
|
215
|
+- Code repository: `https://git.mirfalah.my/mirfalah-tech/ai_commerce.git` (remote name `origin`). The `.env.local` file is never uploaded.
|
|
215
|
216
|
|
|
216
|
217
|
## 4b. Where things are in the code
|
|
217
|
218
|
|
|
|
@@ -239,7 +240,6 @@ Then, from the project folder:
|
|
239
|
240
|
|
|
240
|
241
|
## 5. Open questions
|
|
241
|
242
|
|
|
242
|
|
-- Anthropic API key and DeepSeek API key: needed in `.env` for the real test of Step 3
|
|
243
|
243
|
- Hosting provider (decide at Step 8)
|
|
244
|
244
|
|
|
245
|
245
|
## 6. Later improvements
|
|
|
@@ -263,3 +263,4 @@ Add one line per work session: date, what was done, what is next.
|
|
263
|
263
|
| 2026-11-14 | Step 2 done on branch `feature/store-sections-renderer`: store plan format and validator, 10 sections with 2 variants each, renderer, dashboard preview, sample design. 69 tests pass; storefront checked in the browser on desktop and mobile. | Step 3: swappable AI layer and store generation |
|
|
264
|
264
|
| 2026-11-14 | First commit made and pushed to the private repository on git.mirfalah.my (branch `feature/store-sections-renderer`). | Step 3: swappable AI layer and store generation |
|
|
265
|
265
|
| 2026-11-14 | Step 3 built on branch `feature/ai-generation`: swappable AI layer (Claude, DeepSeek, fake), full store generation, chat edits, background job with progress screen, plan limits. 92 tests pass; whole flow checked in the browser with the fake provider. Not yet run against real Claude or DeepSeek. | Add API keys, run the real test, then Step 4 |
|
|
|
266
|
+| 2026-11-14 | Split settings into `.env` (uploaded, no secrets, AI settings blank) and `.env.local` (private, complete). Removed `.env.example`. | Real AI test, then Step 4 |
|