| Parameter | EU Standard | Codex Standard | Typical Pine Honey |
|---|---|---|---|
| Moisture Content | ≤ 20% | ≤ 20% | 16–18% |
| HMF (Hydroxymethylfurfural) | ≤ 40 mg/kg | ≤ 80 mg/kg | < 15 mg/kg fresh |
| Diastase Activity | ≥ 8 Schade | ≥ 8 Schade | Typically 12–20 |
| Free Acidity | ≤ 50 meq/kg | ≤ 50 meq/kg | 20–30 meq/kg |
| Water-Insoluble Solids | ≤ 0.1% | ≤ 0.1% | Filtered: < 0.05% |
| Sucrose Content | ≤ 5% | ≤ 5% | Typically < 3% |
| Fructose + Glucose | ≥ 60 g/100g | ≥ 60 g/100g | Usually 65–75% |
| Antibiotic Residues | None detectable | None | Must test — critical |
| Pesticide Residues | Within EU MRLs | — | Must test if export |
- Prepare sterile 250ml glass sample jars (min. 2 per batch/supplier)
- Label each sample: HT-COC-2026-[NNN] / Date / Supplier / Location
- Collect samples directly from drums or containers (not from pre-filled jars)
- Photograph the sampling process and storage conditions
- Seal and sign the Chain-of-Custody form together with supplier
- Transport samples to the selected lab within 48 hours (keep below 20°C)
- Request written test result report with the lab's official stamp
- If tests PASS → proceed to Stage 3If tests FAIL → discuss with Masoud before proceeding
- Confirm food-grade facility certification (ISO 22000 or equivalent)Ask for copy of certification and most recent inspection report
- Confirm minimum batch size they will accept
- Get per-jar or per-kg bottling cost quote in writing
- Confirm fill weight accuracy (tolerance ±2g)
- Ask whether they supply jars and lids or you must source separately
- Schedule a trial run with a sample batch before committing
- Inspect trial output: fill level, lid seal, label placement, no drips or residue
- Confirm production lead time and delivery schedule
- Submit design brief to label maker: dimensions, brand name, artwork assets
- Confirm mandatory EU label fields: product name, net weight, country of origin, producer name & address, best-before date format
- Confirm "Çam Balı / Pine Honey" product designation and origin (Turkey, Muğla/Aegean region)
- Review and approve label design proof before print
- Order test print run and check adhesion, ink quality, and readability
- Source jars (food-grade glass, appropriate size) and lids (tamper-evident)
- Confirm jar and lid unit costs and minimum order quantity
- Arrange delivery of jars, lids, and labels to bottling plant before production date
- Send storage inquiry letter using doc_01 template
- Confirm available capacity (minimum quantity they will accept)
- Get per-kg or per-month storage cost in writing
- Confirm temperature control (must be 10–18°C)
- Confirm insurance and liability during storage
- Understand access schedule for sampling and inspection
- Agree date and location with the supplier at least 1 week in advance
- Bring: Camera, GPS, sample jars, gloves, notebook, copy of Sampling Protocol
- Photograph hive locations with GPS coordinates
- Count number of active hives — confirm with cooperative records
- Inspect honey extraction equipment for cleanliness
- Inspect storage facility: temperature, cleanliness, pest control
- Collect pre-harvest honey samples (if available) for early quality test
- Complete field visit report (doc_05) and email to Masoud within 24 hours
- Obtain Certificate of Origin (Menşe Şahadetnamesi) from the relevant Chamber of CommerceCertifies the honey originates in Turkey; required for EU customs clearance
- Obtain Veterinary Health Certificate (Veteriner Sağlık Sertifikası)Required for all honey exports — issued by Turkish Ministry of Agriculture
- Obtain Certificate of Analysis (lab test report) from accredited laboratoryMust reference all EU Honey Directive parameters — use Stage 2 testing results
- Prepare Phytosanitary / Food Safety Declaration (if required by destination country)
- File Turkish export declaration (ihracat beyannamesi) through customs agent
- Confirm HS tariff code for pine honey (typically HS 0409.00)
- Arrange export insurance for the shipment
- Identify the EU entry Border Inspection Post (BIP) and confirm it handles honey / animal products
- Confirm buyer has EU importer registration (required for third-country animal products)
- Pre-notify BIP of shipment arrival (usually 24–72 hours in advance)
- Confirm EU labelling compliance: language, mandatory fields, net weight in metric units
- Calculate and document any applicable EU import duties (Turkey benefits from preferential rates under GTK)
- Prepare Commercial Invoice (in English) with full product description, quantity, unit price, Incoterms
- Prepare Packing List detailing number of units, carton weights, and dimensions
- Obtain Bill of Lading or Airway Bill from freight carrier
- Share full shipment details: origin, destination, quantity, packaging format, HS code
- Provide copies of all Turkish export documents to agent for EU filing
- Agree agent fees and confirm scope of service (Turkey export only, or end-to-end)
- Get written confirmation of expected clearance timeline and any potential delays
- Confirm agent has experience with honey / food exports to the EU
| Cost Item | TRY (₺) | USD ($) |
|---|---|---|
| Raw Honey per jar (250g) | — | |
| Laboratory Testing (per kg share) | — | |
| Storage at Erdem Cooperative | — | |
| Glass Jar + Lid (per unit) | — | |
| Label + Design (per unit) | — | |
| Filling & Sealing (per unit) | — | |
| Transport to Port / Buyer | — | |
| Customs & Documentation | — | |
| Miscellaneous / Contingency (5%) | — | — |
| TOTAL COST PER JAR | ₺ — | $ — |
Compare your calculated cost to real retail prices for each grade and jar size. Select the grade that matches your honey quality.
Average Turkish honey export price (USD/kg, all honey types). Pine honey commands a premium above these averages. Use the trend to gauge cost-at-source direction.
- 1PartiesThe agreement is between [Masoud's legal entity name TBD] (Buyer) and [Supplier legal name TBD], represented by [Representative name TBD] (Seller).
- 2ProductPure Turkish Pine Honey (Çam Balı), harvested from Muğla/Aydın/İzmir/Denizli region. Grade: food-grade, EU-compliant.
- 3Quantity[Quantity TBD — minimum X kg, maximum Y kg], with exact amount confirmed after harvest assessment in late August 2026.
- 4Quality StandardsHoney must meet EU Honey Directive (2001/110/EC) standards. Seller provides Certificate of Analysis from an accredited laboratory (Muğla Sıtkı Koçman University or equivalent).
- 5PriceAgreed price per kg in TRY, to be confirmed by Seller no later than 31 August 2026. Price is fixed for the duration of this agreement.
- 6Payment Terms[TBD: e.g. 30% deposit upon signing, 70% upon delivery and quality approval]. Payment by bank transfer.
- 7DeliveryDelivery from Erdem Cooperative storage. Buyer arranges and pays for onward transport. Risk transfers to Buyer upon delivery.
- 8Laboratory TestingIndependent test by Muğla Sıtkı Koçman University before delivery. [Who pays: TBD — shared or seller covers]. Buyer has right to reject if tests fail.
- 9StorageHoney stored at Erdem Cooperative from harvest until delivery. [Storage cost: TBD — shared or included in price]. Minimum temperature 10°C.
- 10Rejection & RefundIf honey fails quality test or is not as described, Buyer may reject and receive full refund of all payments made within 14 days.
- 11Force MajeureNeither party liable for delays caused by natural disaster, government action, or events beyond reasonable control. Party must notify within 7 days.
- 12ConfidentialityBoth parties agree to keep pricing, volume, and commercial terms confidential for 2 years after the agreement ends.
- 13Governing Law[Jurisdiction TBD — Turkish law recommended; consult lawyer]. Disputes resolved by mutual negotiation first, then arbitration.
Archiving the 2026 deal saves a snapshot of all deal parameters, payment milestones, and supplier rating to portal_meta/seasons/2026. The portal will then be ready to start fresh for the 2027 season. This action cannot be undone.
⚠️ Only archive after delivery is confirmed and all payments are settled.
| Criteria | Weight | What to Assess | Score (0–10) |
|---|---|---|---|
| Honey Quality (Lab Results) | 25% | Moisture, HMF, diastase, antibiotic residues | — / 10 |
| Price Competitiveness | 20% | TRY/kg vs. market benchmark; discount at volume | — / 10 |
| Volume Capacity | 15% | Can they supply minimum 500 kg per season reliably? | — / 10 |
| Traceability & Documentation | 15% | Hive records, region certs, beekeeper IDs | — / 10 |
| Storage Conditions | 10% | Temperature control, facility cleanliness | — / 10 |
| Responsiveness | 5% | Replies within 24h, transparent, professional | — / 10 |
| Existing Certifications | 5% | Organic, export licence, ISO or similar | — / 10 |
| Relationship & Trust | 5% | Personal references, long-term reliability | — / 10 |
- Step 1: Prepare sterile 250ml glass jars — wash, rinse with boiling water, air-dry
- Step 2: Label jars before filling: Form# / Date / Supplier name / Region / Batch#
- Step 3: Wear clean gloves — do not touch inside of jar or lid
- Step 4: Sample directly from bulk storage drum using a clean ladle or pump
- Step 5: Fill to within 1cm of lid — at least 250g
- Step 6: Seal lid tightly, apply tamper-evident sticker over lid
- Step 7: Photograph the sealed jar with its label visible
- Step 8: Complete Chain-of-Custody form (HT-COC-2026-NNN) with supplier signature
- Step 9: Record GPS coordinates of sample collection point
- Step 10: Store samples below 20°C during transport — use a cooler bag if needed
- Step 11: Deliver to Muğla Sıtkı Koçman University laboratory within 48 hours
- Step 12: Obtain and file receipt from the laboratory; request result within 7 working days
- Contact at least 3 cooperatives or suppliers in the Muğla/Aydın region
- Record each quote using the Price Quote Form (doc_03)
- Enter all quotes into the Price Benchmark Template (doc_07)
- Calculate average market price per kg
- Send benchmark summary to Masoud before negotiating final price with the selected supplier
Confirms the honey has not been diluted, heat-treated, or adulterated. Low HMF and high proline are the two most reliable freshness/authenticity indicators for EU customs.
| Parameter | EU Limit | Entry 20–39 |
Standard 40–59 |
Premium 60–79 |
Reserve 80–99 |
Elite 100+ |
|---|---|---|---|---|---|---|
| Moisture Content | ≤ 20% | 18.5–19.9% | 17.0–18.4% | 15.5–16.9% | 14.0–15.4% | ≤ 13.9% |
| HMF (Hydroxymethylfurfural) | ≤ 40 mg/kg | 20–40 mg/kg | 10–19 mg/kg | 5–9 mg/kg | 2–4 mg/kg | ≤ 1 mg/kg |
| Free Acidity | ≤ 50 mEq/kg | 40–50 | 30–39 | 20–29 | 12–19 | ≤ 11 mEq/kg |
| Sucrose | ≤ 5 g/100g | ≤ 5 | ≤ 4 | ≤ 3 | ≤ 2 | ≤ 1 g/100g |
| Reducing Sugars | ≥ 45 g/100g | 45–52 | 53–58 | 59–63 | 64–67 | ≥ 68 g/100g |
| Proline Content | ≥ 180 mg/kg | 180–249 | 250–349 | 350–449 | 450–599 | ≥ 600 mg/kg |
| C4 Sugar Adulteration (IRMS δ¹³C) | ≤ 7% | ≤ 7% | ≤ 5% | ≤ 3% | ≤ 2% | ≤ 1% |
| Water Insoluble Matter | ≤ 0.1 g/100g | ≤ 0.10 | ≤ 0.08 | ≤ 0.06 | ≤ 0.04 | ≤ 0.02 g/100g |
| Test Parameter | Entry | Standard | Premium | Reserve | Elite |
|---|---|---|---|---|---|
| Moisture, Brix, HMF, Free Acidity | ✅ | ✅ | ✅ | ✅ | ✅ |
| Electrical Conductivity, Sucrose, Reducing Sugars | ✅ | ✅ | ✅ | ✅ | ✅ |
| Diastase Activity (Schade / Phadebas) | ✅ | ✅ | ✅ | ✅ | ✅ |
| Proline Content | — | ✅ | ✅ | ✅ | ✅ |
| Pesticide Residues Multi-Screening | — | ✅ | ✅ | ✅ | ✅ |
| Microbiological (TPC, Yeasts/Moulds) | — | ✅ | ✅ | ✅ | ✅ |
| Total Phenolics (TPC), Antioxidant (DPPH/FRAP) | — | — | ✅ | ✅ | ✅ |
| Invertase Activity, Flavonoid Profile (HPLC) | — | — | — | ✅ | ✅ |
| IRMS δ¹³C Isotope (adulteration auth.) | — | — | — | Optional | ✅ |
| Melissopalynology (pollen identification) | — | — | — | Optional | ✅ |
| Field Agent Can Do Independently | Must Check With Project Owner First |
|---|---|
| Send inquiry letters (doc_01, doc_02) | Agreeing any price per kg |
| Schedule meetings and site visits | Agreeing quantity to purchase |
| Collect samples and deliver to lab | Making any payment |
| Complete evaluation forms | Signing any document |
| Record prices in quote forms | Resolving quality test failures |
| Take photos and write reports | Changing or abandoning a supplier |
- Confirm the total available quantity for 2026 season (kg)Ask for minimum and maximum available volume
- Request per-kg price quote in TRY and USD equivalentPrice expected to be confirmed end of August 2026
- Ask about price breakdown: raw honey vs. jarred, labelled, and tested
- Request previous season price history as benchmark
- Clarify payment terms: deposit %, balance timing, bank transfer details
- Ask about bulk discount thresholds (e.g. 100 kg, 500 kg, 1,000 kg)
- Clarify who pays for laboratory testing at Muğla Sıtkı Koçman University
- Clarify who pays for storage at Erdem Cooperative
- Ask about jarring and labelling costs if they provide this service
- Get written quote or price list — even a WhatsApp message is acceptable
- Send thank-you message and summarise agreed next steps in writing
- Record all price quotes in the Price Quote Form (doc_03)
- Contact a storage facility (see Stage 4 → Storage tab) regarding capacity and terms
- Send letter to Muğla Sıtkı Koçman University requesting testing services
- Schedule field visit to hives/collection point before August harvest
- Research at least 2 alternative suppliers using the Supplier Evaluation Matrix
The beekeeping year for Turkish pine honey production. The supplier follows this cycle migrating between lowland winter sites and the pine forests of Muğla each year.
Log each extraction. Records are linked to the primary supplier and drive the quality scorecard.
➕ Add Harvest Record
Derived from harvest records. EU Honey Directive 2001/110/EC limits shown. Pine honey must meet stricter PHBS thresholds for export.
| Parameter | EU Limit (Directive 2001/110/EC) | PHBS Export Grade 4 | Notes |
|---|---|---|---|
| Water Content | ≤ 20% | ≤ 17% | Critical — fermentation risk above 18.5% |
| HMF | ≤ 40 mg/kg | ≤ 15 mg/kg | Higher HMF = overheated or old honey |
| Free Acidity | ≤ 50 mEq/kg | ≤ 40 mEq/kg | Indicates fermentation if high |
| Diastase Activity | ≥ 8 (Schade) | ≥ 12 | Pine honey typically 15–25 |
| Invert Sugar | ≥ 60 g/100g | ≥ 65 g/100g | Glucose + fructose |
| Sucrose | ≤ 5 g/100g | ≤ 3 g/100g | Very low in authentic pine |
| Electrical Conductivity | ≥ 0.8 mS/cm (honeydew) | ≥ 0.9 mS/cm | Pine honey typically 0.9–1.5 |
| Grade | Water % | HMF | Colour | Export Eligibility |
|---|---|---|---|---|
| Grade 4 — Export Premium | ≤ 17% | ≤ 15 mg/kg | Dark amber, clear | ✓ EU / Japan / USA |
| Grade 3 — Export Standard | ≤ 18% | ≤ 25 mg/kg | Dark amber | ✓ Most markets |
| Grade 2 — Domestic Premium | ≤ 19% | ≤ 35 mg/kg | Any | ⚠ Turkey domestic only |
| Grade 1 — Domestic Standard | ≤ 20% | ≤ 40 mg/kg | Any | ⚠ Turkey domestic only |
Record calls, WhatsApp messages, visits, and emails with the supplier. Builds a full relationship history.
➕ Log New Contact
➕ Record Payment
| Stage | Amount | When | Purpose |
|---|---|---|---|
| Deposit | 20–30% | May–June (pre-season) | Guarantees supply commitment, helps the supplier fund migration costs |
| Advance | 40–50% | August (at harvest) | Incentivises quality, paid against lab report confirmation |
| Balance | 20–30% | On delivery / 30 days | Final payment after shipment inspection and weight confirmation |
Documents and certifications the supplier needs to prepare before honey can be exported. Track completion here.
-
Required per shipmentVeterinary Health Certificate (VHC)Issued by Turkish Veterinary Directorate. Required for all honey exports to EU. States the honey is fit for human consumption and meets hygiene regulations.
-
Required per shipmentCertificate of OriginIssued by Turkish Chamber of Commerce. Certifies honey origin as Turkey (HS Code 0409). Essential for preferential tariff claims in some markets.
-
Per batch (new extract)Accredited Lab Test ReportFull panel: water content, HMF, diastase, sugars, free acidity, electrical conductivity, C4 sugars (NMR), pesticide residues (EU MRL panel), antibiotics (chloramphenicol, nitrofurans, sulfonamides).
-
✓ HeldGAP Certificate (Good Agricultural Practices)The supplier holds GAP certification. Annual renewal required. Covers hive management, varroa treatment records, feeding records, and medication withdrawal periods.
-
✓ RegisteredHive Registration (TÜRKVET)Turkish Hive Registration System. All apiaries must be registered. Number of hives and locations recorded with Ministry of Agriculture.
-
In ProgressOrganic CertificationIn progress. EU Organic Reg 2018/848. Requires 3-year transition period with no synthetic miticides. Organic pine honey commands 30–50% premium in European markets.
-
Per shipmentFood-Grade Packaging DeclarationSupplier declaration confirming that drums or jars used for packaging are food-grade (FDA/EU compliant), free from BPA and contaminants.
-
Per shipmentWeight Certificate / Packing ListOfficial weigh-bridge or certified scale certificate for each shipment. Total net weight, gross weight, number of drums/boxes, drum numbers.
For export honey, varroa treatment records must be kept to demonstrate compliance with medication withdrawal periods. EU MRL for varroa treatments is 0 (no residues allowed in honey).
| Treatment | Active Ingredient | Approved Method | Withdrawal Period | Timing |
|---|---|---|---|---|
| Oxalic Acid (OA) | Oxalic Acid Dihydrate | Vaporisation or dribble | None (naturally present in honey) | Winter (broodless), Oct–Nov |
| Formic Acid | Formic Acid | MAQS pads or Formic Pro | None if applied correctly | Spring or early autumn — NOT during honey flow |
| Thymol | Thymol crystals | ApiLife Var or ApiGuard | None if applied correctly | Autumn — min. 2 weeks before winter prep |
| Amitraz (Apivar) | Amitraz | Strip — NOT for EU organic | Min. 4 weeks before honey extraction | Autumn only |
The spine of the portal. Eight stages, left to right, each one page carrying its own checklist, its own supplier directory and its own document shelf. The checklist keys under each stage are the ones the dashboard counts when it draws the progress ring.
Two gates: Google sign-in, then a lookup in the whitelist collection. Being an admin is decided by one email comparison. The important part is on the right — Firestore re-checks both on every single read, so a hidden button is a convenience, never a security boundary.
Two lanes that end in the same place. Attaching a file puts the bytes in Cloud Storage and a pointer in Firestore. Photographing a paper form adds a step: the image is downscaled in the browser, sent to Claude for extraction, and lands as a submission for review.
The portal is one hand-edited HTML file; the public guide is generated from JSON. Both end up on the same Firebase Hosting site through the same deploy.
| Role | How it is determined | Can do |
|---|---|---|
| Admin | auth.currentUser.email === ADMIN_EMAIL (51 references, 38 runtime checks) |
Everything: whitelist, deletes, milestones, deal parameters, API key, cost estimator. |
| Whitelisted user | Entry present in whitelist/<email> |
Read all data, create directory entries, upload documents and scans, use Kovan read-only. |
| Signed in, not whitelisted | Google sign-in succeeds, no whitelist entry | Nothing. Sees the "denied" screen; Firestore rules also refuse. |
| Anonymous | — | The public guide only. All Firestore and Storage reads return 403. |
| Page id | Name | What it does |
|---|---|---|
page-dashboard | 🏠 Dashboard | Workflow progress, activity feed, open items, honey price card, FX badge, stakeholder updates. |
page-ref-contacts | 📞 Key Contacts | Project team loaded from pm_team — the single source of truth for roles. |
page-stage2 | 2 Quality & Testing | EU/Codex limits, sampling checklist, accredited lab directory, lab results, stage documents. |
page-stage3 | 3 Processing & Packaging | Bottling plants and label makers directories, packaging checklist, stage documents. |
page-stage4 | 4 Storage & Logistics | Storage facilities and logistics directories, storage checklist, stage documents. |
page-stage5 | 5 Export & Customs | Customs agents directory, export documentation checklist, stage documents. |
page-stage6 | 6 Cost & Pricing | Jar cost model, margin and selling price, FX conversion, AI cost estimator (admin). |
page-stage7 | 7 Buyer Agreement | Buyers directory, agreement framework, term sheet checklist, stage documents. |
page-stage8 | 8 Post-Delivery | Delivery confirmation, payment tracker, supplier rating, season archive. |
page-suppliers | 🏭 Suppliers | Supplier directory with sourcing mix, quality status and price tracking. |
page-beekeepers | 🐝 Beekeeper Hub | Role-based hub: profile, hives, season, harvests, quality, comms, finance, export, resources. |
page-pm-agent | 🐻 Kovan PM | Tasks, milestones, Gantt, team, weekly report, AI chat with tool execution, field form submissions. |
page-ref-supplier | 📋 Supplier Evaluation | Weighted scoring matrix, 8 criteria. |
page-ref-sampling | 🧪 Sampling Protocol | 12-step procedure and the chain-of-custody form. |
page-ref-benchmark | 💰 Price Benchmark | Compare cooperative quotes, derive a market benchmark. |
page-ref-phbs | 🏅 PHBS Grades | Five tiers across purity, bioactive, physical and microbiological parameters. |
page-downloads | ⬇ All Documents | The 11 reference documents, served from auth-gated Cloud Storage. |
| Path | Page | Purpose |
|---|---|---|
/rehber/ | Rehber ana sayfa | Turkish guide home — links to every public page. |
/rehber/test-plani/ | Analiz planı | Interactive: honey type × market → analyses, ARGEFAR codes, cost. |
/rehber/laboratuvarlar/ | Laboratuvar rehberi | 8 laboratories, comparison matrix, published fees. |
/rehber/fiyatlar/ | Alım fiyatları | Weekly pine honey buying prices by region. |
/en/ | Guide home | English mirror. |
/en/test-plan/ | Test plan | English mirror. |
/en/labs/ | Testing laboratories | English mirror. |
/en/prices/ | Buying prices | English mirror. |
Generated by directory/build.js from
directory/data/*.json. robots.txt allows these paths and disallows the portal.
| Collection | Area | Access |
|---|---|---|
whitelist | Access control | Admin write only. A signed-in user may read only their own entry. |
suppliers | Directory | Whitelisted create/update; admin delete. |
buyers | Directory | Whitelisted create/update; admin delete. |
beekeepers | Beekeeper Hub | Producer records behind the hub. |
beekeeper_harvests | Beekeeper Hub | Harvest records per producer. |
beekeeper_notes | Beekeeper Hub | Free-text notes per producer. |
beekeeper_payments | Beekeeper Hub | Payments made to producers. |
supply_lines | Sourcing | Sourcing mix — which supplier covers which volume. |
lab_results | Quality | Laboratory results per batch. Indexed on supplierId + testedAt. |
field_submissions | Field capture | Photographed forms and their AI-extracted fields. Indexed on submittedBy + submittedAt. |
document_attachments | Documents | Stage document records — storagePath for uploads, legacy downloadUrl for old Drive links. |
pm_tasks | Kovan PM | Tasks with status and assignee. |
pm_milestones | Kovan PM | Milestones driving the Gantt chart. Admin-only controls. |
pm_team | Kovan PM | Project team — the source Key Contacts reads from. |
pm_messages | Kovan PM | Message log for team comms. |
activities | Audit | Activity log. Whitelisted create; admin delete. |
stakeholder_updates | Comms | Updates shown on the dashboard. |
ai_usage | Quota | Written only by the Cloud Function via the Admin SDK. One document per user per day; no client write rule exists, so browsers cannot forge it. |
portal_meta | Configuration | Singleton documents — see below. Admin write only, one scheduler exception. |
portal_meta documents| Document | Holds |
|---|---|
config | No longer holds a key. The Anthropic key moved to Secret Manager behind the anthropic Cloud Function. Delete the leftover anthropicKey field and rotate that key — it was browser-readable and must be treated as compromised. |
honey_prices | Weekly price card. Writable by admin, or by the price script presenting the scheduler secret. |
deal_params | Deal parameters / sourcing mix header. |
open_items | Dashboard open-items list. |
payment_milestones | Payment schedule for the tracker. |
pm_review | Kovan PM review snapshot. |
seasons | Archived seasons (Stage 8 close-out). |
stage8_delivery | Delivery confirmation record. |
stage8_payment | Payment confirmation record. |
stage8_rating | Supplier rating for the closed deal. |
weekly_report | Generated weekly report, cached with its timestamp. |
| Service | Used for |
|---|---|
| Firebase Auth | Google sign-in. Access gated by the whitelist collection. |
| Cloud Firestore | All application data. Rules require an admin or a whitelisted signed-in user. |
| Cloud Storage | docs/reference/** for the 11 documents; docs/<stage>/** for uploads, 20 MB cap; docs/field-submissions/** for scan photos. |
| Anthropic API | Reached only through the anthropic Cloud Function (us-central1). The browser sends its Firebase ID token; the function verifies it, re-checks the whitelist, enforces 100 calls/user/day, and forwards to api.anthropic.com/v1/messages with the key from Secret Manager. 15 call sites, one helper: aiFetch(). |
| Exchange rates | open.er-api.com for TRY and USD — the FX badge and cost model. |
| Firebase Hosting | Serves the SPA and the public guide. docs/**, directory/** and .git/** are excluded from deploys. |
| Item | Detail |
|---|---|
| Stage 1 is an alias | There is no page-stage1. The wrapper around showPage() redirects stage1 to page-suppliers and opens its Checklist tab, which rewrites the page header to read “Stage 1 · Supplier Sourcing”. Working as designed, but worth knowing: the supplier directory and Stage 1 are one page with three tabs, and the Stage 1 checklist keys (p1–p10, n1–n6) live there. |
| Directory pages render user text | Supplier, buyer and other directory cards build HTML by string concatenation. The supplier renderers now escape every field through escH(); the remaining directories still interpolate raw values and should get the same treatment. |
| Anthropic key fixed | Was readable by any whitelisted user and shipped to every browser. Now in Secret Manager, reachable only through the anthropic Cloud Function. Two things still need doing by hand: delete the anthropicKey field from portal_meta/config, and rotate the old key in the Anthropic console — it was exposed for as long as it sat in Firestore. |
| Scheduler secret in rules | firestore.rules carries a shared secret that grants write access to portal_meta/honey_prices. Rules files travel with the repo — treat it as rotate-on-exposure, not authentication. |
| Step | What happens |
|---|---|
1. Commit & push to main | GitHub alghul/honey-portal (private). |
| 2. GitHub Action | firebase-hosting-merge.yml deploys Firestore rules and Storage rules, then Hosting. |
| 3. Manual fallback | npx firebase-tools deploy --only hosting from the repo folder. |
| Guide rebuild | node directory/build.js . regenerates rehber/ and en/. |
| Not deployed | docs/**, directory/**, .git/**, node_modules/**, *.py, *.js. |