zkjson 0.6.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/README.md +537 -0
  2. package/assets/collection.png +0 -0
  3. package/assets/db.png +0 -0
  4. package/assets/encode.png +0 -0
  5. package/assets/query.png +0 -0
  6. package/assets/rollup.png +0 -0
  7. package/assets/structure.png +0 -0
  8. package/assets/weavedb.png +0 -0
  9. package/assets/zkjson.png +0 -0
  10. package/benchmark/components/ui/avatar.jsx +49 -0
  11. package/benchmark/components/ui/checkbox.jsx +17 -0
  12. package/benchmark/components/ui/close-button.jsx +20 -0
  13. package/benchmark/components/ui/color-mode.jsx +89 -0
  14. package/benchmark/components/ui/dialog.jsx +54 -0
  15. package/benchmark/components/ui/drawer.jsx +44 -0
  16. package/benchmark/components/ui/field.jsx +22 -0
  17. package/benchmark/components/ui/input-group.jsx +39 -0
  18. package/benchmark/components/ui/popover.jsx +49 -0
  19. package/benchmark/components/ui/provider.jsx +12 -0
  20. package/benchmark/components/ui/radio.jsx +17 -0
  21. package/benchmark/components/ui/slider.jsx +107 -0
  22. package/benchmark/components/ui/tooltip.jsx +35 -0
  23. package/benchmark/jsconfig.json +7 -0
  24. package/benchmark/lib/cbor.js +387 -0
  25. package/benchmark/lib/msgpack.js +651 -0
  26. package/benchmark/next.config.mjs +6 -0
  27. package/benchmark/package.json +22 -0
  28. package/benchmark/pages/_app.js +9 -0
  29. package/benchmark/pages/_document.js +13 -0
  30. package/benchmark/pages/api/hello.js +5 -0
  31. package/benchmark/pages/index.js +438 -0
  32. package/benchmark/public/favicon.ico +0 -0
  33. package/benchmark/public/file.svg +1 -0
  34. package/benchmark/public/globe.svg +1 -0
  35. package/benchmark/public/next.svg +1 -0
  36. package/benchmark/public/vercel.svg +1 -0
  37. package/benchmark/public/window.svg +1 -0
  38. package/benchmark/yarn.lock +2448 -0
  39. package/circom/collection/collection.circom +32 -0
  40. package/circom/collection/compile.sh +10 -0
  41. package/circom/collection/gen.js +34 -0
  42. package/circom/collection/generateInput.js +10 -0
  43. package/circom/collection/index.circom +4 -0
  44. package/circom/collection/test.js +21 -0
  45. package/circom/collection/verifier.sol +247 -0
  46. package/circom/db/compile.sh +10 -0
  47. package/circom/db/db.circom +39 -0
  48. package/circom/db/gen.js +30 -0
  49. package/circom/db/generateInput.js +10 -0
  50. package/circom/db/index.circom +4 -0
  51. package/circom/db/test.js +21 -0
  52. package/circom/db/verifier.sol +261 -0
  53. package/circom/ipfs/calculate_total.circom +17 -0
  54. package/circom/ipfs/compile.sh +10 -0
  55. package/circom/ipfs/gen.js +18 -0
  56. package/circom/ipfs/generateInput.js +10 -0
  57. package/circom/ipfs/index.circom +4 -0
  58. package/circom/ipfs/ipfs.circom +62 -0
  59. package/circom/ipfs/parse.circom +289 -0
  60. package/circom/ipfs/sha256.circom +99 -0
  61. package/circom/ipfs/test.js +167 -0
  62. package/circom/ipfs/verifier.sol +261 -0
  63. package/circom/json/compile.sh +10 -0
  64. package/circom/json/gen.js +22 -0
  65. package/circom/json/gen2.js +21 -0
  66. package/circom/json/generateInput.js +20 -0
  67. package/circom/json/index.circom +4 -0
  68. package/circom/json/json.circom +81 -0
  69. package/circom/json/test.js +100 -0
  70. package/circom/json/verifier.sol +247 -0
  71. package/circom/query/compile.sh +10 -0
  72. package/circom/query/gen.js +28 -0
  73. package/circom/query/generateInput.js +11 -0
  74. package/circom/query/index.circom +4 -0
  75. package/circom/query/query.circom +58 -0
  76. package/circom/query/test.js +20 -0
  77. package/circom/query/verifier.sol +177 -0
  78. package/circom/rollup/compile.sh +10 -0
  79. package/circom/rollup/gen.js +36 -0
  80. package/circom/rollup/generateInput.js +11 -0
  81. package/circom/rollup/index.circom +4 -0
  82. package/circom/rollup/rollup.circom +43 -0
  83. package/circom/rollup/test.js +35 -0
  84. package/circom/rollup/verifier.sol +240 -0
  85. package/circom/scripts/ceremony.js +39 -0
  86. package/circom/scripts/ceremony.sh +6 -0
  87. package/circom/scripts/compile.js +113 -0
  88. package/circom/scripts/compile.sh +16 -0
  89. package/circom/utils/uint.circom +512 -0
  90. package/circom/utils/utils.circom +628 -0
  91. package/demos/arweave/jsconfig.json +7 -0
  92. package/demos/arweave/lib/ZKArweave.json +617 -0
  93. package/demos/arweave/lib/encoder.js +375 -0
  94. package/demos/arweave/next.config.js +6 -0
  95. package/demos/arweave/package.json +26 -0
  96. package/demos/arweave/pages/_app.js +9 -0
  97. package/demos/arweave/pages/_document.js +19 -0
  98. package/demos/arweave/pages/api/arweave.js +31 -0
  99. package/demos/arweave/pages/api/hello.js +5 -0
  100. package/demos/arweave/pages/index.js +869 -0
  101. package/demos/arweave/public/circuit.wasm +0 -0
  102. package/demos/arweave/public/circuit_final.zkey +0 -0
  103. package/demos/arweave/public/verification_key.json +149 -0
  104. package/demos/arweave/vercel.json +7 -0
  105. package/demos/arweave/yarn.lock +2510 -0
  106. package/demos/simple/jsconfig.json +7 -0
  107. package/demos/simple/lib/encoder.js +375 -0
  108. package/demos/simple/next.config.js +6 -0
  109. package/demos/simple/package.json +24 -0
  110. package/demos/simple/pages/_app.js +9 -0
  111. package/demos/simple/pages/_document.js +13 -0
  112. package/demos/simple/pages/api/hello.js +5 -0
  113. package/demos/simple/pages/index.js +342 -0
  114. package/demos/simple/public/circuit.wasm +0 -0
  115. package/demos/simple/public/circuit_final.zkey +0 -0
  116. package/demos/simple/public/verification_key.json +149 -0
  117. package/demos/simple/yarn.lock +2519 -0
  118. package/docs/README.md +17 -0
  119. package/docs/simple-zkjson.md +210 -0
  120. package/docs/solidity-contracts.md +216 -0
  121. package/docs/zk-circuits.md +125 -0
  122. package/docs/zkdb-rollup.md +218 -0
  123. package/docs/zkjson-sdk.md +254 -0
  124. package/docs/zkjson-v1_5.md +365 -0
  125. package/package.json +16 -7
  126. package/sdk/contracts/NORollup.sol +13 -0
  127. package/sdk/package.json +15 -0
  128. package/sdk/yarn.lock +881 -0
  129. package/solidity/README.md +13 -0
  130. package/solidity/arguments.js +4 -0
  131. package/solidity/contracts/NORollup.sol +13 -0
  132. package/solidity/contracts/OPRollup.sol +14 -0
  133. package/solidity/contracts/ZKIPFS.sol +95 -0
  134. package/solidity/contracts/ZKJson.sol +21 -0
  135. package/solidity/contracts/ZKQuery.sol +286 -0
  136. package/solidity/contracts/ZKRollup.sol +35 -0
  137. package/solidity/contracts/apps/NORU.sol +66 -0
  138. package/solidity/contracts/apps/SimpleJSON.sol +64 -0
  139. package/solidity/contracts/apps/SimpleOPRU.sol +67 -0
  140. package/solidity/contracts/apps/SimpleRU.sol +67 -0
  141. package/solidity/contracts/apps/Token.sol +12 -0
  142. package/solidity/contracts/apps/ZKArweave.sol +89 -0
  143. package/solidity/contracts/apps/ZKBridge.sol +74 -0
  144. package/solidity/contracts/apps/ZKNFT.sol +63 -0
  145. package/solidity/contracts/verifiers/verifier_db.sol +275 -0
  146. package/solidity/contracts/verifiers/verifier_ipfs.sol +464 -0
  147. package/solidity/contracts/verifiers/verifier_json.sol +261 -0
  148. package/solidity/contracts/verifiers/verifier_rollup.sol +240 -0
  149. package/solidity/package.json +27 -0
  150. package/solidity/scripts/deploy.js +33 -0
  151. package/solidity/test/NORU.js +66 -0
  152. package/solidity/test/ZKArweave.js +97 -0
  153. package/solidity/test/arweave.js +55 -0
  154. package/solidity/test/bridge.js +71 -0
  155. package/solidity/test/simple.js +76 -0
  156. package/solidity/test/simpleOPRU.js +98 -0
  157. package/solidity/test/simpleRU.js +94 -0
  158. package/solidity/test/zknft.js +98 -0
  159. package/solidity/yarn.lock +4152 -0
  160. package/test/test.js +304 -0
  161. /package/{circomlibjs.js → sdk/circomlibjs.js} +0 -0
  162. /package/{collection.js → sdk/collection.js} +0 -0
  163. /package/{contracts → sdk/contracts}/OPRollup.sol +0 -0
  164. /package/{contracts → sdk/contracts}/ZKIPFS.sol +0 -0
  165. /package/{contracts → sdk/contracts}/ZKJson.sol +0 -0
  166. /package/{contracts → sdk/contracts}/ZKQuery.sol +0 -0
  167. /package/{contracts → sdk/contracts}/ZKRollup.sol +0 -0
  168. /package/{contracts → sdk/contracts}/apps/SimpleJSON.sol +0 -0
  169. /package/{contracts → sdk/contracts}/apps/SimpleOPRU.sol +0 -0
  170. /package/{contracts → sdk/contracts}/apps/SimpleRU.sol +0 -0
  171. /package/{contracts → sdk/contracts}/apps/Token.sol +0 -0
  172. /package/{contracts → sdk/contracts}/apps/ZKArweave.sol +0 -0
  173. /package/{contracts → sdk/contracts}/apps/ZKBridge.sol +0 -0
  174. /package/{contracts → sdk/contracts}/apps/ZKNFT.sol +0 -0
  175. /package/{contracts → sdk/contracts}/verifiers/verifier_db.sol +0 -0
  176. /package/{contracts → sdk/contracts}/verifiers/verifier_ipfs.sol +0 -0
  177. /package/{contracts → sdk/contracts}/verifiers/verifier_json.sol +0 -0
  178. /package/{contracts → sdk/contracts}/verifiers/verifier_rollup.sol +0 -0
  179. /package/{db.js → sdk/db.js} +0 -0
  180. /package/{doc.js → sdk/doc.js} +0 -0
  181. /package/{encoder-v1_5.js → sdk/encoder-v1_5.js} +0 -0
  182. /package/{encoder.js → sdk/encoder.js} +0 -0
  183. /package/{index.js → sdk/index.js} +0 -0
  184. /package/{json.js → sdk/json.js} +0 -0
  185. /package/{nft.js → sdk/nft.js} +0 -0
  186. /package/{parse.js → sdk/parse.js} +0 -0
  187. /package/{uint.js → sdk/uint.js} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "compilerOptions": {
3
+ "paths": {
4
+ "@/*": ["./*"]
5
+ }
6
+ }
7
+ }
@@ -0,0 +1,375 @@
1
+ const base64Map = {
2
+ A: "00",
3
+ B: "01",
4
+ C: "02",
5
+ D: "03",
6
+ E: "04",
7
+ F: "05",
8
+ G: "06",
9
+ H: "07",
10
+ I: "08",
11
+ J: "09",
12
+ K: "10",
13
+ L: "11",
14
+ M: "12",
15
+ N: "13",
16
+ O: "14",
17
+ P: "15",
18
+ Q: "16",
19
+ R: "17",
20
+ S: "18",
21
+ T: "19",
22
+ U: "20",
23
+ V: "21",
24
+ W: "22",
25
+ X: "23",
26
+ Y: "24",
27
+ Z: "25",
28
+ a: "26",
29
+ b: "27",
30
+ c: "28",
31
+ d: "29",
32
+ e: "30",
33
+ f: "31",
34
+ g: "32",
35
+ h: "33",
36
+ i: "34",
37
+ j: "35",
38
+ k: "36",
39
+ l: "37",
40
+ m: "38",
41
+ n: "39",
42
+ o: "40",
43
+ p: "41",
44
+ q: "42",
45
+ r: "43",
46
+ s: "44",
47
+ t: "45",
48
+ u: "46",
49
+ v: "47",
50
+ w: "48",
51
+ x: "49",
52
+ y: "50",
53
+ z: "51",
54
+ 0: "52",
55
+ 1: "53",
56
+ 2: "54",
57
+ 3: "55",
58
+ 4: "56",
59
+ 5: "57",
60
+ 6: "58",
61
+ 7: "59",
62
+ 8: "60",
63
+ 9: "61",
64
+ "-": "62",
65
+ _: "63",
66
+ }
67
+
68
+ function pad(arr, max = 0) {
69
+ arr = arr.map(n => n.toString())
70
+ for (let i = arr.length; i < max; i++) {
71
+ arr.push("0")
72
+ }
73
+ return arr
74
+ }
75
+
76
+ function encodePath(path) {
77
+ const parts = []
78
+ let str = ""
79
+ let num = 0
80
+ for (const s of path) {
81
+ if (num === 2 && !(s === "." || s === "[")) throw Error()
82
+ if (s === ".") {
83
+ if (num === 2) {
84
+ num = 0
85
+ } else {
86
+ parts.push(str)
87
+ str = ""
88
+ }
89
+ } else if (s === "[") {
90
+ if (num !== 2) {
91
+ if (str !== "" || parts.length > 0) parts.push(str)
92
+ str = ""
93
+ }
94
+ num = 1
95
+ } else if (s === "]") {
96
+ if (num !== 1) throw Error()
97
+ num = 2
98
+ if (str === "" || Number.isNaN(+str)) throw Error()
99
+ parts.push(+str)
100
+ str = ""
101
+ } else {
102
+ str += s
103
+ }
104
+ }
105
+ if (str !== "") parts.push(str)
106
+ if (parts.length === 0) parts.push("")
107
+ let encoded = [parts.length]
108
+ for (const p of parts) {
109
+ if (typeof p === "number") {
110
+ encoded = encoded.concat([0, 0, p])
111
+ } else {
112
+ let plen = [p.length]
113
+ if (p.length === 0) plen.push(1)
114
+ encoded = encoded.concat([
115
+ ...plen,
116
+ ...p.split("").map(c => c.charCodeAt(0)),
117
+ ])
118
+ }
119
+ }
120
+ return encoded
121
+ }
122
+
123
+ function decodePath(path) {
124
+ let str = ""
125
+ let p = []
126
+ let len = path.shift()
127
+ while (path.length > 0) {
128
+ const type = path.shift()
129
+ let val = null
130
+ if (type === 0) {
131
+ const type2 = path.shift()
132
+ if (type2 === 0) {
133
+ val = [type2, path.shift()]
134
+ } else {
135
+ val = [type2]
136
+ }
137
+ } else {
138
+ val = []
139
+ for (let i = 0; i < type; i++) {
140
+ val.push(path.shift())
141
+ }
142
+ }
143
+ p.push([type, ...val])
144
+ }
145
+ let i = 0
146
+ for (let s of p) {
147
+ if (s[0] === 0 && s[1] === 0) {
148
+ str += `[${s[2]}]`
149
+ } else if (s[0] === 0 && s[1] === 1) {
150
+ if (str !== "") str += "."
151
+ } else {
152
+ str += `${i === 0 ? "" : "."}${s
153
+ .slice(1)
154
+ .map(c => String.fromCharCode(c))
155
+ .join("")}`
156
+ }
157
+ i++
158
+ }
159
+ return str
160
+ }
161
+
162
+ function flattenPath(path) {
163
+ let p = [path.length]
164
+ for (const v of path) {
165
+ p = p.concat(v)
166
+ }
167
+ return p
168
+ }
169
+
170
+ function _encode(v, path = []) {
171
+ let vals = []
172
+ if (typeof v === "number") {
173
+ vals.push([path, encodeVal(v)])
174
+ } else if (typeof v === "boolean") {
175
+ vals.push([path, encodeVal(v)])
176
+ } else if (v === null) {
177
+ vals.push([path, encodeVal(v)])
178
+ } else if (typeof v === "string") {
179
+ vals.push([path, encodeVal(v)])
180
+ } else if (Array.isArray(v)) {
181
+ let i = 0
182
+ for (const v2 of v) {
183
+ for (const v3 of _encode(v2, [...path, [0, 0, i]])) vals.push(v3)
184
+ i++
185
+ }
186
+ } else if (typeof v === "object") {
187
+ for (const k in v) {
188
+ const key = k.split("").map(c => c.charCodeAt(0))
189
+ for (let v4 of _encode(v[k], [
190
+ ...path,
191
+ [key.length, ...(key.length === 0 ? [1] : key)],
192
+ ])) {
193
+ vals.push(v4)
194
+ }
195
+ }
196
+ }
197
+ return vals
198
+ }
199
+
200
+ function encode(json) {
201
+ let flattened = _encode(json)
202
+ flattened.sort((a, b) => {
203
+ const isUndefined = v => typeof v === "undefined"
204
+ const max = Math.max(a[0].length, b[0].length)
205
+ if (max > 0) {
206
+ for (let i = 0; i < max; i++) {
207
+ const exA = !isUndefined(a[0][i])
208
+ const exB = !isUndefined(b[0][i])
209
+ if (exA && !exB) return 1
210
+ if (!exA && exB) return -1
211
+ const max2 = Math.max(a[0][i].length, b[0][i].length)
212
+ if (max2 > 0) {
213
+ for (let i2 = 0; i2 < max2; i2++) {
214
+ const vA = a[0][i][i2]
215
+ const vB = b[0][i][i2]
216
+ const exA = !isUndefined(vA)
217
+ const exB = !isUndefined(vB)
218
+ if (exA && !exB) return 1
219
+ if (!exA && exB) return -1
220
+ if (vA > vB) return 1
221
+ if (vA < vB) return -1
222
+ }
223
+ }
224
+ }
225
+ }
226
+ return 0
227
+ })
228
+ return flattened.reduce(
229
+ (arr, v) => arr.concat([...flattenPath(v[0]), ...v[1]]),
230
+ []
231
+ )
232
+ }
233
+
234
+ function _decode(arr, obj) {
235
+ let vals = []
236
+ while (arr.length > 0) {
237
+ let plen = arr.shift()
238
+ let keys = []
239
+ let val = null
240
+ while (plen > 0) {
241
+ const plen2 = arr.shift()
242
+ if (plen2 === 0) {
243
+ const plen3 = arr.shift()
244
+ if (plen3 === 1) {
245
+ keys.push([plen2, plen3])
246
+ } else {
247
+ keys.push([plen2, plen3, arr.shift()])
248
+ }
249
+ } else if (plen2 !== 0) {
250
+ const plen3 = plen2
251
+ const key = []
252
+ for (let i2 = 0; i2 < plen3; i2++) key.push(arr.shift())
253
+ keys.push([plen2, ...key])
254
+ }
255
+ plen--
256
+ }
257
+ const type = arr.shift()
258
+ val = [type]
259
+ if (type === 2) {
260
+ val.push(arr.shift())
261
+ val.push(arr.shift())
262
+ } else if (type === 1) {
263
+ val.push(arr.shift())
264
+ } else if (type === 3) {
265
+ const strlen = arr.shift()
266
+ val.push(strlen)
267
+ for (let i2 = 0; i2 < strlen; i2++) val.push(arr.shift())
268
+ }
269
+ vals.push([keys, val])
270
+ }
271
+ return vals
272
+ }
273
+
274
+ function encodeVal(v) {
275
+ let vals = []
276
+ if (typeof v === "number") {
277
+ vals = v < 0 ? [2, 0, -v] : [2, 1, v]
278
+ } else if (typeof v === "boolean") {
279
+ vals = [1, v ? 1 : 0]
280
+ } else if (v === null) {
281
+ vals = [0]
282
+ } else if (typeof v === "string") {
283
+ vals = [3, v.length, ...v.split("").map(c => c.charCodeAt(0))]
284
+ }
285
+ return vals
286
+ }
287
+
288
+ function decodeVal(arr) {
289
+ const type = arr[0]
290
+ const _val = arr[1]
291
+ let val = null
292
+ if (type === 0) {
293
+ val = null
294
+ } else if (type === 1) {
295
+ val = arr[1] ? true : false
296
+ } else if (type === 2) {
297
+ val = (arr[1] === 0 ? -1 : 1) * arr[2]
298
+ } else if (type === 3) {
299
+ val = arr
300
+ .slice(2)
301
+ .map(c => String.fromCharCode(c))
302
+ .join("")
303
+ }
304
+ return val
305
+ }
306
+
307
+ function decode(arr) {
308
+ const decoded = _decode(arr)
309
+ let json =
310
+ decoded[0]?.[0]?.[0]?.[0] === 0 && decoded[0]?.[0]?.[0]?.[1] === 0 ? [] : {}
311
+ for (const v of decoded) {
312
+ const keys = v[0].map(v2 => {
313
+ if (v2[0] === 0) {
314
+ if (v2[1] === 1) return ""
315
+ return v2[2]
316
+ } else {
317
+ return v2
318
+ .slice(1)
319
+ .map(c => String.fromCharCode(c))
320
+ .join("")
321
+ }
322
+ })
323
+ if (keys.length === 0) {
324
+ json = decodeVal(v[1])
325
+ } else {
326
+ let obj = json
327
+ let i = 0
328
+ for (const k of keys) {
329
+ if (typeof k === "number") {
330
+ if (typeof keys[i + 1] === "undefined") {
331
+ obj[k] = decodeVal(v[1])
332
+ } else {
333
+ if (typeof obj[k] === "undefined") {
334
+ if (typeof keys[i + 1] === "string") {
335
+ obj[k] = {}
336
+ } else {
337
+ obj[k] = []
338
+ }
339
+ }
340
+ }
341
+ } else {
342
+ if (typeof obj[k] === "undefined") {
343
+ if (typeof keys[i + 1] === "undefined") {
344
+ obj[k] = decodeVal(v[1])
345
+ } else if (typeof keys[i + 1] === "string") {
346
+ obj[k] = {}
347
+ } else {
348
+ obj[k] = []
349
+ }
350
+ }
351
+ }
352
+ obj = obj[k]
353
+ i++
354
+ }
355
+ }
356
+ }
357
+ return json
358
+ }
359
+
360
+ const str2id = str => {
361
+ return str.map(s => base64Map(s)).join("")
362
+ }
363
+
364
+ module.exports = {
365
+ encode,
366
+ decode,
367
+ encodePath,
368
+ decodePath,
369
+ encodeVal,
370
+ decodeVal,
371
+ pad,
372
+ _encode,
373
+ flattenPath,
374
+ str2id,
375
+ }
@@ -0,0 +1,6 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ reactStrictMode: true,
4
+ }
5
+
6
+ module.exports = nextConfig
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "demo",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "next dev",
7
+ "build": "next build",
8
+ "start": "next start",
9
+ "lint": "next lint"
10
+ },
11
+ "dependencies": {
12
+ "@chakra-ui/next-js": "^2.2.0",
13
+ "@chakra-ui/react": "^2.8.2",
14
+ "@emotion/react": "^11.11.3",
15
+ "@emotion/styled": "^11.11.0",
16
+ "framer-motion": "^10.17.4",
17
+ "next": "14.0.4",
18
+ "ramda": "^0.29.1",
19
+ "react": "18.2.0",
20
+ "react-dom": "18.2.0",
21
+ "snarkjs": "^0.7.2",
22
+ "zkjson": "^0.1.14"
23
+ }
24
+ }
@@ -0,0 +1,9 @@
1
+ import { ChakraProvider } from "@chakra-ui/react"
2
+
3
+ export default function App({ Component, pageProps }) {
4
+ return (
5
+ <ChakraProvider>
6
+ <Component {...pageProps} />
7
+ </ChakraProvider>
8
+ )
9
+ }
@@ -0,0 +1,13 @@
1
+ import { Html, Head, Main, NextScript } from 'next/document'
2
+
3
+ export default function Document() {
4
+ return (
5
+ <Html lang="en">
6
+ <Head />
7
+ <body>
8
+ <Main />
9
+ <NextScript />
10
+ </body>
11
+ </Html>
12
+ )
13
+ }
@@ -0,0 +1,5 @@
1
+ // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2
+
3
+ export default function handler(req, res) {
4
+ res.status(200).json({ name: 'John Doe' })
5
+ }