create-lupine 1.2.0 → 1.3.1

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 (268) hide show
  1. package/README.md +13 -7
  2. package/index.js +236 -109
  3. package/package.json +1 -1
  4. package/templates/common/.agents/skills/lupine-framework/SKILL.md +3 -3
  5. package/templates/common/.agents/skills/lupine-framework/references/backend-api.md +16 -1
  6. package/templates/common/.agents/skills/lupine-framework/references/icon-handling.md +1 -1
  7. package/templates/common/.agents/skills/lupine-framework/references/mobile-interactions.md +17 -88
  8. package/templates/common/.agents/skills/lupine-framework/references/native-apps.md +47 -24
  9. package/templates/common/.agents/skills/lupine-framework/references/navigation-and-routing.md +1 -0
  10. package/templates/common/.agents/skills/lupine-framework/references/reactivity-and-state.md +2 -2
  11. package/templates/common/.agents/skills/lupine-framework/references/styling-and-themes.md +3 -1
  12. package/templates/common/.env.development +2 -0
  13. package/templates/common/.env.mobile +4 -3
  14. package/templates/common/_env +10 -5
  15. package/templates/common/apps/server/README.md +10 -0
  16. package/templates/common/dev/cp-folder.js +9 -4
  17. package/templates/lupine-template-cv-starter/README.md +33 -1
  18. package/templates/lupine-template-cv-starter/app/package.json +20 -0
  19. package/templates/lupine-template-cv-starter/app/src/app.tsx +6 -0
  20. package/templates/lupine-template-cv-starter/app/src/index.native.tsx +4 -0
  21. package/templates/lupine-template-cv-starter/app/src/index.test.tsx +71 -0
  22. package/templates/lupine-template-cv-starter/app/src/index.web.tsx +28 -0
  23. package/templates/lupine-template-cv-starter/app/tsconfig.json +17 -0
  24. package/templates/lupine-template-cv-starter/lupine.json +8 -7
  25. package/templates/lupine-template-cv-starter/web/src/index.html +9 -2
  26. package/templates/lupine-template-cv-starter/web/src/index.tsx +9 -14
  27. package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.html +9 -2
  28. package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.tsx +4 -20
  29. package/templates/lupine-template-doc-starter/README.md +33 -1
  30. package/templates/lupine-template-doc-starter/app/package.json +20 -0
  31. package/templates/lupine-template-doc-starter/app/src/app.tsx +6 -0
  32. package/templates/lupine-template-doc-starter/app/src/index.native.tsx +4 -0
  33. package/templates/lupine-template-doc-starter/app/src/index.test.tsx +78 -0
  34. package/templates/lupine-template-doc-starter/app/src/index.web.tsx +28 -0
  35. package/templates/lupine-template-doc-starter/app/tsconfig.json +17 -0
  36. package/templates/lupine-template-doc-starter/lupine.json +8 -7
  37. package/templates/lupine-template-doc-starter/web/src/index.html +9 -2
  38. package/templates/lupine-template-doc-starter/web/src/index.tsx +9 -14
  39. package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.html +9 -2
  40. package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.tsx +4 -20
  41. package/templates/lupine-template-fullstack-note/README.md +83 -0
  42. package/templates/{lupine-template-cv-starter → lupine-template-fullstack-note}/api/package.json +2 -2
  43. package/templates/lupine-template-fullstack-note/api/resources/install.mysql.sql +32 -0
  44. package/templates/lupine-template-fullstack-note/api/resources/install.sqlite.sql +27 -0
  45. package/templates/lupine-template-fullstack-note/api/src/service/answer.ts +39 -0
  46. package/templates/lupine-template-fullstack-note/api/src/service/api.ts +52 -0
  47. package/templates/lupine-template-fullstack-note/api/src/service/db.ts +78 -0
  48. package/templates/lupine-template-fullstack-note/api/src/service/notes-api.ts +86 -0
  49. package/templates/lupine-template-fullstack-note/api/src/service/root-api.ts +19 -0
  50. package/templates/lupine-template-fullstack-note/api/src/service/user-api.ts +182 -0
  51. package/templates/lupine-template-fullstack-note/app/package.json +19 -0
  52. package/templates/lupine-template-fullstack-note/app/src/app.tsx +75 -0
  53. package/templates/lupine-template-fullstack-note/app/src/index.native.tsx +4 -0
  54. package/templates/lupine-template-fullstack-note/app/src/index.test.tsx +373 -0
  55. package/templates/lupine-template-fullstack-note/app/src/index.web.tsx +20 -0
  56. package/templates/lupine-template-fullstack-note/app/src/pages/components.tsx +65 -0
  57. package/templates/lupine-template-fullstack-note/app/src/pages/details.tsx +38 -0
  58. package/templates/lupine-template-fullstack-note/app/src/pages/discover.tsx +25 -0
  59. package/templates/lupine-template-fullstack-note/app/src/pages/home.tsx +76 -0
  60. package/templates/lupine-template-fullstack-note/app/src/pages/inbox.tsx +49 -0
  61. package/templates/lupine-template-fullstack-note/app/src/pages/login.tsx +54 -0
  62. package/templates/lupine-template-fullstack-note/app/src/pages/me.tsx +32 -0
  63. package/templates/lupine-template-fullstack-note/app/src/pages/notes.tsx +128 -0
  64. package/templates/lupine-template-fullstack-note/app/src/pages/settings.tsx +45 -0
  65. package/templates/lupine-template-fullstack-note/app/src/shell/AppMenu.tsx +44 -0
  66. package/templates/lupine-template-fullstack-note/app/src/shell/api.ts +159 -0
  67. package/templates/lupine-template-fullstack-note/app/src/shell/data.ts +20 -0
  68. package/templates/lupine-template-fullstack-note/app/src/shell/locales/ja.ts +80 -0
  69. package/templates/lupine-template-fullstack-note/app/src/shell/locales/zh-CN.ts +80 -0
  70. package/templates/lupine-template-fullstack-note/app/src/shell/texts.ts +14 -0
  71. package/templates/lupine-template-fullstack-note/app/tsconfig.json +17 -0
  72. package/templates/lupine-template-fullstack-note/lupine.json +25 -0
  73. package/templates/lupine-template-fullstack-note/web/assets/favicon.ico +0 -0
  74. package/templates/{lupine-template-doc-starter/api → lupine-template-fullstack-note/web}/package.json +2 -2
  75. package/templates/lupine-template-fullstack-note/web/src/index.html +23 -0
  76. package/templates/lupine-template-fullstack-note/web/src/index.tsx +15 -0
  77. package/templates/lupine-template-fullstack-starter/README.md +64 -14
  78. package/templates/lupine-template-fullstack-starter/api/resources/install.mysql.sql +2 -2
  79. package/templates/lupine-template-fullstack-starter/api/resources/install.sqlite.sql +2 -2
  80. package/templates/lupine-template-fullstack-starter/api/src/service/contact-api.ts +2 -2
  81. package/templates/lupine-template-fullstack-starter/api/src/service/user-api.ts +72 -47
  82. package/templates/lupine-template-fullstack-starter/app/package.json +20 -0
  83. package/templates/lupine-template-fullstack-starter/app/src/app.tsx +76 -0
  84. package/templates/lupine-template-fullstack-starter/app/src/index.native.tsx +4 -0
  85. package/templates/lupine-template-fullstack-starter/app/src/index.test.tsx +276 -0
  86. package/templates/lupine-template-fullstack-starter/app/src/index.web.tsx +28 -0
  87. package/templates/lupine-template-fullstack-starter/app/src/pages/about.tsx +27 -0
  88. package/templates/lupine-template-fullstack-starter/app/src/pages/contact.tsx +41 -0
  89. package/templates/lupine-template-fullstack-starter/app/src/pages/favorite.tsx +27 -0
  90. package/templates/lupine-template-fullstack-starter/app/src/pages/home.tsx +63 -0
  91. package/templates/lupine-template-fullstack-starter/app/src/pages/login.tsx +63 -0
  92. package/templates/lupine-template-fullstack-starter/app/src/pages/mine.tsx +44 -0
  93. package/templates/lupine-template-fullstack-starter/app/src/pages/profile.tsx +58 -0
  94. package/templates/lupine-template-fullstack-starter/app/src/pages/register.tsx +48 -0
  95. package/templates/lupine-template-fullstack-starter/app/src/pages/reset-password.tsx +41 -0
  96. package/templates/lupine-template-fullstack-starter/app/src/pages/settings.tsx +33 -0
  97. package/templates/lupine-template-fullstack-starter/app/src/pages/story.tsx +46 -0
  98. package/templates/lupine-template-fullstack-starter/app/src/shell/api.ts +127 -0
  99. package/templates/lupine-template-fullstack-starter/app/src/shell/parts.tsx +100 -0
  100. package/templates/lupine-template-fullstack-starter/app/src/shell/stories.ts +65 -0
  101. package/templates/lupine-template-fullstack-starter/app/src/shell/texts.ts +79 -0
  102. package/templates/lupine-template-fullstack-starter/app/tsconfig.json +17 -0
  103. package/templates/lupine-template-fullstack-starter/lupine.json +6 -7
  104. package/templates/lupine-template-fullstack-starter/web/src/admin/admin-patch.tsx +34 -0
  105. package/templates/lupine-template-fullstack-starter/web/src/{components → admin/components}/home-search-component.tsx +18 -25
  106. package/templates/lupine-template-fullstack-starter/web/src/{components → admin/components}/story-card.tsx +17 -8
  107. package/templates/lupine-template-fullstack-starter/web/src/{components → admin/components}/story-list.tsx +1 -2
  108. package/templates/lupine-template-fullstack-starter/web/src/{admin_dev → admin}/index.html +1 -0
  109. package/templates/lupine-template-fullstack-starter/web/src/{admin_dev → admin}/index.tsx +13 -28
  110. package/templates/lupine-template-fullstack-starter/web/src/{pages → admin/pages}/admin-cfg.tsx +23 -19
  111. package/templates/lupine-template-fullstack-starter/web/src/{pages → admin/pages}/admin-item-edit.tsx +3 -4
  112. package/templates/lupine-template-fullstack-starter/web/src/{pages → admin/pages}/admin-item-list.tsx +2 -3
  113. package/templates/lupine-template-fullstack-starter/web/src/{pages → admin/pages}/admin-user.tsx +15 -20
  114. package/templates/lupine-template-fullstack-starter/web/src/index.html +8 -2
  115. package/templates/lupine-template-fullstack-starter/web/src/index.tsx +11 -150
  116. package/templates/lupine-template-fullstack-starter/web/src/services/fetch-data.ts +7 -25
  117. package/templates/lupine-template-fullstack-starter/web/src/styles/base-css.ts +0 -3
  118. package/templates/lupine-template-fullstack-starter/web/src/styles/theme.ts +1 -2
  119. package/templates/lupine-template-responsive-starter/README.md +46 -2
  120. package/templates/lupine-template-responsive-starter/app/package.json +19 -0
  121. package/templates/lupine-template-responsive-starter/app/src/app.tsx +80 -0
  122. package/templates/lupine-template-responsive-starter/app/src/index.native.tsx +4 -0
  123. package/templates/lupine-template-responsive-starter/app/src/index.test.tsx +283 -0
  124. package/templates/lupine-template-responsive-starter/app/src/index.web.tsx +31 -0
  125. package/templates/lupine-template-responsive-starter/app/src/pages/about.tsx +23 -0
  126. package/templates/lupine-template-responsive-starter/app/src/pages/finance.tsx +48 -0
  127. package/templates/lupine-template-responsive-starter/app/src/pages/mine.tsx +60 -0
  128. package/templates/lupine-template-responsive-starter/app/src/pages/not-found.tsx +9 -0
  129. package/templates/lupine-template-responsive-starter/app/src/pages/note-detail.tsx +43 -0
  130. package/templates/lupine-template-responsive-starter/app/src/pages/note-edit.tsx +45 -0
  131. package/templates/lupine-template-responsive-starter/app/src/pages/note-search.tsx +62 -0
  132. package/templates/lupine-template-responsive-starter/app/src/pages/notes.tsx +71 -0
  133. package/templates/lupine-template-responsive-starter/app/src/pages/settings.tsx +55 -0
  134. package/templates/lupine-template-responsive-starter/app/src/pages/tools.tsx +112 -0
  135. package/templates/lupine-template-responsive-starter/app/src/shell/icons.ts +7 -0
  136. package/templates/lupine-template-responsive-starter/app/src/shell/layout.ts +18 -0
  137. package/templates/lupine-template-responsive-starter/app/src/shell/locales/zh-CN.ts +89 -0
  138. package/templates/lupine-template-responsive-starter/app/src/shell/menu.tsx +81 -0
  139. package/templates/lupine-template-responsive-starter/app/src/shell/nav.ts +12 -0
  140. package/templates/lupine-template-responsive-starter/app/src/shell/store.ts +72 -0
  141. package/templates/lupine-template-responsive-starter/app/src/shell/texts.ts +11 -0
  142. package/templates/lupine-template-responsive-starter/app/tsconfig.json +17 -0
  143. package/templates/lupine-template-responsive-starter/lupine.json +7 -6
  144. package/templates/lupine-template-responsive-starter/web/src/index.html +9 -2
  145. package/templates/lupine-template-responsive-starter/web/src/index.tsx +9 -25
  146. package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.html +12 -6
  147. package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.tsx +12 -22
  148. package/templates/common/apps/server/src/app-loader.ts +0 -4
  149. package/templates/lupine-template-cv-starter/api/resources/config_default.json +0 -6
  150. package/templates/lupine-template-cv-starter/api/resources/install.sqlite.sql +0 -4
  151. package/templates/lupine-template-cv-starter/api/src/index.ts +0 -15
  152. package/templates/lupine-template-cv-starter/web/src/client-env-keys.ts +0 -5
  153. package/templates/lupine-template-cv-starter/web/src/styles/base-css.ts +0 -15
  154. package/templates/lupine-template-doc-starter/api/resources/config_default.json +0 -6
  155. package/templates/lupine-template-doc-starter/api/resources/install.sqlite.sql +0 -4
  156. package/templates/lupine-template-doc-starter/api/src/index.ts +0 -15
  157. package/templates/lupine-template-doc-starter/api/src/resources/config_default.json +0 -6
  158. package/templates/lupine-template-doc-starter/api/src/resources/install.sqlite.sql +0 -4
  159. package/templates/lupine-template-doc-starter/web/src/client-env-keys.ts +0 -5
  160. package/templates/lupine-template-doc-starter/web/src/styles/base-css.ts +0 -15
  161. package/templates/lupine-template-fullstack-starter/web/src/admin_dev/admin-about.tsx +0 -16
  162. package/templates/lupine-template-fullstack-starter/web/src/admin_dev/admin-patch.ts +0 -22
  163. package/templates/lupine-template-fullstack-starter/web/src/components/footer-menu.tsx +0 -52
  164. package/templates/lupine-template-fullstack-starter/web/src/components/footer.tsx +0 -15
  165. package/templates/lupine-template-fullstack-starter/web/src/components/header.tsx +0 -75
  166. package/templates/lupine-template-fullstack-starter/web/src/components/login-code-zh.tsx +0 -162
  167. package/templates/lupine-template-fullstack-starter/web/src/components/login-code.tsx +0 -165
  168. package/templates/lupine-template-fullstack-starter/web/src/components/login-zh.tsx +0 -118
  169. package/templates/lupine-template-fullstack-starter/web/src/components/login.tsx +0 -122
  170. package/templates/lupine-template-fullstack-starter/web/src/components/not-found-page.tsx +0 -12
  171. package/templates/lupine-template-fullstack-starter/web/src/components/register-zh.tsx +0 -161
  172. package/templates/lupine-template-fullstack-starter/web/src/components/register.tsx +0 -163
  173. package/templates/lupine-template-fullstack-starter/web/src/components/reset-password-zh.tsx +0 -166
  174. package/templates/lupine-template-fullstack-starter/web/src/components/reset-password.tsx +0 -177
  175. package/templates/lupine-template-fullstack-starter/web/src/components/user-info.tsx +0 -84
  176. package/templates/lupine-template-fullstack-starter/web/src/frames/admin-page-frame.tsx +0 -48
  177. package/templates/lupine-template-fullstack-starter/web/src/frames/frame1-page-frame.tsx +0 -61
  178. package/templates/lupine-template-fullstack-starter/web/src/frames/frame2-page-frame.tsx +0 -61
  179. package/templates/lupine-template-fullstack-starter/web/src/frames/top-frame.tsx +0 -23
  180. package/templates/lupine-template-fullstack-starter/web/src/frames/user-page-frame.tsx +0 -90
  181. package/templates/lupine-template-fullstack-starter/web/src/models/index.ts +0 -15
  182. package/templates/lupine-template-fullstack-starter/web/src/pages/contact.tsx +0 -105
  183. package/templates/lupine-template-fullstack-starter/web/src/pages/page1-page.tsx +0 -38
  184. package/templates/lupine-template-fullstack-starter/web/src/pages/page2-page.tsx +0 -38
  185. package/templates/lupine-template-fullstack-starter/web/src/pages/user-favorite-page.tsx +0 -58
  186. package/templates/lupine-template-fullstack-starter/web/src/pages/user-home-page.tsx +0 -27
  187. package/templates/lupine-template-fullstack-starter/web/src/pages/user-mine-page.tsx +0 -54
  188. package/templates/lupine-template-fullstack-starter/web/src/pages/user-profile-page-zh.tsx +0 -112
  189. package/templates/lupine-template-fullstack-starter/web/src/pages/user-profile-page.tsx +0 -112
  190. package/templates/lupine-template-fullstack-starter/web/src/pages/user1-page.tsx +0 -57
  191. package/templates/lupine-template-fullstack-starter/web/src/services/shared-data.ts +0 -19
  192. package/templates/lupine-template-fullstack-starter/web/src/styles/app.css +0 -0
  193. package/templates/lupine-template-responsive-starter/api/package.json +0 -6
  194. package/templates/lupine-template-responsive-starter/api/resources/config_default.json +0 -6
  195. package/templates/lupine-template-responsive-starter/api/resources/install.sqlite.sql +0 -4
  196. package/templates/lupine-template-responsive-starter/api/src/service/root-api.ts +0 -18
  197. package/templates/lupine-template-responsive-starter/web/src/app-icons.ts +0 -76
  198. package/templates/lupine-template-responsive-starter/web/src/components/input-history-component.tsx +0 -93
  199. package/templates/lupine-template-responsive-starter/web/src/components/mine-about-page.tsx +0 -87
  200. package/templates/lupine-template-responsive-starter/web/src/components/mine-premium-page.tsx +0 -81
  201. package/templates/lupine-template-responsive-starter/web/src/components/mine-settings-page.tsx +0 -211
  202. package/templates/lupine-template-responsive-starter/web/src/components/mobile-top-search-menu.tsx +0 -107
  203. package/templates/lupine-template-responsive-starter/web/src/components/note-detail.tsx +0 -110
  204. package/templates/lupine-template-responsive-starter/web/src/components/note-edit.tsx +0 -144
  205. package/templates/lupine-template-responsive-starter/web/src/components/note-search-page.tsx +0 -188
  206. package/templates/lupine-template-responsive-starter/web/src/components/search-input.tsx +0 -95
  207. package/templates/lupine-template-responsive-starter/web/src/components/side-menu-content.tsx +0 -169
  208. package/templates/lupine-template-responsive-starter/web/src/frames/app-responsive-frame.tsx +0 -53
  209. package/templates/lupine-template-responsive-starter/web/src/pages/about-page.tsx +0 -32
  210. package/templates/lupine-template-responsive-starter/web/src/pages/finance-page.tsx +0 -35
  211. package/templates/lupine-template-responsive-starter/web/src/pages/home-page.tsx +0 -444
  212. package/templates/lupine-template-responsive-starter/web/src/pages/mine-page.tsx +0 -318
  213. package/templates/lupine-template-responsive-starter/web/src/pages/tools-page.tsx +0 -35
  214. package/templates/lupine-template-responsive-starter/web/src/services/local-notes-service.ts +0 -87
  215. package/templates/lupine-template-responsive-starter/web/src/services/mine-service.ts +0 -45
  216. package/templates/lupine-template-responsive-starter/web/src/styles/app.css +0 -0
  217. package/templates/lupine-template-responsive-starter/web/src/styles/base-css.ts +0 -65
  218. package/templates/lupine-template-responsive-starter/web/src/styles/global.css +0 -2130
  219. package/templates/lupine-template-responsive-starter/web/src/styles/theme.ts +0 -17
  220. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/01-experience/index.md +0 -0
  221. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/02-projects/index.md +0 -0
  222. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/03-skills/index.md +0 -0
  223. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/04-education/index.md +0 -0
  224. /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/index.md +0 -0
  225. /package/templates/lupine-template-cv-starter/{web → app}/markdown/index.md +0 -0
  226. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/01-experience/index.md +0 -0
  227. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/02-projects/index.md +0 -0
  228. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/03-skills/index.md +0 -0
  229. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/04-education/index.md +0 -0
  230. /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/index.md +0 -0
  231. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/01-experience/index.html +0 -0
  232. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/02-projects/index.html +0 -0
  233. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/03-skills/index.html +0 -0
  234. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/04-education/index.html +0 -0
  235. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/index.html +0 -0
  236. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/index.html +0 -0
  237. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/markdown-config.ts +0 -0
  238. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/01-experience/index.html +0 -0
  239. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/02-projects/index.html +0 -0
  240. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/03-skills/index.html +0 -0
  241. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/04-education/index.html +0 -0
  242. /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/index.html +0 -0
  243. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/essentials/index.md +0 -0
  244. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/essentials/list.md +0 -0
  245. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/guide/install.md +0 -0
  246. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/guide/started.md +0 -0
  247. /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/index.md +0 -0
  248. /package/templates/lupine-template-doc-starter/{web → app}/markdown/index.md +0 -0
  249. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/essentials/index.md +0 -0
  250. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/essentials/list.md +0 -0
  251. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/guide/install.md +0 -0
  252. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/guide/started.md +0 -0
  253. /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/index.md +0 -0
  254. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/essentials/index.html +0 -0
  255. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/essentials/list.html +0 -0
  256. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/guide/install.html +0 -0
  257. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/guide/started.html +0 -0
  258. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/index.html +0 -0
  259. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/index.html +0 -0
  260. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/markdown-config.ts +0 -0
  261. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/essentials/index.html +0 -0
  262. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/essentials/list.html +0 -0
  263. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/guide/install.html +0 -0
  264. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/guide/started.html +0 -0
  265. /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/index.html +0 -0
  266. /package/templates/{lupine-template-responsive-starter → lupine-template-fullstack-note}/api/src/index.ts +0 -0
  267. /package/templates/lupine-template-fullstack-starter/{web/assets/images → app/assets}/sample.png +0 -0
  268. /package/templates/lupine-template-fullstack-starter/web/src/{components → admin/components}/story-props.ts +0 -0
@@ -19,11 +19,30 @@ import {
19
19
  DEV_ADMIN_USER_KEY_NAME,
20
20
  DEV_ADMIN_PASS_KEY_NAME,
21
21
  DEV_ADMIN_SESSION_INVALID_BEFORE_KEY_NAME,
22
+ loginGuard,
23
+ getClientIp,
22
24
  } from 'lupine.api';
23
25
  import { sendEmail, sendSiteEmail } from './send-email';
24
26
 
25
27
  const PW_RETRY_MAX = 5;
26
28
  const PW_RETRY_RESET_MINUTES = 15;
29
+
30
+ // A code by email (to sign in or set a new password) is good for CODE_MINUTES from when it was sent. The time is kept
31
+ // with it, as "code.time" in activation: lastvisitdate moves with every wrong try, so it can't tell the age of a code
32
+ const CODE_MINUTES = 30;
33
+ const codeIssuedAt = (stored: unknown): number => Number(String(stored || '').split('.')[1]) || 0;
34
+ const codeMatches = (stored: unknown, provided: unknown): boolean => {
35
+ const code = String(stored || '').split('.')[0];
36
+ const issued = codeIssuedAt(stored);
37
+ return (
38
+ code.length >= 6 &&
39
+ issued > 0 &&
40
+ Date.now() - issued <= CODE_MINUTES * 60 * 1000 &&
41
+ CryptoUtils.timingSafeEqual(code, String(provided || ''))
42
+ );
43
+ };
44
+ // a user's session: the cookie and the login time in the token (which the server checks) end after these days
45
+ const userSessionDays = () => getSessionExpireDays(ADMIN_SESSION_EXPIRE_DAYS_KEY_NAME, 90);
27
46
  const logger = new Logger('user-api');
28
47
 
29
48
  export type LoginJsonProps = {
@@ -39,6 +58,11 @@ export type LoginJsonProps = {
39
58
  const ADMIN_SESSION_INVALID_BEFORE_KEY_NAME = 'ADMIN_SESSION_INVALID_BEFORE';
40
59
  const ADMIN_SESSION_EXPIRE_DAYS_KEY_NAME = 'ADMIN_SESSION_EXPIRE_DAYS';
41
60
 
61
+ // The token of a sign-in is in the answer only for the apps (iOS, Android, macOS, Windows): they have no cookies and
62
+ // send it back in a Cookie header. A browser keeps it in its httpOnly cookie alone, where the scripts of a page can't
63
+ // read it. Browsers send Origin with every POST, the apps don't.
64
+ const tokenForApps = (req: ServerRequest, token: string) => (req.headers.origin ? undefined : token);
65
+
42
66
  export const appAdminHookSetCookie: AppAdminHookSetCookieProps = async (
43
67
  req: ServerRequest,
44
68
  res: ServerResponse,
@@ -65,8 +89,7 @@ export const appAdminHookSetCookie: AppAdminHookSetCookieProps = async (
65
89
  const response = {
66
90
  status: 'ok',
67
91
  message: langHelper.getLang('shared:login_success'),
68
- appLogin: tokenCookie,
69
- result: tokenCookie,
92
+ appLogin: 1,
70
93
  user: {
71
94
  nickname: loginJson.u,
72
95
  admin: loginJson.t === 'admin' ? '1' : '0',
@@ -118,7 +141,7 @@ export const appAdminHookCheckLogin: AppAdminHookCheckLoginProps = async (
118
141
  const adminPass = process.env['ADMIN_PASS'] || '';
119
142
  const pwCheck =
120
143
  username && password && password.length <= 256 && adminUser && adminPass
121
- ? CryptoUtils.verifyPasswordLayered(password, adminPass)
144
+ ? await CryptoUtils.verifyPasswordLayeredAsync(password, adminPass)
122
145
  : { valid: false as const };
123
146
  if (
124
147
  adminUser &&
@@ -150,12 +173,12 @@ const computeUserSessionHash = (username: string, storedPassword: string): strin
150
173
  return CryptoUtils.hash(`${username}:${storedPassword}`);
151
174
  };
152
175
 
153
- const verifyUserPassword = (plainPassword: string, storedPassword: string): boolean => {
176
+ const verifyUserPassword = async (plainPassword: string, storedPassword: string): Promise<boolean> => {
154
177
  if (!plainPassword || plainPassword.length > 256 || !storedPassword) {
155
178
  return false;
156
179
  }
157
180
  if (storedPassword.startsWith('scrypt$')) {
158
- return CryptoUtils.verifyPassword(plainPassword, storedPassword);
181
+ return await CryptoUtils.verifyPasswordAsync(plainPassword, storedPassword);
159
182
  }
160
183
  return CryptoUtils.timingSafeEqual(CryptoUtils.hash(plainPassword), storedPassword);
161
184
  };
@@ -169,7 +192,8 @@ export const getUserFromCookie = async (
169
192
  const cookies = req.locals.cookies();
170
193
  const token = cookies.get('_token', '');
171
194
  if (token) {
172
- const json = adminApiHelper.decryptJson(token) as LoginJsonProps;
195
+ // encrypted with CRYPTO_KEY by the sign-in (decryptJson takes DEV_CRYPTO_KEY without a key)
196
+ const json = adminApiHelper.decryptJson(token, process.env['CRYPTO_KEY']) as LoginJsonProps;
173
197
  if (!json || !json.u) {
174
198
  if (sendResponseWhenError) {
175
199
  const response = {
@@ -224,6 +248,14 @@ export const getUserFromCookie = async (
224
248
  }
225
249
  }
226
250
 
251
+ // a user's token carries its login time: an old (or copied) token ends like the cookie does
252
+ if (isSessionExpired(json.l, userSessionDays())) {
253
+ if (sendResponseWhenError) {
254
+ ApiHelper.sendJson(req, res, { status: 'error', message: langHelper.getLang('shared:not_logged_in') });
255
+ }
256
+ return false;
257
+ }
258
+
227
259
  // verify whether the user is blocked
228
260
  const db = apiCache.getDb();
229
261
  const record = await db.selectObject('$__s_user', ['*'], {
@@ -384,7 +416,7 @@ export const userLogin = async (req: ServerRequest, res: ServerResponse) => {
384
416
  const response = {
385
417
  status: 'ok',
386
418
  message: langHelper.getLang('shared:login_success'),
387
- result: token,
419
+ result: tokenForApps(req, token),
388
420
  user: {
389
421
  nickname: loginJson.u,
390
422
  admin: loginJson.t === 'admin' ? '1' : '0',
@@ -404,19 +436,25 @@ export const userLogin = async (req: ServerRequest, res: ServerResponse) => {
404
436
  return true;
405
437
  }
406
438
 
439
+ // ADMIN_USER of .env: failed tries are counted per client address (loginGuard), and the password is only checked
440
+ // (scrypt) for this user name
407
441
  const adminUser = process.env['ADMIN_USER'] || '';
408
442
  const adminPass = process.env['ADMIN_PASS'] || '';
443
+ const isAdminName = !!adminUser && !!adminPass && typeof data.u === 'string' && adminApiHelper.timingSafeEqual(data.u, adminUser);
444
+ if (isAdminName && (await loginGuard.isLocked(req))) return loginGuard.sendLocked(req, res);
409
445
  const adminPwCheck =
410
- typeof data.u === 'string' &&
411
- typeof data.p === 'string' &&
412
- data.p.length <= 256 &&
413
- adminUser &&
414
- adminPass
415
- ? CryptoUtils.verifyPasswordLayered(data.p, adminPass)
446
+ isAdminName && typeof data.p === 'string' && data.p.length <= 256
447
+ ? await CryptoUtils.verifyPasswordLayeredAsync(data.p, adminPass)
416
448
  : { valid: false as const };
417
- if (adminUser && adminApiHelper.timingSafeEqual(String(data.u || ''), adminUser) && adminPwCheck.valid && adminPwCheck.keyHex) {
449
+ if (isAdminName && (!adminPwCheck.valid || !adminPwCheck.keyHex)) {
450
+ await loginGuard.fail(req);
451
+ ApiHelper.sendJson(req, res, { status: 'error', message: langHelper.getLang('shared:login_failed') });
452
+ return true;
453
+ }
454
+ if (isAdminName && adminPwCheck.keyHex) {
455
+ loginGuard.clear(req);
418
456
  const loginJson: LoginJsonProps = {
419
- ip: req.socket.remoteAddress as string,
457
+ ip: getClientIp(req),
420
458
  id: 0,
421
459
  u: data.u as string,
422
460
  t: 'admin',
@@ -429,7 +467,7 @@ export const userLogin = async (req: ServerRequest, res: ServerResponse) => {
429
467
  const response = {
430
468
  status: 'ok',
431
469
  message: langHelper.getLang('shared:login_success'),
432
- result: tokenCookie,
470
+ result: tokenForApps(req, tokenCookie),
433
471
  user: {
434
472
  nickname: loginJson.u,
435
473
  admin: loginJson.t === 'admin' ? '1' : '0',
@@ -516,9 +554,7 @@ export const userLogin = async (req: ServerRequest, res: ServerResponse) => {
516
554
  if (await checkRetryLockout()) {
517
555
  return true;
518
556
  }
519
- const providedCode = String(data.c || '');
520
- const storedCode = String(result[0].activation || '');
521
- if (storedCode.length < 6 || !CryptoUtils.timingSafeEqual(storedCode, providedCode)) {
557
+ if (!codeMatches(result[0].activation, data.c)) {
522
558
  await recordUserRetry();
523
559
  const response = {
524
560
  status: 'error',
@@ -532,11 +568,7 @@ export const userLogin = async (req: ServerRequest, res: ServerResponse) => {
532
568
  if (await checkRetryLockout()) {
533
569
  return true;
534
570
  }
535
- const providedCode = String(data.c || '');
536
- const storedCode = String(result[0].activation || '');
537
- const codeIssuedAt = DateUtils.fromJSONString(result[0].lastvisitdate);
538
- const isCodeExpired = !codeIssuedAt || Date.now() - codeIssuedAt.getTime() > 30 * 60 * 1000;
539
- if (storedCode.length < 6 || isCodeExpired || !CryptoUtils.timingSafeEqual(storedCode, providedCode)) {
571
+ if (!codeMatches(result[0].activation, data.c)) {
540
572
  await recordUserRetry();
541
573
  const response = {
542
574
  status: 'error',
@@ -553,7 +585,7 @@ export const userLogin = async (req: ServerRequest, res: ServerResponse) => {
553
585
  return true;
554
586
  }
555
587
 
556
- if (!loginOk && !verifyUserPassword(String(data.p || ''), String(result[0].password || ''))) {
588
+ if (!loginOk && !(await verifyUserPassword(String(data.p || ''), String(result[0].password || '')))) {
557
589
  await recordUserRetry();
558
590
  const response = {
559
591
  status: 'error',
@@ -571,18 +603,19 @@ export const userLogin = async (req: ServerRequest, res: ServerResponse) => {
571
603
  lastvisitdate: DateUtils.toJSONString(new Date()),
572
604
  };
573
605
  if (!loginOk && typeof data.p === 'string' && activePasswordHash && !activePasswordHash.startsWith('scrypt$')) {
574
- activePasswordHash = CryptoUtils.hashPassword(data.p);
606
+ activePasswordHash = await CryptoUtils.hashPasswordAsync(data.p);
575
607
  updateLoginObj.password = activePasswordHash;
576
608
  }
577
609
 
578
610
  await db.updateObject('$__s_user', updateLoginObj, { username: data.u as string });
579
611
  const nameAndPassHash = CryptoUtils.sha256(`${result[0].username}:${activePasswordHash}`);
580
612
  const loginJson: LoginJsonProps = {
581
- ip: req.socket.remoteAddress as string,
613
+ ip: getClientIp(req),
582
614
  id: result[0].id,
583
615
  u: result[0].username,
584
616
  t: result[0].usertype,
585
617
  h: nameAndPassHash,
618
+ l: Date.now(),
586
619
  };
587
620
 
588
621
  const token = JSON.stringify(loginJson);
@@ -590,7 +623,7 @@ export const userLogin = async (req: ServerRequest, res: ServerResponse) => {
590
623
  const response = {
591
624
  status: 'ok',
592
625
  message: langHelper.getLang('shared:login_success'),
593
- result: tokenCookie,
626
+ result: tokenForApps(req, tokenCookie),
594
627
  user: {
595
628
  nickname: loginJson.u,
596
629
  admin: loginJson.t === 'admin' ? '1' : '0',
@@ -599,7 +632,7 @@ export const userLogin = async (req: ServerRequest, res: ServerResponse) => {
599
632
  },
600
633
  };
601
634
  req.locals.setCookie('_token', tokenCookie, {
602
- expireDays: getSessionExpireDays(ADMIN_SESSION_EXPIRE_DAYS_KEY_NAME, 90),
635
+ expireDays: userSessionDays(),
603
636
  path: '/',
604
637
  httpOnly: true,
605
638
  secure: isHttpsRequest(req),
@@ -697,7 +730,7 @@ export const userReg = async (req: ServerRequest, res: ServerResponse) => {
697
730
  nickname: data.preferredName as string,
698
731
  username: data.u as string,
699
732
  email: data.u as string,
700
- password: CryptoUtils.hashPassword(data.p),
733
+ password: await CryptoUtils.hashPasswordAsync(data.p),
701
734
  gender: data.sex as string,
702
735
  usertype: 'user',
703
736
  registerdate: lastvisitdate,
@@ -774,7 +807,7 @@ export const userResetCode = async (req: ServerRequest, res: ServerResponse) =>
774
807
  }
775
808
 
776
809
  const db = apiCache.getDb();
777
- const result = await db.selectObject('$__s_user', ['id', 'activation', 'lastvisitdate'], {
810
+ const result = await db.selectObject('$__s_user', ['id', 'activation'], {
778
811
  username: userEmail,
779
812
  });
780
813
  // the same answer whether the address is known or not: nobody learns who has an account here
@@ -784,15 +817,13 @@ export const userResetCode = async (req: ServerRequest, res: ServerResponse) =>
784
817
  return true;
785
818
  }
786
819
  // one code a minute: the form can't be used to flood a mailbox
787
- const issued = result[0].activation && DateUtils.fromJSONString(result[0].lastvisitdate);
788
- if (issued && Date.now() - issued.getTime() < 60 * 1000) {
820
+ if (Date.now() - codeIssuedAt(result[0].activation) < 60 * 1000) {
789
821
  answer();
790
822
  return true;
791
823
  }
792
824
 
793
- const lastvisitdate = DateUtils.toJSONString(new Date());
794
825
  const random = CryptoUtils.randomNumberString(8);
795
- await db.updateObject('$__s_user', { activation: random, lastvisitdate: lastvisitdate }, { username: userEmail });
826
+ await db.updateObject('$__s_user', { activation: `${random}.${Date.now()}` }, { username: userEmail });
796
827
 
797
828
  const siteUrl = (await apiStorage.getWeb('siteUrl')) || 'https://your-site.com';
798
829
  const emailTitle = 'Authentication code';
@@ -824,12 +855,9 @@ export const userResetPw = async (req: ServerRequest, res: ServerResponse) => {
824
855
  const result = await db.selectObject('$__s_user', ['id', 'activation', 'pwretry', 'lastvisitdate'], {
825
856
  username: userEmail,
826
857
  });
858
+ // the answer of a wrong code: nobody learns here who has an account
827
859
  if (!result || result.length !== 1) {
828
- const response = {
829
- status: 'error',
830
- message: langHelper.getLang('shared:user_not_found'),
831
- };
832
- ApiHelper.sendJson(req, res, response);
860
+ ApiHelper.sendJson(req, res, { status: 'error', message: langHelper.getLang('shared:wrong_activation') });
833
861
  return true;
834
862
  }
835
863
 
@@ -847,10 +875,7 @@ export const userResetPw = async (req: ServerRequest, res: ServerResponse) => {
847
875
  }
848
876
  }
849
877
 
850
- const storedCode = String(result[0].activation || '');
851
- const codeIssuedAt = DateUtils.fromJSONString(result[0].lastvisitdate);
852
- const isCodeExpired = !codeIssuedAt || Date.now() - codeIssuedAt.getTime() > 30 * 60 * 1000;
853
- if (storedCode.length < 6 || isCodeExpired || !CryptoUtils.timingSafeEqual(storedCode, String(activation))) {
878
+ if (!codeMatches(result[0].activation, activation)) {
854
879
  await db.updateObject(
855
880
  '$__s_user',
856
881
  { pwretry: (Number(result[0].pwretry) || 0) + 1, lastvisitdate: DateUtils.toJSONString(new Date()) },
@@ -865,7 +890,7 @@ export const userResetPw = async (req: ServerRequest, res: ServerResponse) => {
865
890
  }
866
891
  await db.updateObject(
867
892
  '$__s_user',
868
- { activation: '', pwretry: 0, password: CryptoUtils.hashPassword(pass) },
893
+ { activation: '', activated: '1', pwretry: 0, password: await CryptoUtils.hashPasswordAsync(pass) },
869
894
  { username: userEmail }
870
895
  );
871
896
  const response = {
@@ -903,7 +928,7 @@ export const updateUser = async (req: ServerRequest, res: ServerResponse) => {
903
928
 
904
929
  const updateObj: any = { usertype: usertype };
905
930
  if (password) {
906
- updateObj['password'] = CryptoUtils.hashPassword(password);
931
+ updateObj['password'] = await CryptoUtils.hashPasswordAsync(password);
907
932
  }
908
933
  // clear activation, only admin can update
909
934
  updateObj['activation'] = '';
@@ -962,7 +987,7 @@ export const updateProfile = async (req: ServerRequest, res: ServerResponse) =>
962
987
  ApiHelper.sendJson(req, res, response);
963
988
  return true;
964
989
  }
965
- updateObj['password'] = CryptoUtils.hashPassword(password);
990
+ updateObj['password'] = await CryptoUtils.hashPasswordAsync(password);
966
991
  }
967
992
  const result = await db.updateObject('$__s_user', updateObj, {
968
993
  id: loginJson.id,
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "lupine-template-fullstack-starter-app",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "description": "The app of the full-stack starter: stories, sign-in, the user's pages, settings. One code base for iOS, Android, macOS, Windows and the web.",
6
+ "lupineNative": {
7
+ "name": "LupineFullstack",
8
+ "title": "Lupine Full-stack",
9
+ "id": "com.uuware.lupine.fullstack",
10
+ "entry": {
11
+ "native": "src/index.native.tsx",
12
+ "test": "src/index.test.tsx",
13
+ "web": "src/index.web.tsx"
14
+ }
15
+ },
16
+ "dependencies": {
17
+ "lupine.native.components": "^1.1.0",
18
+ "lupine.native.core": "^1.1.0"
19
+ }
20
+ }
@@ -0,0 +1,76 @@
1
+ import './shell/texts';
2
+ import { createEffect, onBack, onMount, Text, untrack, View } from 'lupine.native.core';
3
+ import { col, Icon, NavBar, NavItem, OverlayHost, Pages, router, syncAppearance, t, Toast, tr, val } from 'lupine.native.components';
4
+ import * as icons from 'lupine.core/icons';
5
+ import { api } from './shell/api';
6
+ import { About, NotFound } from './pages/about';
7
+ import { Contact } from './pages/contact';
8
+ import { Favorite } from './pages/favorite';
9
+ import { Home } from './pages/home';
10
+ import { Login } from './pages/login';
11
+ import { Mine } from './pages/mine';
12
+ import { Profile } from './pages/profile';
13
+ import { Register } from './pages/register';
14
+ import { ResetPassword } from './pages/reset-password';
15
+ import { Settings } from './pages/settings';
16
+ import { StoryPage } from './pages/story';
17
+
18
+ const items: NavItem[] = [
19
+ { key: '/', label: tr('nav.home', 'Stories'), icon: icons.home, testID: 'tab-home' },
20
+ { key: '/favorite', label: tr('nav.favorite', 'Favorites'), icon: icons.heart, testID: 'tab-favorite' },
21
+ { key: '/mine', label: tr('nav.mine', 'Mine'), icon: icons.user, testID: 'tab-mine' },
22
+ ];
23
+
24
+ // the title of the browser's tab (the window on desktops) while a tab is shown; pages over the tabs: the name of the app
25
+ const appName = () => t('app.name', 'Lupine Full-stack');
26
+ const tabTitle = (key: string) => () => (key === '/' ? appName() : `${val(items.find((i) => i.key === key)?.label ?? '')} | ${appName()}`);
27
+
28
+ /** Phones: a tab bar at the bottom, pushed pages cover it. Wide windows: the menu stays on the left. */
29
+ export const App = () => {
30
+ untrack(syncAppearance); // before the first control is created
31
+ createEffect(syncAppearance);
32
+ // who is signed in; not while a server renders the page
33
+ onMount(() => void api.refresh());
34
+ let last = 0;
35
+ onBack(() => {
36
+ if (Date.now() - last < 2000) return false;
37
+ last = Date.now();
38
+ Toast.info(t('ln.pressAgainToExit', 'Press back again to exit'));
39
+ });
40
+ return (
41
+ <View style={{ flex: 1, backgroundColor: col('bg') }}>
42
+ <Pages
43
+ side={240}
44
+ title={appName}
45
+ tabs={[
46
+ { path: '/', page: Home, title: tabTitle('/') },
47
+ { path: '/favorite', page: Favorite, title: tabTitle('/favorite') },
48
+ { path: '/mine', page: Mine, title: tabTitle('/mine') },
49
+ ]}
50
+ routes={[
51
+ { path: '/story/:id', page: ({ id }) => <StoryPage id={id} /> },
52
+ { path: '/login', page: ({ email, mode }) => <Login email={email} mode={mode} /> },
53
+ { path: '/register', page: () => <Register /> },
54
+ { path: '/reset-password', page: ({ email }) => <ResetPassword email={email} /> },
55
+ { path: '/profile', page: () => <Profile /> },
56
+ { path: '/contact', page: () => <Contact /> },
57
+ { path: '/settings', page: () => <Settings /> },
58
+ { path: '/about', page: () => <About /> },
59
+ ]}
60
+ notFound={() => <NotFound />}
61
+ >
62
+ {/* one menu: a tab bar at the bottom on phones, a column on the left on wide windows (css, also on the server) */}
63
+ <NavBar
64
+ items={items} active={router.tab} onPress={router.navigate} width={240}
65
+ header={
66
+ <View style={{ flexDirection: 'row', alignItems: 'center', gap: 10, padding: 18 }}>
67
+ <Icon name={icons.logo} size={26} color={col('primary')} />
68
+ <Text style={{ fontSize: 17, fontWeight: '700', color: col('text') }}>{tr('app.name', 'Lupine Full-stack')}</Text>
69
+ </View>
70
+ }
71
+ />
72
+ </Pages>
73
+ <OverlayHost />
74
+ </View>
75
+ );
76
+ };
@@ -0,0 +1,4 @@
1
+ import { runApp } from 'lupine.native.core/native';
2
+ import { App } from './app';
3
+
4
+ runApp(App);