robodev 0.11.0 → 0.13.0

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 (329) hide show
  1. package/package.json +1 -1
  2. package/src/collect-files.test.ts +19 -0
  3. package/src/collect-files.ts +1 -0
  4. package/src/config.test.ts +26 -0
  5. package/src/config.ts +34 -5
  6. package/src/emit-starter.test.ts +68 -0
  7. package/src/emit-starter.ts +47 -13
  8. package/src/index.ts +45 -4
  9. package/templates/auth-chat/.config/local.spa.template.yml +27 -0
  10. package/templates/auth-chat/.oxlint-base.json +29 -0
  11. package/templates/auth-chat/.oxlintrc.json +78 -0
  12. package/templates/auth-chat/.rulesync/rules/frontend-api-boundary.md +36 -0
  13. package/templates/auth-chat/.rulesync/rules/frontend-component-structure.md +38 -0
  14. package/templates/auth-chat/.rulesync/rules/frontend-forms.md +32 -0
  15. package/templates/auth-chat/.rulesync/rules/frontend-notifications.md +24 -0
  16. package/templates/auth-chat/.rulesync/rules/frontend-povio-components.md +42 -0
  17. package/templates/auth-chat/.rulesync/rules/frontend-povio-ui.md +45 -0
  18. package/templates/auth-chat/.rulesync/rules/frontend-query-autocomplete.md +29 -0
  19. package/templates/auth-chat/.rulesync/rules/frontend-tables-and-lists.md +34 -0
  20. package/templates/auth-chat/.rulesync/rules/frontend-translations.md +26 -0
  21. package/templates/auth-chat/.rulesync/rules/project-overview.md +32 -0
  22. package/templates/auth-chat/.rulesync/rules/robodev-api.md +30 -0
  23. package/templates/auth-chat/.rulesync/rules/robodev-auth.md +40 -0
  24. package/templates/auth-chat/.rulesync/rules/robodev-database.md +22 -0
  25. package/templates/auth-chat/.rulesync/rules/role-based-app-structure.md +36 -0
  26. package/templates/auth-chat/.rulesync/skills/media-feature/SKILL.md +21 -0
  27. package/templates/auth-chat/.rulesync/skills/povio-ui-styling/SKILL.md +208 -0
  28. package/templates/auth-chat/.rulesync/skills/povio-ui-styling/agents/openai.yaml +4 -0
  29. package/templates/auth-chat/.rulesync/skills/robodev-api-route/SKILL.md +13 -0
  30. package/templates/auth-chat/.rulesync/skills/robodev-table/SKILL.md +12 -0
  31. package/templates/auth-chat/README.md +26 -7
  32. package/templates/auth-chat/api/invite.ts +43 -0
  33. package/templates/auth-chat/apps/fe/index.html +24 -0
  34. package/templates/auth-chat/apps/fe/openapi-codegen.config.ts +37 -0
  35. package/templates/auth-chat/apps/fe/package.json +82 -0
  36. package/templates/auth-chat/apps/fe/public/apple-touch-icon.png +0 -0
  37. package/templates/auth-chat/apps/fe/public/favicon-96x96.png +0 -0
  38. package/templates/auth-chat/apps/fe/public/favicon.ico +0 -0
  39. package/templates/auth-chat/apps/fe/public/favicon.svg +3 -0
  40. package/templates/auth-chat/apps/fe/public/site.webmanifest +21 -0
  41. package/templates/auth-chat/apps/fe/public/web-app-manifest-192x192.png +0 -0
  42. package/templates/auth-chat/apps/fe/public/web-app-manifest-512x512.png +0 -0
  43. package/templates/auth-chat/apps/fe/src/assets/fonts/GeneralSans-Bold.otf +0 -0
  44. package/templates/auth-chat/apps/fe/src/assets/fonts/GeneralSans-Medium.otf +0 -0
  45. package/templates/auth-chat/apps/fe/src/assets/fonts/GeneralSans-Regular.otf +0 -0
  46. package/templates/auth-chat/apps/fe/src/assets/fonts/GeneralSans-Semibold.otf +0 -0
  47. package/templates/auth-chat/apps/fe/src/assets/locales/en/translation.json +202 -0
  48. package/templates/auth-chat/apps/fe/src/assets/locales/sl/translation.json +202 -0
  49. package/templates/auth-chat/apps/fe/src/clients/app-rest-client.ts +15 -0
  50. package/templates/auth-chat/apps/fe/src/clients/auth-token-store.ts +101 -0
  51. package/templates/auth-chat/apps/fe/src/clients/rest/app-error-handler.ts +31 -0
  52. package/templates/auth-chat/apps/fe/src/clients/rest/interceptors/authorization-header.interceptor.ts +15 -0
  53. package/templates/auth-chat/apps/fe/src/clients/rest/interceptors/refresh-token.interceptor.ts +37 -0
  54. package/templates/auth-chat/apps/fe/src/clients/rest/interceptors/response.interceptor.ts +17 -0
  55. package/templates/auth-chat/apps/fe/src/components/404.tsx +18 -0
  56. package/templates/auth-chat/apps/fe/src/components/features/auth/AuthBrandPanel.tsx +60 -0
  57. package/templates/auth-chat/apps/fe/src/components/features/auth/AuthLayout.tsx +23 -0
  58. package/templates/auth-chat/apps/fe/src/components/features/auth/LoginPage.tsx +111 -0
  59. package/templates/auth-chat/apps/fe/src/components/features/auth/RegisterPage.tsx +143 -0
  60. package/templates/auth-chat/apps/fe/src/components/features/chat/ChatPage.tsx +105 -0
  61. package/templates/auth-chat/apps/fe/src/components/features/chat/InviteForm.tsx +84 -0
  62. package/templates/auth-chat/apps/fe/src/components/features/profile/ProfilePage.tsx +96 -0
  63. package/templates/auth-chat/apps/fe/src/components/googleAnalytics/GoogleAnalytics.tsx +35 -0
  64. package/templates/auth-chat/apps/fe/src/components/layout/AppLayout.tsx +19 -0
  65. package/templates/auth-chat/apps/fe/src/components/layout/app-header/AppHeader.tsx +91 -0
  66. package/templates/auth-chat/apps/fe/src/components/layout/app-header/MobileNavigation.tsx +51 -0
  67. package/templates/auth-chat/apps/fe/src/components/layout/app-header/NavLink.tsx +29 -0
  68. package/templates/auth-chat/apps/fe/src/components/shared/branding/BrandLogo.tsx +13 -0
  69. package/templates/auth-chat/apps/fe/src/components/shared/error/ErrorFallback.tsx +43 -0
  70. package/templates/auth-chat/apps/fe/src/components/shared/error/ErrorText.tsx +20 -0
  71. package/templates/auth-chat/apps/fe/src/components/shared/error/NotFound.tsx +36 -0
  72. package/templates/auth-chat/apps/fe/src/components/shared/forms/RequiredLabel.tsx +21 -0
  73. package/templates/auth-chat/apps/fe/src/components/shared/forms/RowInputWrapper.tsx +50 -0
  74. package/templates/auth-chat/apps/fe/src/components/shared/head/AppHead.tsx +32 -0
  75. package/templates/auth-chat/apps/fe/src/components/shared/head/DefaultAppHead.tsx +34 -0
  76. package/templates/auth-chat/apps/fe/src/components/shared/layout/LoadingState.tsx +9 -0
  77. package/templates/auth-chat/apps/fe/src/components/shared/layout/ThinPageWrapper.tsx +5 -0
  78. package/templates/auth-chat/apps/fe/src/components/shared/page/PageHeader.tsx +69 -0
  79. package/templates/auth-chat/apps/fe/src/components/shared/ui/Card.tsx +60 -0
  80. package/templates/auth-chat/apps/fe/src/components/shared/ui/GoogleLoginButton.tsx +19 -0
  81. package/templates/auth-chat/apps/fe/src/components/shared/ui/RequiredLabel.tsx +22 -0
  82. package/templates/auth-chat/apps/fe/src/components/shared/ui/TableActions.tsx +22 -0
  83. package/templates/auth-chat/apps/fe/src/config/app.config.ts +35 -0
  84. package/templates/auth-chat/apps/fe/src/config/i18n.ts +43 -0
  85. package/templates/auth-chat/apps/fe/src/config/inits/a11y.ts +14 -0
  86. package/templates/auth-chat/apps/fe/src/config/inits/logger.ts +7 -0
  87. package/templates/auth-chat/apps/fe/src/config/inits/sentry.ts +21 -0
  88. package/templates/auth-chat/apps/fe/src/config/jwt.config.ts +2 -0
  89. package/templates/auth-chat/apps/fe/src/config/query.config.ts +20 -0
  90. package/templates/auth-chat/apps/fe/src/hooks/useAuth.ts +5 -0
  91. package/templates/auth-chat/apps/fe/src/main.tsx +52 -0
  92. package/templates/auth-chat/apps/fe/src/pages/(guest)/login.tsx +23 -0
  93. package/templates/auth-chat/apps/fe/src/pages/(guest)/register.tsx +23 -0
  94. package/templates/auth-chat/apps/fe/src/pages/(guest)/route.tsx +18 -0
  95. package/templates/auth-chat/apps/fe/src/pages/(private)/index.tsx +23 -0
  96. package/templates/auth-chat/apps/fe/src/pages/(private)/profile.tsx +23 -0
  97. package/templates/auth-chat/apps/fe/src/pages/(private)/route.tsx +18 -0
  98. package/templates/auth-chat/apps/fe/src/pages/(public)/auth.tsx +37 -0
  99. package/templates/auth-chat/apps/fe/src/pages/(public)/route.tsx +9 -0
  100. package/templates/auth-chat/apps/fe/src/pages/__root.tsx +164 -0
  101. package/templates/auth-chat/apps/fe/src/providers/AppErrorBoundary.tsx +10 -0
  102. package/templates/auth-chat/apps/fe/src/providers/OpenApiRuntimeProvider.tsx +31 -0
  103. package/templates/auth-chat/apps/fe/src/providers/index.tsx +44 -0
  104. package/templates/auth-chat/apps/fe/src/providers/jwt.provider.tsx +95 -0
  105. package/templates/auth-chat/apps/fe/src/routeTree.gen.ts +225 -0
  106. package/templates/auth-chat/apps/fe/src/styles/base.css +103 -0
  107. package/templates/auth-chat/apps/fe/src/styles/fonts/fonts.tsx +10 -0
  108. package/templates/auth-chat/apps/fe/src/styles/fonts/general-sans.css +31 -0
  109. package/templates/auth-chat/apps/fe/src/styles/globals.css +28 -0
  110. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/button.override.ts +536 -0
  111. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/checkbox.override.ts +71 -0
  112. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/input.override.ts +252 -0
  113. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/label.override.ts +91 -0
  114. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/modal.override.ts +57 -0
  115. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/radio.override.ts +46 -0
  116. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/table.override.ts +104 -0
  117. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/tag.override.ts +66 -0
  118. package/templates/auth-chat/apps/fe/src/styles/overrides/defaults/typography.override.ts +115 -0
  119. package/templates/auth-chat/apps/fe/src/styles/overrides/outline.clsx.ts +10 -0
  120. package/templates/auth-chat/apps/fe/src/styles/overrides/uiOverrides.override.ts +60 -0
  121. package/templates/auth-chat/apps/fe/src/styles/theme.css +2177 -0
  122. package/templates/auth-chat/apps/fe/src/types/i18next.d.ts +12 -0
  123. package/templates/auth-chat/apps/fe/src/types/table.d.ts +17 -0
  124. package/templates/auth-chat/apps/fe/src/types/ui.d.ts +26 -0
  125. package/templates/auth-chat/apps/fe/src/types/vite-env.d.ts +20 -0
  126. package/templates/auth-chat/apps/fe/src/utils/date.utils.ts +17 -0
  127. package/templates/auth-chat/apps/fe/src/utils/number.utils.ts +12 -0
  128. package/templates/auth-chat/apps/fe/src/utils/string.utils.ts +5 -0
  129. package/templates/auth-chat/apps/fe/src/vite-env.d.ts +1 -0
  130. package/templates/auth-chat/apps/fe/tsconfig.app.json +32 -0
  131. package/templates/auth-chat/apps/fe/tsconfig.json +9 -0
  132. package/templates/auth-chat/apps/fe/tsconfig.node.json +31 -0
  133. package/templates/auth-chat/apps/fe/vite.config.ts +94 -0
  134. package/templates/auth-chat/openapi.json +1016 -0
  135. package/templates/auth-chat/oxfmt.config.js +23 -0
  136. package/templates/auth-chat/package.json +6 -13
  137. package/templates/auth-chat/rulesync.jsonc +18 -0
  138. package/templates/auth-chat/tsconfig.json +2 -4
  139. package/templates/backend/README.md +2 -2
  140. package/templates/backend/api/_lib.ts +359 -0
  141. package/templates/backend/api/aliens/labels.ts +19 -0
  142. package/templates/backend/api/files/presigned-url.ts +48 -0
  143. package/templates/backend/api/files/upload.ts +29 -0
  144. package/templates/backend/api/planets/[id]/like.ts +36 -0
  145. package/templates/backend/api/planets/[id].ts +56 -13
  146. package/templates/backend/api/planets/paginate.ts +36 -0
  147. package/templates/backend/api/planets.ts +52 -44
  148. package/templates/backend/database.ts +33 -13
  149. package/templates/backend/package.json +1 -1
  150. package/templates/catalog.json +3 -3
  151. package/templates/empty/package.json +1 -1
  152. package/templates/space/.config/local.spa.template.yml +27 -0
  153. package/templates/space/.oxlint-base.json +29 -0
  154. package/templates/space/.oxlintrc.json +78 -0
  155. package/templates/space/.rulesync/rules/frontend-api-boundary.md +36 -0
  156. package/templates/space/.rulesync/rules/frontend-component-structure.md +38 -0
  157. package/templates/space/.rulesync/rules/frontend-forms.md +32 -0
  158. package/templates/space/.rulesync/rules/frontend-notifications.md +24 -0
  159. package/templates/space/.rulesync/rules/frontend-povio-components.md +42 -0
  160. package/templates/space/.rulesync/rules/frontend-povio-ui.md +45 -0
  161. package/templates/space/.rulesync/rules/frontend-query-autocomplete.md +29 -0
  162. package/templates/space/.rulesync/rules/frontend-tables-and-lists.md +34 -0
  163. package/templates/space/.rulesync/rules/frontend-translations.md +26 -0
  164. package/templates/space/.rulesync/rules/project-overview.md +32 -0
  165. package/templates/space/.rulesync/rules/robodev-api.md +30 -0
  166. package/templates/space/.rulesync/rules/robodev-auth.md +40 -0
  167. package/templates/space/.rulesync/rules/robodev-database.md +22 -0
  168. package/templates/space/.rulesync/rules/role-based-app-structure.md +36 -0
  169. package/templates/space/.rulesync/skills/media-feature/SKILL.md +21 -0
  170. package/templates/space/.rulesync/skills/povio-ui-styling/SKILL.md +208 -0
  171. package/templates/space/.rulesync/skills/povio-ui-styling/agents/openai.yaml +4 -0
  172. package/templates/space/.rulesync/skills/robodev-api-route/SKILL.md +13 -0
  173. package/templates/space/.rulesync/skills/robodev-table/SKILL.md +12 -0
  174. package/templates/space/README.md +26 -7
  175. package/templates/space/api/_lib.ts +359 -0
  176. package/templates/space/api/aliens/labels.ts +19 -0
  177. package/templates/space/api/files/presigned-url.ts +48 -0
  178. package/templates/space/api/files/upload.ts +29 -0
  179. package/templates/space/api/planets/[id]/like.ts +36 -0
  180. package/templates/space/api/planets/[id].ts +56 -13
  181. package/templates/space/api/planets/paginate.ts +36 -0
  182. package/templates/space/api/planets.ts +52 -44
  183. package/templates/space/apps/fe/index.html +24 -0
  184. package/templates/space/apps/fe/openapi-codegen.config.ts +37 -0
  185. package/templates/space/apps/fe/package.json +82 -0
  186. package/templates/space/apps/fe/public/apple-touch-icon.png +0 -0
  187. package/templates/space/apps/fe/public/favicon-96x96.png +0 -0
  188. package/templates/space/apps/fe/public/favicon.ico +0 -0
  189. package/templates/space/apps/fe/public/favicon.svg +3 -0
  190. package/templates/space/apps/fe/public/site.webmanifest +21 -0
  191. package/templates/space/apps/fe/public/web-app-manifest-192x192.png +0 -0
  192. package/templates/space/apps/fe/public/web-app-manifest-512x512.png +0 -0
  193. package/templates/space/apps/fe/src/assets/fonts/GeneralSans-Bold.otf +0 -0
  194. package/templates/space/apps/fe/src/assets/fonts/GeneralSans-Medium.otf +0 -0
  195. package/templates/space/apps/fe/src/assets/fonts/GeneralSans-Regular.otf +0 -0
  196. package/templates/space/apps/fe/src/assets/fonts/GeneralSans-Semibold.otf +0 -0
  197. package/templates/space/apps/fe/src/assets/locales/en/translation.json +301 -0
  198. package/templates/space/apps/fe/src/assets/locales/sl/translation.json +301 -0
  199. package/templates/space/apps/fe/src/clients/app-rest-client.ts +15 -0
  200. package/templates/space/apps/fe/src/clients/auth-token-store.ts +101 -0
  201. package/templates/space/apps/fe/src/clients/rest/app-error-handler.ts +31 -0
  202. package/templates/space/apps/fe/src/clients/rest/interceptors/authorization-header.interceptor.ts +15 -0
  203. package/templates/space/apps/fe/src/clients/rest/interceptors/refresh-token.interceptor.ts +37 -0
  204. package/templates/space/apps/fe/src/clients/rest/interceptors/response.interceptor.ts +17 -0
  205. package/templates/space/apps/fe/src/components/404.tsx +18 -0
  206. package/templates/space/apps/fe/src/components/features/auth/AuthBrandPanel.tsx +60 -0
  207. package/templates/space/apps/fe/src/components/features/auth/AuthLayout.tsx +23 -0
  208. package/templates/space/apps/fe/src/components/features/auth/LoginPage.tsx +111 -0
  209. package/templates/space/apps/fe/src/components/features/auth/RegisterPage.tsx +143 -0
  210. package/templates/space/apps/fe/src/components/features/home/HomePage.tsx +21 -0
  211. package/templates/space/apps/fe/src/components/features/planets/details/PlanetDetailsPage.tsx +139 -0
  212. package/templates/space/apps/fe/src/components/features/planets/details/PlanetEditPage.tsx +266 -0
  213. package/templates/space/apps/fe/src/components/features/planets/feed/PlanetFeedCard.tsx +131 -0
  214. package/templates/space/apps/fe/src/components/features/planets/feed/PlanetsFeedPage.tsx +119 -0
  215. package/templates/space/apps/fe/src/components/features/planets/list/PlanetCard.tsx +89 -0
  216. package/templates/space/apps/fe/src/components/features/planets/list/PlanetCreateModal.tsx +179 -0
  217. package/templates/space/apps/fe/src/components/features/planets/list/PlanetsFilters.css +3 -0
  218. package/templates/space/apps/fe/src/components/features/planets/list/PlanetsFilters.tsx +73 -0
  219. package/templates/space/apps/fe/src/components/features/planets/list/PlanetsGridPage.tsx +51 -0
  220. package/templates/space/apps/fe/src/components/features/planets/list/PlanetsInfiniteTablePage.tsx +79 -0
  221. package/templates/space/apps/fe/src/components/features/planets/list/PlanetsPage.tsx +65 -0
  222. package/templates/space/apps/fe/src/components/features/planets/list/PlanetsTablePage.tsx +72 -0
  223. package/templates/space/apps/fe/src/components/features/planets/list/PlanetsTableSummary.tsx +29 -0
  224. package/templates/space/apps/fe/src/components/features/planets/list/PlanetsViewTabs.tsx +79 -0
  225. package/templates/space/apps/fe/src/components/features/planets/list/table/PlanetsTable.tsx +30 -0
  226. package/templates/space/apps/fe/src/components/features/planets/list/table/PlanetsTableActions.tsx +64 -0
  227. package/templates/space/apps/fe/src/components/features/planets/list/table/PlanetsTableInfinite.tsx +36 -0
  228. package/templates/space/apps/fe/src/components/features/planets/list/table/planetsTableColumns.tsx +72 -0
  229. package/templates/space/apps/fe/src/components/features/planets/list/table/usePlanetTableFilters.tsx +102 -0
  230. package/templates/space/apps/fe/src/components/features/profile/ProfilePage.tsx +96 -0
  231. package/templates/space/apps/fe/src/components/googleAnalytics/GoogleAnalytics.tsx +35 -0
  232. package/templates/space/apps/fe/src/components/layout/AppLayout.tsx +19 -0
  233. package/templates/space/apps/fe/src/components/layout/app-header/AppHeader.tsx +93 -0
  234. package/templates/space/apps/fe/src/components/layout/app-header/MobileNavigation.tsx +53 -0
  235. package/templates/space/apps/fe/src/components/layout/app-header/NavLink.tsx +29 -0
  236. package/templates/space/apps/fe/src/components/shared/branding/BrandLogo.tsx +13 -0
  237. package/templates/space/apps/fe/src/components/shared/error/ErrorFallback.tsx +43 -0
  238. package/templates/space/apps/fe/src/components/shared/error/ErrorText.tsx +20 -0
  239. package/templates/space/apps/fe/src/components/shared/error/NotFound.tsx +36 -0
  240. package/templates/space/apps/fe/src/components/shared/forms/RequiredLabel.tsx +21 -0
  241. package/templates/space/apps/fe/src/components/shared/forms/RowInputWrapper.tsx +50 -0
  242. package/templates/space/apps/fe/src/components/shared/head/AppHead.tsx +32 -0
  243. package/templates/space/apps/fe/src/components/shared/head/DefaultAppHead.tsx +34 -0
  244. package/templates/space/apps/fe/src/components/shared/layout/LoadingState.tsx +9 -0
  245. package/templates/space/apps/fe/src/components/shared/layout/ThinPageWrapper.tsx +5 -0
  246. package/templates/space/apps/fe/src/components/shared/page/PageHeader.tsx +69 -0
  247. package/templates/space/apps/fe/src/components/shared/ui/Card.tsx +60 -0
  248. package/templates/space/apps/fe/src/components/shared/ui/GoogleLoginButton.tsx +19 -0
  249. package/templates/space/apps/fe/src/components/shared/ui/RequiredLabel.tsx +22 -0
  250. package/templates/space/apps/fe/src/components/shared/ui/TableActions.tsx +22 -0
  251. package/templates/space/apps/fe/src/config/app.config.ts +35 -0
  252. package/templates/space/apps/fe/src/config/i18n.ts +43 -0
  253. package/templates/space/apps/fe/src/config/inits/a11y.ts +14 -0
  254. package/templates/space/apps/fe/src/config/inits/logger.ts +7 -0
  255. package/templates/space/apps/fe/src/config/inits/sentry.ts +21 -0
  256. package/templates/space/apps/fe/src/config/jwt.config.ts +2 -0
  257. package/templates/space/apps/fe/src/config/query.config.ts +20 -0
  258. package/templates/space/apps/fe/src/hooks/useAuth.ts +5 -0
  259. package/templates/space/apps/fe/src/main.tsx +52 -0
  260. package/templates/space/apps/fe/src/pages/(guest)/login.tsx +23 -0
  261. package/templates/space/apps/fe/src/pages/(guest)/register.tsx +23 -0
  262. package/templates/space/apps/fe/src/pages/(guest)/route.tsx +18 -0
  263. package/templates/space/apps/fe/src/pages/(private)/index.tsx +23 -0
  264. package/templates/space/apps/fe/src/pages/(private)/planets/$id/edit.tsx +53 -0
  265. package/templates/space/apps/fe/src/pages/(private)/planets/$id/index.tsx +41 -0
  266. package/templates/space/apps/fe/src/pages/(private)/planets/index.tsx +24 -0
  267. package/templates/space/apps/fe/src/pages/(private)/planets-feed.tsx +23 -0
  268. package/templates/space/apps/fe/src/pages/(private)/profile.tsx +23 -0
  269. package/templates/space/apps/fe/src/pages/(private)/route.tsx +18 -0
  270. package/templates/space/apps/fe/src/pages/(public)/auth.tsx +37 -0
  271. package/templates/space/apps/fe/src/pages/(public)/route.tsx +9 -0
  272. package/templates/space/apps/fe/src/pages/__root.tsx +164 -0
  273. package/templates/space/apps/fe/src/providers/AppErrorBoundary.tsx +10 -0
  274. package/templates/space/apps/fe/src/providers/OpenApiRuntimeProvider.tsx +31 -0
  275. package/templates/space/apps/fe/src/providers/index.tsx +44 -0
  276. package/templates/space/apps/fe/src/providers/jwt.provider.tsx +95 -0
  277. package/templates/space/apps/fe/src/routeTree.gen.ts +309 -0
  278. package/templates/space/apps/fe/src/styles/base.css +103 -0
  279. package/templates/space/apps/fe/src/styles/fonts/fonts.tsx +10 -0
  280. package/templates/space/apps/fe/src/styles/fonts/general-sans.css +31 -0
  281. package/templates/space/apps/fe/src/styles/globals.css +28 -0
  282. package/templates/space/apps/fe/src/styles/overrides/defaults/button.override.ts +536 -0
  283. package/templates/space/apps/fe/src/styles/overrides/defaults/checkbox.override.ts +71 -0
  284. package/templates/space/apps/fe/src/styles/overrides/defaults/input.override.ts +252 -0
  285. package/templates/space/apps/fe/src/styles/overrides/defaults/label.override.ts +91 -0
  286. package/templates/space/apps/fe/src/styles/overrides/defaults/modal.override.ts +57 -0
  287. package/templates/space/apps/fe/src/styles/overrides/defaults/radio.override.ts +46 -0
  288. package/templates/space/apps/fe/src/styles/overrides/defaults/table.override.ts +104 -0
  289. package/templates/space/apps/fe/src/styles/overrides/defaults/tag.override.ts +66 -0
  290. package/templates/space/apps/fe/src/styles/overrides/defaults/typography.override.ts +115 -0
  291. package/templates/space/apps/fe/src/styles/overrides/outline.clsx.ts +10 -0
  292. package/templates/space/apps/fe/src/styles/overrides/uiOverrides.override.ts +60 -0
  293. package/templates/space/apps/fe/src/styles/theme.css +2177 -0
  294. package/templates/space/apps/fe/src/types/i18next.d.ts +12 -0
  295. package/templates/space/apps/fe/src/types/table.d.ts +17 -0
  296. package/templates/space/apps/fe/src/types/ui.d.ts +26 -0
  297. package/templates/space/apps/fe/src/types/vite-env.d.ts +20 -0
  298. package/templates/space/apps/fe/src/utils/date.utils.ts +17 -0
  299. package/templates/space/apps/fe/src/utils/image-fallback.ts +9 -0
  300. package/templates/space/apps/fe/src/utils/media-upload.ts +63 -0
  301. package/templates/space/apps/fe/src/utils/number.utils.ts +12 -0
  302. package/templates/space/apps/fe/src/utils/string.utils.ts +5 -0
  303. package/templates/space/apps/fe/src/vite-env.d.ts +1 -0
  304. package/templates/space/apps/fe/tsconfig.app.json +32 -0
  305. package/templates/space/apps/fe/tsconfig.json +9 -0
  306. package/templates/space/apps/fe/tsconfig.node.json +31 -0
  307. package/templates/space/apps/fe/vite.config.ts +94 -0
  308. package/templates/space/database.ts +33 -13
  309. package/templates/space/openapi.json +1819 -0
  310. package/templates/space/oxfmt.config.js +23 -0
  311. package/templates/space/package.json +6 -13
  312. package/templates/space/rulesync.jsonc +18 -0
  313. package/templates/space/tsconfig.json +2 -4
  314. package/templates/auth-chat/index.html +0 -201
  315. package/templates/auth-chat/src/main.tsx +0 -282
  316. package/templates/auth-chat/vite.config.ts +0 -7
  317. package/templates/backend/api/health.ts +0 -7
  318. package/templates/backend/api/launch.ts +0 -29
  319. package/templates/backend/api/me.ts +0 -14
  320. package/templates/backend/api/motto.ts +0 -9
  321. package/templates/backend/api/rockets.ts +0 -43
  322. package/templates/space/api/health.ts +0 -7
  323. package/templates/space/api/launch.ts +0 -29
  324. package/templates/space/api/me.ts +0 -14
  325. package/templates/space/api/motto.ts +0 -9
  326. package/templates/space/api/rockets.ts +0 -43
  327. package/templates/space/index.html +0 -138
  328. package/templates/space/src/main.tsx +0 -229
  329. package/templates/space/vite.config.ts +0 -7
@@ -0,0 +1,23 @@
1
+ import { createFileRoute } from "@tanstack/react-router";
2
+ import { useTranslation } from "react-i18next";
3
+
4
+ import { LoginPage } from "@/components/features/auth/LoginPage";
5
+ import { AppHead } from "@/components/shared/head/AppHead";
6
+
7
+ function PageComponent() {
8
+ const { t } = useTranslation();
9
+
10
+ return (
11
+ <>
12
+ <AppHead
13
+ title={t(($) => $.auth.login.head.title)}
14
+ description={t(($) => $.auth.login.head.description)}
15
+ />
16
+ <LoginPage />
17
+ </>
18
+ );
19
+ }
20
+
21
+ export const Route = createFileRoute("/(guest)/login")({
22
+ component: PageComponent,
23
+ });
@@ -0,0 +1,23 @@
1
+ import { createFileRoute } from "@tanstack/react-router";
2
+ import { useTranslation } from "react-i18next";
3
+
4
+ import { RegisterPage } from "@/components/features/auth/RegisterPage";
5
+ import { AppHead } from "@/components/shared/head/AppHead";
6
+
7
+ function PageComponent() {
8
+ const { t } = useTranslation();
9
+
10
+ return (
11
+ <>
12
+ <AppHead
13
+ title={t(($) => $.auth.register.head.title)}
14
+ description={t(($) => $.auth.register.head.description)}
15
+ />
16
+ <RegisterPage />
17
+ </>
18
+ );
19
+ }
20
+
21
+ export const Route = createFileRoute("/(guest)/register")({
22
+ component: PageComponent,
23
+ });
@@ -0,0 +1,18 @@
1
+ import { AuthGuard } from "@povio/openapi-codegen-cli";
2
+ import { Outlet, createFileRoute } from "@tanstack/react-router";
3
+
4
+ import { AuthLayout } from "@/components/features/auth/AuthLayout";
5
+
6
+ function GuestLayout() {
7
+ return (
8
+ <AuthGuard type="public-only">
9
+ <AuthLayout>
10
+ <Outlet />
11
+ </AuthLayout>
12
+ </AuthGuard>
13
+ );
14
+ }
15
+
16
+ export const Route = createFileRoute("/(guest)")({
17
+ component: GuestLayout,
18
+ });
@@ -0,0 +1,23 @@
1
+ import { createFileRoute } from "@tanstack/react-router";
2
+ import { useTranslation } from "react-i18next";
3
+
4
+ import { ChatPage } from "@/components/features/chat/ChatPage";
5
+ import { AppHead } from "@/components/shared/head/AppHead";
6
+
7
+ function PageComponent() {
8
+ const { t } = useTranslation();
9
+
10
+ return (
11
+ <>
12
+ <AppHead
13
+ title={t(($) => $.chat.head.title)}
14
+ description={t(($) => $.chat.head.description)}
15
+ />
16
+ <ChatPage />
17
+ </>
18
+ );
19
+ }
20
+
21
+ export const Route = createFileRoute("/(private)/")({
22
+ component: PageComponent,
23
+ });
@@ -0,0 +1,23 @@
1
+ import { createFileRoute } from "@tanstack/react-router";
2
+ import { useTranslation } from "react-i18next";
3
+
4
+ import { ProfilePage } from "@/components/features/profile/ProfilePage";
5
+ import { AppHead } from "@/components/shared/head/AppHead";
6
+
7
+ function PageComponent() {
8
+ const { t } = useTranslation();
9
+
10
+ return (
11
+ <>
12
+ <AppHead
13
+ title={t(($) => $.profile.head.title)}
14
+ description={t(($) => $.profile.head.description)}
15
+ />
16
+ <ProfilePage />
17
+ </>
18
+ );
19
+ }
20
+
21
+ export const Route = createFileRoute("/(private)/profile")({
22
+ component: PageComponent,
23
+ });
@@ -0,0 +1,18 @@
1
+ import { AuthGuard } from "@povio/openapi-codegen-cli";
2
+ import { Outlet, createFileRoute } from "@tanstack/react-router";
3
+
4
+ import { AppLayout } from "@/components/layout/AppLayout";
5
+
6
+ function PrivateLayout() {
7
+ return (
8
+ <AuthGuard type="private">
9
+ <AppLayout>
10
+ <Outlet />
11
+ </AppLayout>
12
+ </AuthGuard>
13
+ );
14
+ }
15
+
16
+ export const Route = createFileRoute("/(private)")({
17
+ component: PrivateLayout,
18
+ });
@@ -0,0 +1,37 @@
1
+ import { createFileRoute, useNavigate } from "@tanstack/react-router";
2
+ import { useEffect } from "react";
3
+ import z from "zod";
4
+
5
+ import { LoadingState } from "@/components/shared/layout/LoadingState";
6
+ import { useAuth } from "@/hooks/useAuth";
7
+
8
+ const authSearchSchema = z.object({
9
+ type: z.string().optional(),
10
+ accessToken: z.string().optional(),
11
+ refreshToken: z.string().optional(),
12
+ });
13
+
14
+ function AuthCallbackPage() {
15
+ const navigate = useNavigate();
16
+ const { accessToken, refreshToken } = Route.useSearch();
17
+ const { updateTokens } = useAuth();
18
+
19
+ useEffect(() => {
20
+ if (accessToken) {
21
+ const decodedAccessToken = decodeURIComponent(accessToken);
22
+ const decodedRefreshToken = refreshToken ? decodeURIComponent(refreshToken) : undefined;
23
+ updateTokens?.(decodedAccessToken, decodedRefreshToken);
24
+
25
+ navigate({ to: "/" });
26
+ } else {
27
+ navigate({ to: "/login" });
28
+ }
29
+ }, [accessToken, refreshToken, navigate, updateTokens]);
30
+
31
+ return <LoadingState />;
32
+ }
33
+
34
+ export const Route = createFileRoute("/(public)/auth")({
35
+ component: AuthCallbackPage,
36
+ validateSearch: authSearchSchema,
37
+ });
@@ -0,0 +1,9 @@
1
+ import { Outlet, createFileRoute } from "@tanstack/react-router";
2
+
3
+ function PublicLayout() {
4
+ return <Outlet />;
5
+ }
6
+
7
+ export const Route = createFileRoute("/(public)")({
8
+ component: PublicLayout,
9
+ });
@@ -0,0 +1,164 @@
1
+ import { OpenApiRouter } from "@povio/openapi-codegen-cli";
2
+ import { Confirmation, ToastContainer, UIConfig, UIOverrides, UIRouter } from "@povio/ui";
3
+ import { TanStackDevtools } from "@tanstack/react-devtools";
4
+ import { ReactQueryDevtoolsPanel } from "@tanstack/react-query-devtools";
5
+ import { Outlet, createRootRoute, useNavigate, useRouterState } from "@tanstack/react-router";
6
+ import { TanStackRouterDevtoolsPanel } from "@tanstack/react-router-devtools";
7
+ import { useCallback, useEffect } from "react";
8
+ import { useTranslation } from "react-i18next";
9
+ import { onCLS, onINP, onLCP } from "web-vitals";
10
+
11
+ import { NotFoundPage } from "@/components/404";
12
+ import GoogleAnalytics from "@/components/googleAnalytics/GoogleAnalytics";
13
+ import { DefaultAppHead } from "@/components/shared/head/DefaultAppHead";
14
+ import { AppConfig } from "@/config/app.config";
15
+ import { initA11y } from "@/config/inits/a11y";
16
+ import { initLogger } from "@/config/inits/logger";
17
+ import { initSentry } from "@/config/inits/sentry";
18
+ import Providers from "@/providers";
19
+ import { AppErrorBoundary } from "@/providers/AppErrorBoundary";
20
+ import { OpenApiRuntimeProvider } from "@/providers/OpenApiRuntimeProvider";
21
+ import { Fonts } from "@/styles/fonts/fonts";
22
+ import { uiOverrides } from "@/styles/overrides/uiOverrides.override";
23
+
24
+ import "@/config/i18n";
25
+ initLogger();
26
+ initSentry();
27
+ initA11y();
28
+
29
+ const Root = () => {
30
+ const { i18n } = useTranslation();
31
+
32
+ const navigate = useNavigate();
33
+ const searchString = useRouterState({
34
+ select: (state) => state.location.searchStr,
35
+ });
36
+
37
+ const push = useCallback(
38
+ async (to: string, params?: Record<string, unknown>) => {
39
+ await navigate({ to, search: params });
40
+ return true;
41
+ },
42
+ [navigate],
43
+ );
44
+
45
+ const replace = useCallback(
46
+ async (to: string, params?: Record<string, unknown>) => {
47
+ await navigate({ to, replace: true, search: params });
48
+ return true;
49
+ },
50
+ [navigate],
51
+ );
52
+
53
+ useEffect(() => {
54
+ const handler = (lng: string) => {
55
+ if (typeof document !== "undefined") {
56
+ document.documentElement.setAttribute("lang", lng);
57
+ }
58
+ };
59
+ i18n.on("languageChanged", handler);
60
+ return () => {
61
+ i18n.off("languageChanged", handler);
62
+ };
63
+ }, [i18n]);
64
+
65
+ if (AppConfig.enableWebVitals) {
66
+ onCLS(console.log);
67
+ onINP(console.log);
68
+ onLCP(console.log);
69
+ }
70
+
71
+ return (
72
+ <>
73
+ <GoogleAnalytics />
74
+ <AppErrorBoundary>
75
+ <Providers
76
+ providers={[
77
+ // { provider: ThemeContext.ThemeContextProvider }, // Uncomment for dark theme support
78
+ { provider: UIRouter.UIRouterProvider, props: { push, replace, searchString } },
79
+ { provider: OpenApiRouter.Provider, props: { replace } },
80
+ {
81
+ provider: UIConfig.Provider,
82
+ props: {
83
+ config: {
84
+ input: {
85
+ size: "small",
86
+ },
87
+ tableCellText: {
88
+ size: "label-2",
89
+ variant: "default",
90
+ },
91
+ tableHeaderText: {
92
+ size: "label-2",
93
+ variant: "prominent-1",
94
+ },
95
+ tag: {
96
+ textSize: "label-3",
97
+ },
98
+ },
99
+ },
100
+ },
101
+ {
102
+ provider: UIOverrides.Provider,
103
+ props: {
104
+ config: uiOverrides,
105
+ },
106
+ },
107
+ { provider: OpenApiRuntimeProvider },
108
+ { provider: Confirmation.Provider },
109
+ ]}
110
+ >
111
+ <Fonts />
112
+ <DefaultAppHead />
113
+
114
+ <RootLayout />
115
+
116
+ <ToastContainer />
117
+ <TanStackDevtools
118
+ plugins={[
119
+ {
120
+ name: "TanStack Query",
121
+ render: <ReactQueryDevtoolsPanel />,
122
+ defaultOpen: true,
123
+ },
124
+ {
125
+ name: "TanStack Router",
126
+ render: <TanStackRouterDevtoolsPanel />,
127
+ defaultOpen: false,
128
+ },
129
+ ]}
130
+ />
131
+ </Providers>
132
+ </AppErrorBoundary>
133
+ </>
134
+ );
135
+ };
136
+
137
+ function RootLayout() {
138
+ return (
139
+ <main className="font-primary">
140
+ <Outlet />
141
+ </main>
142
+ );
143
+ }
144
+
145
+ export const Route = createRootRoute({
146
+ head: () => ({
147
+ meta: [
148
+ { charSet: "utf8" },
149
+ { name: "viewport", content: "width=device-width, initial-scale=1" },
150
+ { name: "theme-color", content: "#ffffff" },
151
+ { title: "Auth chat" },
152
+ { name: "msapplication-TileColor", content: "#da532c" },
153
+ ],
154
+ links: [
155
+ { rel: "apple-touch-icon", sizes: "180x180", href: "/apple-touch-icon.png" },
156
+ { rel: "icon", type: "image/png", sizes: "96x96", href: "/favicon-96x96.png" },
157
+ { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
158
+ { rel: "shortcut icon", href: "/favicon.ico" },
159
+ { rel: "manifest", href: "/site.webmanifest" },
160
+ ],
161
+ }),
162
+ component: Root,
163
+ notFoundComponent: NotFoundPage,
164
+ });
@@ -0,0 +1,10 @@
1
+ import { ErrorBoundary } from "@sentry/react";
2
+ import type { PropsWithChildren } from "react";
3
+
4
+ import { ErrorFallback, type ErrorFallbackProps } from "@/components/shared/error/ErrorFallback";
5
+
6
+ const Fallback = (props: ErrorFallbackProps) => <ErrorFallback {...props} />;
7
+
8
+ export const AppErrorBoundary = ({ children }: PropsWithChildren) => {
9
+ return <ErrorBoundary fallback={Fallback}>{children}</ErrorBoundary>;
10
+ };
@@ -0,0 +1,31 @@
1
+ import { ErrorHandler, OpenApiQueryConfig } from "@povio/openapi-codegen-cli";
2
+ import { useToast } from "@povio/ui";
3
+ import type { PropsWithChildren } from "react";
4
+ import { useCallback } from "react";
5
+ import { useTranslation } from "react-i18next";
6
+
7
+ export function OpenApiRuntimeProvider({ children }: PropsWithChildren) {
8
+ const { t } = useTranslation();
9
+ const { errorToast } = useToast();
10
+
11
+ const handleError = useCallback(
12
+ (error: unknown) => {
13
+ console.error(error);
14
+ errorToast({
15
+ text: t(($) => $.shared.apiErrors.requestFailed, {
16
+ error: ErrorHandler.getErrorMessage(error) ?? t(($) => $.shared.apiErrors.unknown),
17
+ }),
18
+ });
19
+ },
20
+ [errorToast, t],
21
+ );
22
+
23
+ return (
24
+ <OpenApiQueryConfig.Provider
25
+ allowInvalidResponseData={import.meta.env.DEV}
26
+ onError={handleError}
27
+ >
28
+ {children}
29
+ </OpenApiQueryConfig.Provider>
30
+ );
31
+ }
@@ -0,0 +1,44 @@
1
+ import type { ComponentProps, JSX, ReactNode } from "react";
2
+
3
+ type HasRequiredProperty<T> = {
4
+ [K in keyof T]-?: Record<string, never> extends Pick<T, K> ? never : K;
5
+ }[keyof T];
6
+
7
+ interface ProviderBase<T> {
8
+ provider: T;
9
+ }
10
+
11
+ interface ProviderProps<T extends keyof JSX.IntrinsicElements> {
12
+ props: Omit<ComponentProps<T>, "children">;
13
+ }
14
+
15
+ // oxlint-disable-next-line no-explicit-any
16
+ type ProvidersArray<T extends any[]> = [
17
+ ...{
18
+ [K in keyof T]: HasRequiredProperty<Omit<ComponentProps<T[K]>, "children">> extends never
19
+ ? ProviderBase<T[K]> & Partial<ProviderProps<T[K]>>
20
+ : ProviderBase<T[K]> & ProviderProps<T[K]>;
21
+ },
22
+ ];
23
+
24
+ // oxlint-disable-next-line no-explicit-any
25
+ interface Props<T extends any[]> {
26
+ providers: ProvidersArray<T>;
27
+ children: ReactNode;
28
+ }
29
+
30
+ // oxlint-disable-next-line no-explicit-any
31
+ function Providers<T extends any[]>({ providers, children }: Props<T>) {
32
+ return (
33
+ <>
34
+ {providers.reduceRight(
35
+ (child, { provider: Provider, props }) => (
36
+ <Provider {...props}>{child}</Provider>
37
+ ),
38
+ children,
39
+ )}
40
+ </>
41
+ );
42
+ }
43
+
44
+ export default Providers;
@@ -0,0 +1,95 @@
1
+ import { AuthContext } from "@povio/openapi-codegen-cli";
2
+ import { useQueryClient } from "@tanstack/react-query";
3
+ import { type PropsWithChildren, useCallback, useEffect, useMemo, useRef, useSyncExternalStore } from "react";
4
+
5
+ import { authTokenStore } from "@/clients/auth-token-store";
6
+ import { LoadingState } from "@/components/shared/layout/LoadingState";
7
+ import { UserApi } from "@/openapi/user/user.api";
8
+ import type { UserModels } from "@/openapi/user/user.models";
9
+ import { UserQueries } from "@/openapi/user/user.queries";
10
+
11
+ const routes: AuthContext.Routes = {
12
+ authenticated: "/",
13
+ unauthenticated: "/login",
14
+ };
15
+
16
+ export const JWTProvider = ({ children }: PropsWithChildren) => {
17
+ const queryClient = useQueryClient();
18
+
19
+ const previousAccessToken = useRef<string | null>(null);
20
+ const accessToken = useSyncExternalStore(
21
+ authTokenStore.subscribe,
22
+ authTokenStore.getAccessToken,
23
+ authTokenStore.getServerSnapshot,
24
+ );
25
+
26
+ const authenticated = !!accessToken;
27
+ const isInitializing = false;
28
+
29
+ const { data: user } = UserQueries.useGet({
30
+ enabled: authenticated,
31
+ staleTime: 10 * 60 * 1000,
32
+ });
33
+
34
+ const onAccessTokenChange = useCallback((token: string | null) => {
35
+ authTokenStore.setAccessToken(token);
36
+ }, []);
37
+
38
+ const onRefreshTokenChange = useCallback((token: string | null) => {
39
+ authTokenStore.setRefreshToken(token);
40
+ }, []);
41
+
42
+ const logout = useCallback(() => {
43
+ authTokenStore.clear();
44
+ queryClient.clear();
45
+ }, [queryClient]);
46
+
47
+ useEffect(() => {
48
+ if (previousAccessToken.current && !accessToken) {
49
+ queryClient.clear();
50
+ }
51
+
52
+ previousAccessToken.current = accessToken;
53
+ }, [accessToken, queryClient]);
54
+
55
+ const userPromise = useCallback(async () => {
56
+ try {
57
+ const user = await UserApi.get();
58
+ queryClient.setQueryData<UserModels.UserMeResponse>(UserQueries.keys.get(), user);
59
+ return user;
60
+ } catch {
61
+ logout();
62
+ return null;
63
+ }
64
+ }, [logout, queryClient]);
65
+
66
+ const updateTokens = useCallback(
67
+ (accessToken: string | null, refreshToken?: string | null) => {
68
+ if (accessToken !== null) {
69
+ onAccessTokenChange(accessToken);
70
+ }
71
+ if (refreshToken !== null && refreshToken !== undefined) {
72
+ onRefreshTokenChange(refreshToken);
73
+ }
74
+ },
75
+ [onAccessTokenChange, onRefreshTokenChange],
76
+ );
77
+
78
+ const loadingState = useMemo(() => <LoadingState />, []);
79
+
80
+ return (
81
+ <AuthContext.Provider
82
+ isAuthenticated={authenticated}
83
+ isInitializing={isInitializing}
84
+ logout={logout}
85
+ updateTokens={updateTokens}
86
+ accessToken={accessToken}
87
+ user={user}
88
+ userPromise={userPromise}
89
+ routes={routes}
90
+ loadingState={loadingState}
91
+ >
92
+ {children}
93
+ </AuthContext.Provider>
94
+ );
95
+ };