ProjectSalesCore CRM — Backend
Drawn byAron Dacoroon
StackLaravel · MySQL · Passport
API live

Working demonstration — not a slide deck

The SalesCore backend,
already running.

Your front-end demo is fully designed but resets on every reload — there is no database behind it. So I built one. This server runs a real Laravel API on MySQL implementing SalesCore's pipeline, approval workflow, KPI engine and audit trail — seeded with the exact numbers your demo shows. Every figure below is fetched live from the database.

demo login  takabayashi@crosslink.co.jp / demo1234  — same as your front-end
Open the live API docs ↗ Read the architecture
6月 目標 Target
from targets table
納品予定 Scheduled
sum of June orders
タラレバ Pipeline
7 open deals
達成率 Achievement
computed server-side

connecting to GET /api/v1/public/stats

SHEET 01

What the demo is missing — and what this build proves

The prototype at demo-cl-crm.crosslink-technologies.ph computes everything in the browser and loses it on reload. The engineering risk in this project is entirely on the backend: the schema, the API, the calculation logic, the approval rules. This demonstration removes that risk — each piece below is implemented and testable right now.

Persistent
MySQL schema — 15 tables Migrations & seeders Demo-identical data
Secured
Passport token auth 6 roles Audit trail on every mutation
Enforced
Pipeline stage rules Approval workflow Server-side validation, JP messages
Computed
KPI engine — targets, gap, 達成率 6-month forward rollup CSV export
Scope note: 分析 (Analytics) and 請求/商奉行 invoicing integration are Phase 2 in your demo — specified in my estimate, intentionally not built here.
SHEET 02

Architecture

Client
Existing SalesCore front-end — unchanged swaps mock state for HTTPS /api/v1
HTTP layer
Versioned REST routes Form Request validation API Resources (camelCase JSON)
Domain
KpiService — calculation engine Workflow engine — status transitions Stage history & audit observers
Data
MySQL 8 — normalized, indexed Eloquent models & relations Seeders reproduce the demo state
Same layering, production-hardened, in the full build — this demo is the proof of shape, not a throwaway.
SHEET 03

Database design

Every screen of the demo maps onto this schema. Cross-references mirror the UI: a client links to its deals, orders and delivery notes — exactly like the 関連受注 / 関連納品書 / 関連タラレバ tabs.

IDENTITY users role_id → roles presence_status department roles ×6 管理者 … 閲覧のみ audit_logs action · entity changes JSON CRM 顧客カルテ clients segment · type brand_profile JSON contacts… industry PIPELINE タラレバ deals stage ×5 前タラ→失注 amount ¥ · delivery_month producer_id → users director_id → users client_id → clients deal_stage_histories from → to · changed_by timestamped ORDERS 受注 orders status ×4 受注済→納品完了 delivery_date · at_risk deal_id · client_id production_steps 初校·二校·校了·印刷·納品 planned · done dates BILLING 納品書 delivery_notes status: 下書き→承認済み number · total ¥ client_id · order_id approvals action · acted_by · comment delivery_note_items qty × unit_price SETTINGS 設定 targets scope: company/segment/user period YYYY-MM amount ¥ — drives KPI
SHEET 04

The approval workflow, enforced by the server

Illegal moves are refused with a Japanese-language 422 — try approving an already-approved note in the API docs: 現在のステータス(承認済み)からこの操作はできません。 Every transition writes to the approvals history and the audit trail. Approved notes stream out as GET /delivery-notes/export/csv with UTF-8 BOM so 経理 opens them cleanly in Excel.

SHEET 05

KPI engine — your demo's math, server-side

The demo computes these in the browser; here MySQL is the single source of truth. Create a deal for ¥999,999 through the API — the pipeline total recalculates instantly, the same live test you can run against this server.

monthly target (targets)¥39,500,000
scheduled revenue (June orders)¥21,800,000
gap to target=¥17,700,000
open pipeline (7 deals)+¥111,000,000
projected landing=¥132,800,000
achievement 達成率=55.2%
SHEET 06

Try the API

POST/loginPassport token
GET/dashboard/summaryexecutive KPIs
GET/deals?stage=quotedpipeline board
POST/dealstotals recalc live
POST/deals/{id}/move-stagerules enforced
GET/orders/scheduleGantt + at-risk
POST/delivery-notes/{id}/approveworkflow
GET/delivery-notes/export/csv経理向け
GET/clients/{id}顧客カルテ 360
PATCH/members/{id}/presence在社/外出…
GET/targets?period=2026-06KPI matrix
GET/audit-logswho did what
# 1 — get a token (same demo credentials as your front-end)
curl -X POST https://…/api/v1/login \
  -H "Content-Type: application/json" \
  -d '{"email":"takabayashi@crosslink.co.jp","password":"demo1234"}'

# 2 — the dashboard, straight from MySQL
curl https://…/api/v1/dashboard/summary?period=2026-06 \
  -H "Authorization: Bearer <token>"