@@ -6,12 +6,35 @@ These docs describe **how to build any canister** in this style — not a single
66
77---
88
9- ## Documents
10-
11- | Guide | Purpose |
12- | -------| ---------|
13- | [ code-guide.md] ( ./code-guide.md ) | Folder layout, layer rules, request flow, how to add features, migrations, tests |
14- | [ deploy-guide.md] ( ./deploy-guide.md ) | Build, local deploy, mainnet install, upgrade, verification, troubleshooting |
9+ ## Documentation index
10+
11+ ### Code guide — how to write backend
12+
13+ | Doc | Topic |
14+ | -----| -------|
15+ | [ code-guide/README.md] ( ./code-guide/README.md ) | Index & reading order |
16+ | [ architecture.md] ( ./code-guide/architecture.md ) | Folder layout, layers, request flow |
17+ | [ feature-workflow.md] ( ./code-guide/feature-workflow.md ) | Add a feature step-by-step |
18+ | [ main-and-migrations.md] ( ./code-guide/main-and-migrations.md ) | ` main.mo ` , timers, migrations |
19+ | [ testing.md] ( ./code-guide/testing.md ) | Tests, harness, scenarios |
20+ | [ conventions.md] ( ./code-guide/conventions.md ) | Naming, errors, security, versioning |
21+ | [ external-canisters.md] ( ./code-guide/external-canisters.md ) | Ledger, index, mocks |
22+ | [ checklist.md] ( ./code-guide/checklist.md ) | Review, bootstrap, mistakes |
23+
24+ ### Deploy guide — how to ship
25+
26+ | Doc | Topic |
27+ | -----| -------|
28+ | [ deploy-guide/README.md] ( ./deploy-guide/README.md ) | Index & quick commands |
29+ | [ prerequisites.md] ( ./deploy-guide/prerequisites.md ) | Tools, identity, build rule |
30+ | [ build.md] ( ./deploy-guide/build.md ) | ` build-lottery.sh ` , wasm output |
31+ | [ local-deploy.md] ( ./deploy-guide/local-deploy.md ) | Local replica |
32+ | [ mainnet-fresh.md] ( ./deploy-guide/mainnet-fresh.md ) | First IC install |
33+ | [ mainnet-upgrade.md] ( ./deploy-guide/mainnet-upgrade.md ) | Upgrade + memory persistence |
34+ | [ frontend-connection.md] ( ./deploy-guide/frontend-connection.md ) | Env, agent v3, Vercel |
35+ | [ scripts-reference.md] ( ./deploy-guide/scripts-reference.md ) | All scripts |
36+ | [ troubleshooting.md] ( ./deploy-guide/troubleshooting.md ) | Errors & fixes |
37+ | [ release-checklist.md] ( ./deploy-guide/release-checklist.md ) | Pre-ship checklist |
1538
1639---
1740
@@ -21,19 +44,19 @@ These docs describe **how to build any canister** in this style — not a single
2144Client / Frontend
2245 │
2346 ▼
24- main.mo ──────────── thin actor entrypoint (public API only)
47+ main.mo ──────────── thin actor entrypoint
2548 │
2649 ▼
27- api/v1/*Controller ─ request handling, caller forwarding
50+ api/v1/*Controller ─ request handling
2851 │
2952 ▼
30- services/* ─ business rules, workflows, orchestration
53+ services/* ─ business rules
3154 │
3255 ▼
33- repositories/* ─ data access abstraction
56+ repositories/* ─ data access
3457 │
3558 ▼
36- storage/* ─ stable memory implementation
59+ storage/* ─ stable memory
3760```
3861
3962** Golden rule:** Data flows down. Dependencies never flow up.
@@ -47,26 +70,32 @@ Client / Frontend
4770| Motoko (` moc ` ) | 1.7.0 via mops |
4871| ` mo:core ` | 2.5.0 |
4972| ` mo:test ` | 2.1.1 |
50- | Persistence | Enhanced orthogonal persistence + migration chain |
51- | Build | ` bash scripts/build-lottery.sh ` (moc directly — not ` dfx build ` for production wasm) |
52- | Tests | ` bash scripts/run-tests.sh ` → ` backend/testing/**/*.test.mo ` |
73+ | Build | ` DFX_NETWORK=ic bash scripts/build-lottery.sh ` |
74+ | Tests | ` bash scripts/run-tests.sh ` (local ` backend/testing/ ` ) |
75+ | Mainnet canister | ` ulahq-iyaaa-aaaao-bbcoq-cai ` |
76+ | Live dashboard | https://win-canister.vercel.app |
5377
5478---
5579
5680## When to read which guide
5781
58- - ** Starting a new canister or feature** → [ code-guide.md] ( ./code-guide.md )
59- - ** First deploy or upgrade to IC mainnet** → [ deploy-guide.md] ( ./deploy-guide.md )
60- - ** Folder naming only** → [ ../readme] ( ../readme ) (short structure reference)
82+ | Goal | Start here |
83+ | ------| ------------|
84+ | New feature | [ code-guide/feature-workflow.md] ( ./code-guide/feature-workflow.md ) |
85+ | Migration / upgrade issue | [ code-guide/main-and-migrations.md] ( ./code-guide/main-and-migrations.md ) |
86+ | First mainnet deploy | [ deploy-guide/mainnet-fresh.md] ( ./deploy-guide/mainnet-fresh.md ) |
87+ | Upgrade existing canister | [ deploy-guide/mainnet-upgrade.md] ( ./deploy-guide/mainnet-upgrade.md ) |
88+ | Vercel / frontend 404 | [ deploy-guide/troubleshooting.md] ( ./deploy-guide/troubleshooting.md ) |
89+ | Short folder tree | [ ../readme] ( ../readme ) |
6190
6291---
6392
64- ## Checklist before every release
93+ ## Pre- release checklist
6594
66- - [ ] All services have tests under ` backend/testing/<name>/ `
67- - [ ] ` bash scripts/run-tests.sh ` passes
68- - [ ] ` bash scripts/build-lottery.sh ` produces wasm
69- - [ ] New persistent fields have a migration file in ` src/migrations/ `
95+ - [ ] ` bash scripts/run-tests.sh ` passes (local)
96+ - [ ] ` DFX_NETWORK=ic bash scripts/build-lottery.sh ` succeeds
97+ - [ ] Migration added for new persistent fields
7098- [ ] No business logic in ` main.mo ` or controllers
71- - [ ] No direct stable memory access outside ` storage/ `
72- - [ ] Public API changes are versioned under ` api/v1/ ` (or new ` v2/ ` )
99+ - [ ] No direct stable memory outside ` storage/ `
100+ - [ ] API changes versioned under ` api/v1/ `
101+ - [ ] Frontend IDL synced if API changed
0 commit comments