create-blitzpack 0.1.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 (259) hide show
  1. package/dist/index.js +452 -0
  2. package/package.json +57 -0
  3. package/template/.dockerignore +59 -0
  4. package/template/.github/workflows/ci.yml +157 -0
  5. package/template/.husky/pre-commit +1 -0
  6. package/template/.husky/pre-push +1 -0
  7. package/template/.lintstagedrc.cjs +4 -0
  8. package/template/.nvmrc +1 -0
  9. package/template/.prettierrc +9 -0
  10. package/template/.vscode/settings.json +13 -0
  11. package/template/CLAUDE.md +175 -0
  12. package/template/CONTRIBUTING.md +32 -0
  13. package/template/Dockerfile +90 -0
  14. package/template/GETTING_STARTED.md +35 -0
  15. package/template/LICENSE +21 -0
  16. package/template/README.md +116 -0
  17. package/template/apps/api/.dockerignore +51 -0
  18. package/template/apps/api/.env.local.example +62 -0
  19. package/template/apps/api/emails/account-deleted-email.tsx +69 -0
  20. package/template/apps/api/emails/components/email-layout.tsx +154 -0
  21. package/template/apps/api/emails/config.ts +22 -0
  22. package/template/apps/api/emails/password-changed-email.tsx +88 -0
  23. package/template/apps/api/emails/password-reset-email.tsx +86 -0
  24. package/template/apps/api/emails/verification-email.tsx +85 -0
  25. package/template/apps/api/emails/welcome-email.tsx +70 -0
  26. package/template/apps/api/package.json +84 -0
  27. package/template/apps/api/prisma/migrations/20251012111439_init/migration.sql +13 -0
  28. package/template/apps/api/prisma/migrations/20251018162629_add_better_auth_fields/migration.sql +67 -0
  29. package/template/apps/api/prisma/migrations/20251019142208_add_user_role_enum/migration.sql +5 -0
  30. package/template/apps/api/prisma/migrations/20251019182151_user_auth/migration.sql +7 -0
  31. package/template/apps/api/prisma/migrations/20251019211416_faster_session_lookup/migration.sql +2 -0
  32. package/template/apps/api/prisma/migrations/20251119124337_add_upload_model/migration.sql +26 -0
  33. package/template/apps/api/prisma/migrations/20251120071241_add_scope_to_account/migration.sql +2 -0
  34. package/template/apps/api/prisma/migrations/20251120072608_add_oauth_token_expiration_fields/migration.sql +10 -0
  35. package/template/apps/api/prisma/migrations/20251120144705_add_audit_logs/migration.sql +29 -0
  36. package/template/apps/api/prisma/migrations/20251127123614_remove_impersonated_by/migration.sql +8 -0
  37. package/template/apps/api/prisma/migrations/20251127125630_remove_audit_logs/migration.sql +11 -0
  38. package/template/apps/api/prisma/migrations/migration_lock.toml +3 -0
  39. package/template/apps/api/prisma/schema.prisma +116 -0
  40. package/template/apps/api/prisma/seed.ts +159 -0
  41. package/template/apps/api/prisma.config.ts +14 -0
  42. package/template/apps/api/src/app.ts +377 -0
  43. package/template/apps/api/src/common/logger.service.ts +227 -0
  44. package/template/apps/api/src/config/env.ts +60 -0
  45. package/template/apps/api/src/config/rate-limit.ts +29 -0
  46. package/template/apps/api/src/hooks/auth.ts +122 -0
  47. package/template/apps/api/src/plugins/auth.ts +198 -0
  48. package/template/apps/api/src/plugins/database.ts +45 -0
  49. package/template/apps/api/src/plugins/logger.ts +33 -0
  50. package/template/apps/api/src/plugins/multipart.ts +16 -0
  51. package/template/apps/api/src/plugins/scalar.ts +20 -0
  52. package/template/apps/api/src/plugins/schedule.ts +52 -0
  53. package/template/apps/api/src/plugins/services.ts +66 -0
  54. package/template/apps/api/src/plugins/swagger.ts +56 -0
  55. package/template/apps/api/src/routes/accounts.ts +91 -0
  56. package/template/apps/api/src/routes/admin-sessions.ts +92 -0
  57. package/template/apps/api/src/routes/metrics.ts +71 -0
  58. package/template/apps/api/src/routes/password.ts +46 -0
  59. package/template/apps/api/src/routes/sessions.ts +53 -0
  60. package/template/apps/api/src/routes/stats.ts +38 -0
  61. package/template/apps/api/src/routes/uploads-serve.ts +27 -0
  62. package/template/apps/api/src/routes/uploads.ts +154 -0
  63. package/template/apps/api/src/routes/users.ts +114 -0
  64. package/template/apps/api/src/routes/verification.ts +90 -0
  65. package/template/apps/api/src/server.ts +34 -0
  66. package/template/apps/api/src/services/accounts.service.ts +125 -0
  67. package/template/apps/api/src/services/authorization.service.ts +162 -0
  68. package/template/apps/api/src/services/email.service.ts +170 -0
  69. package/template/apps/api/src/services/file-storage.service.ts +267 -0
  70. package/template/apps/api/src/services/metrics.service.ts +175 -0
  71. package/template/apps/api/src/services/password.service.ts +56 -0
  72. package/template/apps/api/src/services/sessions.service.spec.ts +134 -0
  73. package/template/apps/api/src/services/sessions.service.ts +276 -0
  74. package/template/apps/api/src/services/stats.service.ts +273 -0
  75. package/template/apps/api/src/services/uploads.service.ts +163 -0
  76. package/template/apps/api/src/services/users.service.spec.ts +249 -0
  77. package/template/apps/api/src/services/users.service.ts +198 -0
  78. package/template/apps/api/src/utils/file-validation.ts +108 -0
  79. package/template/apps/api/start.sh +33 -0
  80. package/template/apps/api/test/helpers/fastify-app.ts +24 -0
  81. package/template/apps/api/test/helpers/mock-authorization.ts +16 -0
  82. package/template/apps/api/test/helpers/mock-logger.ts +28 -0
  83. package/template/apps/api/test/helpers/mock-prisma.ts +30 -0
  84. package/template/apps/api/test/helpers/test-db.ts +125 -0
  85. package/template/apps/api/test/integration/auth-flow.integration.spec.ts +449 -0
  86. package/template/apps/api/test/integration/password.integration.spec.ts +427 -0
  87. package/template/apps/api/test/integration/rate-limit.integration.spec.ts +51 -0
  88. package/template/apps/api/test/integration/sessions.integration.spec.ts +445 -0
  89. package/template/apps/api/test/integration/users.integration.spec.ts +211 -0
  90. package/template/apps/api/test/setup.ts +31 -0
  91. package/template/apps/api/tsconfig.json +26 -0
  92. package/template/apps/api/vitest.config.ts +35 -0
  93. package/template/apps/web/.env.local.example +11 -0
  94. package/template/apps/web/components.json +24 -0
  95. package/template/apps/web/next.config.ts +22 -0
  96. package/template/apps/web/package.json +56 -0
  97. package/template/apps/web/postcss.config.js +5 -0
  98. package/template/apps/web/public/apple-icon.png +0 -0
  99. package/template/apps/web/public/icon.png +0 -0
  100. package/template/apps/web/public/robots.txt +3 -0
  101. package/template/apps/web/src/app/(admin)/admin/layout.tsx +222 -0
  102. package/template/apps/web/src/app/(admin)/admin/page.tsx +157 -0
  103. package/template/apps/web/src/app/(admin)/admin/sessions/page.tsx +18 -0
  104. package/template/apps/web/src/app/(admin)/admin/users/page.tsx +20 -0
  105. package/template/apps/web/src/app/(auth)/forgot-password/page.tsx +177 -0
  106. package/template/apps/web/src/app/(auth)/login/page.tsx +159 -0
  107. package/template/apps/web/src/app/(auth)/reset-password/page.tsx +245 -0
  108. package/template/apps/web/src/app/(auth)/signup/page.tsx +153 -0
  109. package/template/apps/web/src/app/dashboard/change-password/page.tsx +255 -0
  110. package/template/apps/web/src/app/dashboard/page.tsx +296 -0
  111. package/template/apps/web/src/app/error.tsx +32 -0
  112. package/template/apps/web/src/app/examples/file-upload/page.tsx +200 -0
  113. package/template/apps/web/src/app/favicon.ico +0 -0
  114. package/template/apps/web/src/app/global-error.tsx +96 -0
  115. package/template/apps/web/src/app/globals.css +22 -0
  116. package/template/apps/web/src/app/icon.png +0 -0
  117. package/template/apps/web/src/app/layout.tsx +34 -0
  118. package/template/apps/web/src/app/not-found.tsx +28 -0
  119. package/template/apps/web/src/app/page.tsx +192 -0
  120. package/template/apps/web/src/components/admin/activity-feed.tsx +101 -0
  121. package/template/apps/web/src/components/admin/charts/auth-breakdown-chart.tsx +114 -0
  122. package/template/apps/web/src/components/admin/charts/chart-tooltip.tsx +124 -0
  123. package/template/apps/web/src/components/admin/charts/realtime-metrics-chart.tsx +511 -0
  124. package/template/apps/web/src/components/admin/charts/role-distribution-chart.tsx +102 -0
  125. package/template/apps/web/src/components/admin/charts/session-activity-chart.tsx +90 -0
  126. package/template/apps/web/src/components/admin/charts/user-growth-chart.tsx +108 -0
  127. package/template/apps/web/src/components/admin/health-indicator.tsx +175 -0
  128. package/template/apps/web/src/components/admin/refresh-control.tsx +90 -0
  129. package/template/apps/web/src/components/admin/session-revoke-all-dialog.tsx +79 -0
  130. package/template/apps/web/src/components/admin/session-revoke-dialog.tsx +74 -0
  131. package/template/apps/web/src/components/admin/sessions-management-table.tsx +372 -0
  132. package/template/apps/web/src/components/admin/stat-card.tsx +137 -0
  133. package/template/apps/web/src/components/admin/user-create-dialog.tsx +152 -0
  134. package/template/apps/web/src/components/admin/user-delete-dialog.tsx +73 -0
  135. package/template/apps/web/src/components/admin/user-edit-dialog.tsx +170 -0
  136. package/template/apps/web/src/components/admin/users-management-table.tsx +285 -0
  137. package/template/apps/web/src/components/auth/email-verification-banner.tsx +85 -0
  138. package/template/apps/web/src/components/auth/github-button.tsx +40 -0
  139. package/template/apps/web/src/components/auth/google-button.tsx +54 -0
  140. package/template/apps/web/src/components/auth/protected-route.tsx +66 -0
  141. package/template/apps/web/src/components/auth/redirect-if-authenticated.tsx +31 -0
  142. package/template/apps/web/src/components/auth/with-auth.tsx +30 -0
  143. package/template/apps/web/src/components/error/error-card.tsx +47 -0
  144. package/template/apps/web/src/components/error/forbidden.tsx +25 -0
  145. package/template/apps/web/src/components/landing/command-block.tsx +64 -0
  146. package/template/apps/web/src/components/landing/feature-card.tsx +60 -0
  147. package/template/apps/web/src/components/landing/included-feature-card.tsx +63 -0
  148. package/template/apps/web/src/components/landing/logo.tsx +41 -0
  149. package/template/apps/web/src/components/landing/tech-badge.tsx +11 -0
  150. package/template/apps/web/src/components/layout/auth-nav.tsx +58 -0
  151. package/template/apps/web/src/components/layout/footer.tsx +3 -0
  152. package/template/apps/web/src/config/landing-data.ts +152 -0
  153. package/template/apps/web/src/config/site.ts +5 -0
  154. package/template/apps/web/src/hooks/api/__tests__/use-users.test.tsx +181 -0
  155. package/template/apps/web/src/hooks/api/use-admin-sessions.ts +75 -0
  156. package/template/apps/web/src/hooks/api/use-admin-stats.ts +33 -0
  157. package/template/apps/web/src/hooks/api/use-sessions.ts +52 -0
  158. package/template/apps/web/src/hooks/api/use-uploads.ts +156 -0
  159. package/template/apps/web/src/hooks/api/use-users.ts +149 -0
  160. package/template/apps/web/src/hooks/use-mobile.ts +21 -0
  161. package/template/apps/web/src/hooks/use-realtime-metrics.ts +120 -0
  162. package/template/apps/web/src/lib/__tests__/utils.test.ts +29 -0
  163. package/template/apps/web/src/lib/api.ts +151 -0
  164. package/template/apps/web/src/lib/auth.ts +13 -0
  165. package/template/apps/web/src/lib/env.ts +52 -0
  166. package/template/apps/web/src/lib/form-utils.ts +11 -0
  167. package/template/apps/web/src/lib/utils.ts +1 -0
  168. package/template/apps/web/src/providers.tsx +34 -0
  169. package/template/apps/web/src/store/atoms.ts +15 -0
  170. package/template/apps/web/src/test/helpers/test-utils.tsx +44 -0
  171. package/template/apps/web/src/test/setup.ts +8 -0
  172. package/template/apps/web/tailwind.config.ts +5 -0
  173. package/template/apps/web/tsconfig.json +26 -0
  174. package/template/apps/web/vitest.config.ts +32 -0
  175. package/template/assets/logo-512.png +0 -0
  176. package/template/assets/logo.svg +4 -0
  177. package/template/docker-compose.prod.yml +66 -0
  178. package/template/docker-compose.yml +36 -0
  179. package/template/eslint.config.ts +119 -0
  180. package/template/package.json +77 -0
  181. package/template/packages/tailwind-config/package.json +9 -0
  182. package/template/packages/tailwind-config/theme.css +179 -0
  183. package/template/packages/types/package.json +29 -0
  184. package/template/packages/types/src/__tests__/schemas.test.ts +255 -0
  185. package/template/packages/types/src/api-response.ts +53 -0
  186. package/template/packages/types/src/health-check.ts +11 -0
  187. package/template/packages/types/src/pagination.ts +41 -0
  188. package/template/packages/types/src/role.ts +5 -0
  189. package/template/packages/types/src/session.ts +48 -0
  190. package/template/packages/types/src/stats.ts +113 -0
  191. package/template/packages/types/src/upload.ts +51 -0
  192. package/template/packages/types/src/user.ts +36 -0
  193. package/template/packages/types/tsconfig.json +5 -0
  194. package/template/packages/types/vitest.config.ts +21 -0
  195. package/template/packages/ui/components.json +21 -0
  196. package/template/packages/ui/package.json +108 -0
  197. package/template/packages/ui/src/__tests__/button.test.tsx +70 -0
  198. package/template/packages/ui/src/alert-dialog.tsx +141 -0
  199. package/template/packages/ui/src/alert.tsx +66 -0
  200. package/template/packages/ui/src/animated-theme-toggler.tsx +167 -0
  201. package/template/packages/ui/src/avatar.tsx +53 -0
  202. package/template/packages/ui/src/badge.tsx +36 -0
  203. package/template/packages/ui/src/button.tsx +84 -0
  204. package/template/packages/ui/src/card.tsx +92 -0
  205. package/template/packages/ui/src/checkbox.tsx +32 -0
  206. package/template/packages/ui/src/data-table/data-table-column-header.tsx +68 -0
  207. package/template/packages/ui/src/data-table/data-table-pagination.tsx +99 -0
  208. package/template/packages/ui/src/data-table/data-table-toolbar.tsx +55 -0
  209. package/template/packages/ui/src/data-table/data-table-view-options.tsx +63 -0
  210. package/template/packages/ui/src/data-table/data-table.tsx +167 -0
  211. package/template/packages/ui/src/dialog.tsx +143 -0
  212. package/template/packages/ui/src/dropdown-menu.tsx +257 -0
  213. package/template/packages/ui/src/empty-state.tsx +52 -0
  214. package/template/packages/ui/src/file-upload-input.tsx +202 -0
  215. package/template/packages/ui/src/form.tsx +168 -0
  216. package/template/packages/ui/src/hooks/use-mobile.ts +19 -0
  217. package/template/packages/ui/src/icons/brand-icons.tsx +16 -0
  218. package/template/packages/ui/src/input.tsx +21 -0
  219. package/template/packages/ui/src/label.tsx +24 -0
  220. package/template/packages/ui/src/lib/utils.ts +6 -0
  221. package/template/packages/ui/src/password-input.tsx +102 -0
  222. package/template/packages/ui/src/popover.tsx +48 -0
  223. package/template/packages/ui/src/radio-group.tsx +45 -0
  224. package/template/packages/ui/src/scroll-area.tsx +58 -0
  225. package/template/packages/ui/src/select.tsx +187 -0
  226. package/template/packages/ui/src/separator.tsx +28 -0
  227. package/template/packages/ui/src/sheet.tsx +139 -0
  228. package/template/packages/ui/src/sidebar.tsx +726 -0
  229. package/template/packages/ui/src/skeleton-variants.tsx +87 -0
  230. package/template/packages/ui/src/skeleton.tsx +13 -0
  231. package/template/packages/ui/src/slider.tsx +63 -0
  232. package/template/packages/ui/src/sonner.tsx +25 -0
  233. package/template/packages/ui/src/spinner.tsx +16 -0
  234. package/template/packages/ui/src/switch.tsx +31 -0
  235. package/template/packages/ui/src/table.tsx +116 -0
  236. package/template/packages/ui/src/tabs.tsx +66 -0
  237. package/template/packages/ui/src/textarea.tsx +18 -0
  238. package/template/packages/ui/src/tooltip.tsx +61 -0
  239. package/template/packages/ui/src/user-avatar.tsx +97 -0
  240. package/template/packages/ui/test-config.js +3 -0
  241. package/template/packages/ui/tsconfig.json +12 -0
  242. package/template/packages/ui/turbo.json +18 -0
  243. package/template/packages/ui/vitest.config.ts +17 -0
  244. package/template/packages/ui/vitest.setup.ts +1 -0
  245. package/template/packages/utils/package.json +23 -0
  246. package/template/packages/utils/src/__tests__/utils.test.ts +223 -0
  247. package/template/packages/utils/src/array.ts +18 -0
  248. package/template/packages/utils/src/async.ts +3 -0
  249. package/template/packages/utils/src/date.ts +77 -0
  250. package/template/packages/utils/src/errors.ts +73 -0
  251. package/template/packages/utils/src/number.ts +11 -0
  252. package/template/packages/utils/src/string.ts +13 -0
  253. package/template/packages/utils/tsconfig.json +5 -0
  254. package/template/packages/utils/vitest.config.ts +21 -0
  255. package/template/pnpm-workspace.yaml +4 -0
  256. package/template/tsconfig.base.json +32 -0
  257. package/template/turbo.json +133 -0
  258. package/template/vitest.shared.ts +26 -0
  259. package/template/vitest.workspace.ts +9 -0
@@ -0,0 +1,32 @@
1
+ import react from '@vitejs/plugin-react';
2
+ import path from 'path';
3
+ import { defineConfig, mergeConfig } from 'vitest/config';
4
+
5
+ import { sharedConfig } from '../../vitest.shared';
6
+
7
+ export default mergeConfig(
8
+ sharedConfig,
9
+ defineConfig({
10
+ plugins: [react()],
11
+ test: {
12
+ name: '@repo/web',
13
+ include: ['src/**/*.{test,spec}.{ts,tsx}'],
14
+ environment: 'jsdom',
15
+ setupFiles: ['./src/test/setup.ts'],
16
+ globals: true,
17
+ coverage: {
18
+ thresholds: {
19
+ lines: 70,
20
+ functions: 70,
21
+ branches: 65,
22
+ statements: 70,
23
+ },
24
+ },
25
+ },
26
+ resolve: {
27
+ alias: {
28
+ '@': path.resolve(__dirname, './src'),
29
+ },
30
+ },
31
+ })
32
+ );
Binary file
@@ -0,0 +1,4 @@
1
+ <svg width="348" height="225" viewBox="0 0 348 225" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M132.096 224.64V216.576C143.872 216.576 151.296 215.04 154.368 211.968L132.864 153.216H59.136L39.168 209.664C41.728 214.272 49.664 216.576 62.976 216.576V224.64H0V216.576C14.08 216.576 22.144 213.888 24.192 208.512L98.688 0H129.792L205.056 208.512C206.848 213.888 215.04 216.576 229.632 216.576V224.64H132.096ZM95.616 51.072L63.744 140.544H128.256L95.616 51.072Z" fill="#252525"/>
3
+ <path d="M187.81 80.64H219.76V208.59H235.81C240.26 208.59 244.035 207.015 247.135 203.865C250.285 200.715 251.86 196.99 251.86 192.69V80.64H283.81V208.59H299.86C304.21 208.59 307.935 207.015 311.035 203.865C314.185 200.715 315.76 196.99 315.76 192.69V80.64H347.86V169.965C347.86 184.865 342.485 197.715 331.735 208.515C321.035 219.265 308.185 224.64 293.185 224.64H251.86V219.54C245.71 222.94 238.135 224.64 229.135 224.64H187.81V80.64Z" fill="#5A5A5A"/>
4
+ </svg>
@@ -0,0 +1,66 @@
1
+ # Docker Compose for local production testing
2
+ # Test your production Docker build locally before deploying to Railway
3
+ #
4
+ # Usage:
5
+ # docker-compose -f docker-compose.prod.yml up --build
6
+ # docker-compose -f docker-compose.prod.yml down
7
+ # docker-compose -f docker-compose.prod.yml down -v # Remove volumes
8
+ #
9
+ # All values have sensible defaults. Override with environment variables:
10
+ # POSTGRES_PASSWORD=secret COOKIE_SECRET=xxx docker-compose -f docker-compose.prod.yml up
11
+
12
+ services:
13
+ postgres:
14
+ image: postgres:17-alpine
15
+ restart: unless-stopped
16
+ environment:
17
+ POSTGRES_USER: ${POSTGRES_USER:-postgres}
18
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres_prod_password}
19
+ POSTGRES_DB: ${POSTGRES_DB:-app_prod}
20
+ ports:
21
+ - '${POSTGRES_PORT:-5433}:5432'
22
+ volumes:
23
+ - postgres_prod_data:/var/lib/postgresql/data
24
+ healthcheck:
25
+ test:
26
+ [
27
+ 'CMD-SHELL',
28
+ 'pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-app_prod}',
29
+ ]
30
+ interval: 10s
31
+ timeout: 5s
32
+ retries: 5
33
+
34
+ api:
35
+ build:
36
+ context: .
37
+ dockerfile: Dockerfile
38
+ restart: unless-stopped
39
+ ports:
40
+ - '${API_PORT:-8080}:8080'
41
+ environment:
42
+ NODE_ENV: ${NODE_ENV:-production}
43
+ DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres_prod_password}@postgres:5432/${POSTGRES_DB:-app_prod}
44
+ API_URL: ${API_URL:-http://localhost:8080}
45
+ FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3000}
46
+ PORT: 8080
47
+ LOG_LEVEL: ${LOG_LEVEL:-normal}
48
+ COOKIE_SECRET: ${COOKIE_SECRET:-your-secret-key-change-in-production}
49
+ depends_on:
50
+ postgres:
51
+ condition: service_healthy
52
+ healthcheck:
53
+ test:
54
+ [
55
+ 'CMD',
56
+ 'node',
57
+ '-e',
58
+ "require('http').get('http://localhost:8080/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})",
59
+ ]
60
+ interval: 30s
61
+ timeout: 3s
62
+ start_period: 40s
63
+ retries: 3
64
+
65
+ volumes:
66
+ postgres_prod_data:
@@ -0,0 +1,36 @@
1
+ services:
2
+ postgres:
3
+ image: postgres:17-alpine
4
+ restart: unless-stopped
5
+ environment:
6
+ POSTGRES_USER: postgres
7
+ POSTGRES_PASSWORD: postgres_dev_password
8
+ POSTGRES_DB: app_dev
9
+ ports:
10
+ - '5432:5432'
11
+ volumes:
12
+ - postgres_data:/var/lib/postgresql/data
13
+ healthcheck:
14
+ test: ['CMD-SHELL', 'pg_isready -U postgres -d app_dev']
15
+ interval: 10s
16
+ timeout: 5s
17
+ retries: 5
18
+
19
+ pgadmin:
20
+ image: dpage/pgadmin4:latest
21
+ restart: unless-stopped
22
+ profiles: ['tools']
23
+ environment:
24
+ PGADMIN_DEFAULT_EMAIL: admin@example.com
25
+ PGADMIN_DEFAULT_PASSWORD: admin123
26
+ PGADMIN_CONFIG_SERVER_MODE: 'False'
27
+ ports:
28
+ - '5050:80'
29
+ volumes:
30
+ - pgadmin_data:/var/lib/pgadmin
31
+ depends_on:
32
+ - postgres
33
+
34
+ volumes:
35
+ postgres_data:
36
+ pgadmin_data:
@@ -0,0 +1,119 @@
1
+ import eslint from '@eslint/js';
2
+ import nextPlugin from '@next/eslint-plugin-next';
3
+ import tseslint from '@typescript-eslint/eslint-plugin';
4
+ import tsparser from '@typescript-eslint/parser';
5
+ import type { Linter } from 'eslint';
6
+ import prettier from 'eslint-config-prettier';
7
+ import jsxA11y from 'eslint-plugin-jsx-a11y';
8
+ import react from 'eslint-plugin-react';
9
+ import reactHooks from 'eslint-plugin-react-hooks';
10
+ import simpleImportSort from 'eslint-plugin-simple-import-sort';
11
+ import unicorn from 'eslint-plugin-unicorn';
12
+ import unusedImports from 'eslint-plugin-unused-imports';
13
+ import globals from 'globals';
14
+
15
+ export default [
16
+ {
17
+ ignores: [
18
+ '**/dist/**',
19
+ '**/build/**',
20
+ '**/.next/**',
21
+ '**/node_modules/**',
22
+ '**/.turbo/**',
23
+ '**/coverage/**',
24
+ '**/next-env.d.ts',
25
+ ],
26
+ },
27
+ eslint.configs.recommended,
28
+ {
29
+ files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
30
+ languageOptions: {
31
+ parser: tsparser,
32
+ parserOptions: {
33
+ ecmaVersion: 2022,
34
+ sourceType: 'module',
35
+ ecmaFeatures: {
36
+ jsx: true,
37
+ },
38
+ },
39
+ globals: {
40
+ ...globals.node,
41
+ ...globals.browser,
42
+ ...globals.es2021,
43
+ },
44
+ },
45
+ plugins: {
46
+ '@typescript-eslint': tseslint,
47
+ '@next/next': nextPlugin,
48
+ react,
49
+ 'react-hooks': reactHooks,
50
+ 'jsx-a11y': jsxA11y,
51
+ 'unused-imports': unusedImports,
52
+ 'simple-import-sort': simpleImportSort,
53
+ unicorn,
54
+ },
55
+ settings: {
56
+ react: {
57
+ version: 'detect',
58
+ },
59
+ },
60
+ rules: {
61
+ ...tseslint.configs.recommended.rules,
62
+ ...react.configs.recommended.rules,
63
+ ...react.configs['jsx-runtime'].rules,
64
+ 'react/prop-types': 'off',
65
+ 'react/react-in-jsx-scope': 'off',
66
+ 'react/display-name': 'warn',
67
+ 'react/no-unescaped-entities': 'off',
68
+
69
+ ...nextPlugin.configs.recommended.rules,
70
+ ...nextPlugin.configs['core-web-vitals'].rules,
71
+ '@next/next/no-html-link-for-pages': 'off', // Using App Router, not Pages Router
72
+
73
+ ...reactHooks.configs.recommended.rules,
74
+ 'react-hooks/exhaustive-deps': 'warn',
75
+ 'react-hooks/rules-of-hooks': 'error',
76
+
77
+ // Disable strict React Compiler rules
78
+ 'react-hooks/purity': 'off',
79
+ 'react-hooks/set-state-in-effect': 'off',
80
+ 'react-hooks/incompatible-library': 'off',
81
+
82
+ 'jsx-a11y/click-events-have-key-events': 'warn',
83
+ 'jsx-a11y/no-static-element-interactions': 'warn',
84
+ 'jsx-a11y/alt-text': 'warn',
85
+ 'jsx-a11y/anchor-is-valid': 'warn',
86
+
87
+ // TypeScript rule - turn OFF (redundant)
88
+ '@typescript-eslint/no-unused-vars': 'off',
89
+ '@typescript-eslint/no-explicit-any': 'warn',
90
+ '@typescript-eslint/consistent-type-imports': [
91
+ 'error',
92
+ {
93
+ prefer: 'type-imports',
94
+ fixStyle: 'inline-type-imports',
95
+ },
96
+ ],
97
+
98
+ 'unused-imports/no-unused-imports': 'warn',
99
+ 'unused-imports/no-unused-vars': 'off',
100
+
101
+ 'simple-import-sort/imports': 'error',
102
+ 'simple-import-sort/exports': 'error',
103
+
104
+ // tsserver handles this better
105
+ 'no-undef': 'off',
106
+
107
+ 'unicorn/filename-case': [
108
+ 'error',
109
+ {
110
+ cases: { kebabCase: true, camelCase: true, pascalCase: true },
111
+ },
112
+ ],
113
+ 'unicorn/no-null': 'off',
114
+ 'unicorn/prevent-abbreviations': 'off',
115
+ 'unicorn/no-array-reduce': 'off',
116
+ },
117
+ },
118
+ prettier,
119
+ ] satisfies Linter.Config[];
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "blitzpack",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "description": "Production-ready Full Stack TypeScript monorepo with Next.js and Fastify",
7
+ "scripts": {
8
+ "init:project": "node scripts/setup.js",
9
+ "dev": "turbo run dev",
10
+ "dev:tui": "turbo run dev --ui=tui",
11
+ "dev:debug": "turbo run dev --verbose",
12
+ "dev:web": "turbo run dev --filter @repo/web",
13
+ "dev:api": "turbo run dev --filter @repo/api",
14
+ "dev:app": "turbo run dev --filter @repo/web --filter @repo/api",
15
+ "email": "turbo run email:dev",
16
+ "build": "turbo run build",
17
+ "typecheck": "turbo run typecheck",
18
+ "lint": "turbo run lint",
19
+ "lint:fix": "turbo run lint:fix",
20
+ "test": "turbo run test",
21
+ "test:unit": "turbo run test:unit",
22
+ "test:integration": "turbo run test:integration",
23
+ "test:watch": "turbo run test:watch",
24
+ "test:coverage": "turbo run test:coverage",
25
+ "test:parallel": "turbo run test --concurrency=3",
26
+ "graph": "turbo run build --graph=graph.html && open graph.html",
27
+ "analyze": "turbo run build --dry-run=json > build-plan.json",
28
+ "prepare": "husky",
29
+ "db:generate": "pnpm --filter @repo/api db:generate",
30
+ "db:migrate": "pnpm --filter @repo/api db:migrate",
31
+ "db:push": "pnpm --filter @repo/api db:push",
32
+ "db:studio": "pnpm --filter @repo/api db:studio",
33
+ "db:seed": "pnpm --filter @repo/api db:seed"
34
+ },
35
+ "devDependencies": {
36
+ "@next/eslint-plugin-next": "^16.0.3",
37
+ "@testing-library/jest-dom": "^6.9.1",
38
+ "@testing-library/react": "^16.3.0",
39
+ "@testing-library/user-event": "^14.6.1",
40
+ "@types/node": "^22.10.5",
41
+ "@typescript-eslint/eslint-plugin": "^8.20.0",
42
+ "@typescript-eslint/parser": "^8.20.0",
43
+ "@vitest/coverage-v8": "^3.2.4",
44
+ "eslint": "^9.18.0",
45
+ "eslint-config-prettier": "^9.1.2",
46
+ "eslint-plugin-jsx-a11y": "^6.10.2",
47
+ "eslint-plugin-n": "^17.23.1",
48
+ "eslint-plugin-promise": "^7.2.1",
49
+ "eslint-plugin-react": "^7.37.5",
50
+ "eslint-plugin-react-hooks": "^7.0.1",
51
+ "eslint-plugin-simple-import-sort": "^12.1.1",
52
+ "eslint-plugin-unicorn": "^61.0.2",
53
+ "eslint-plugin-unused-imports": "^4.2.0",
54
+ "globals": "^16.5.0",
55
+ "husky": "^9.1.7",
56
+ "jsdom": "^27.0.0",
57
+ "lint-staged": "^15.2.11",
58
+ "prettier": "^3.4.2",
59
+ "prettier-plugin-tailwindcss": "^0.6.14",
60
+ "tsx": "^4.20.0",
61
+ "turbo": "^2.6.1",
62
+ "typescript": "^5.7.2",
63
+ "vitest": "^3.2.4"
64
+ },
65
+ "packageManager": "pnpm@9.15.4",
66
+ "engines": {
67
+ "node": ">=20.0.0",
68
+ "pnpm": ">=9.0.0"
69
+ },
70
+ "pnpm": {
71
+ "overrides": {
72
+ "csstype": "^3.2.3",
73
+ "@types/react": "19.2.6",
74
+ "@types/react-dom": "19.2.3"
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@repo/tailwind-config",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "private": true,
6
+ "exports": {
7
+ "./theme.css": "./theme.css"
8
+ }
9
+ }
@@ -0,0 +1,179 @@
1
+ @custom-variant dark (&:is(.dark *));
2
+
3
+ :root {
4
+ --background: oklch(1 0 0);
5
+ --foreground: oklch(0.145 0 0);
6
+ --card: oklch(1 0 0);
7
+ --card-foreground: oklch(0.145 0 0);
8
+ --popover: oklch(1 0 0);
9
+ --popover-foreground: oklch(0.145 0 0);
10
+ --primary: oklch(0.205 0 0);
11
+ --primary-foreground: oklch(0.985 0 0);
12
+ --secondary: oklch(0.97 0 0);
13
+ --secondary-foreground: oklch(0.205 0 0);
14
+ --muted: oklch(0.97 0 0);
15
+ --muted-foreground: oklch(0.556 0 0);
16
+ --accent: oklch(0.97 0 0);
17
+ --accent-foreground: oklch(0.205 0 0);
18
+ --destructive: oklch(0.577 0.245 27.325);
19
+ --destructive-foreground: oklch(1 0 0);
20
+ --border: oklch(0.922 0 0);
21
+ --input: oklch(0.922 0 0);
22
+ --ring: oklch(0.708 0 0);
23
+ --chart-1: oklch(0.81 0.1 252);
24
+ --chart-2: oklch(0.62 0.19 260);
25
+ --chart-3: oklch(0.55 0.22 263);
26
+ --chart-4: oklch(0.49 0.22 264);
27
+ --chart-5: oklch(0.42 0.18 266);
28
+ --sidebar: oklch(0.985 0 0);
29
+ --sidebar-foreground: oklch(0.145 0 0);
30
+ --sidebar-primary: oklch(0.205 0 0);
31
+ --sidebar-primary-foreground: oklch(0.985 0 0);
32
+ --sidebar-accent: oklch(0.97 0 0);
33
+ --sidebar-accent-foreground: oklch(0.205 0 0);
34
+ --sidebar-border: oklch(0.922 0 0);
35
+ --sidebar-ring: oklch(0.708 0 0);
36
+ --font-sans:
37
+ ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
38
+ Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
39
+ 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
40
+ --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
41
+ --font-mono:
42
+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
43
+ 'Courier New', monospace;
44
+ --radius: 0.625rem;
45
+ --shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
46
+ --shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
47
+ --shadow-sm:
48
+ 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
49
+ --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
50
+ --shadow-md:
51
+ 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
52
+ --shadow-lg:
53
+ 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
54
+ --shadow-xl:
55
+ 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
56
+ --shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
57
+ --spacing: 0.25rem;
58
+ }
59
+
60
+ .dark {
61
+ --background: oklch(0.145 0 0);
62
+ --foreground: oklch(0.985 0 0);
63
+ --card: oklch(0.205 0 0);
64
+ --card-foreground: oklch(0.985 0 0);
65
+ --popover: oklch(0.269 0 0);
66
+ --popover-foreground: oklch(0.985 0 0);
67
+ --primary: oklch(0.922 0 0);
68
+ --primary-foreground: oklch(0.205 0 0);
69
+ --secondary: oklch(0.269 0 0);
70
+ --secondary-foreground: oklch(0.985 0 0);
71
+ --muted: oklch(0.269 0 0);
72
+ --muted-foreground: oklch(0.708 0 0);
73
+ --accent: oklch(0.371 0 0);
74
+ --accent-foreground: oklch(0.985 0 0);
75
+ --destructive: oklch(0.704 0.191 22.216);
76
+ --destructive-foreground: oklch(0.985 0 0);
77
+ --border: oklch(0.275 0 0);
78
+ --input: oklch(0.325 0 0);
79
+ --ring: oklch(0.556 0 0);
80
+ --chart-1: oklch(0.81 0.1 252);
81
+ --chart-2: oklch(0.62 0.19 260);
82
+ --chart-3: oklch(0.55 0.22 263);
83
+ --chart-4: oklch(0.49 0.22 264);
84
+ --chart-5: oklch(0.42 0.18 266);
85
+ --sidebar: oklch(0.205 0 0);
86
+ --sidebar-foreground: oklch(0.985 0 0);
87
+ --sidebar-primary: oklch(0.488 0.243 264.376);
88
+ --sidebar-primary-foreground: oklch(0.985 0 0);
89
+ --sidebar-accent: oklch(0.269 0 0);
90
+ --sidebar-accent-foreground: oklch(0.985 0 0);
91
+ --sidebar-border: oklch(0.275 0 0);
92
+ --sidebar-ring: oklch(0.439 0 0);
93
+ --font-sans:
94
+ ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
95
+ Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
96
+ 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
97
+ --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
98
+ --font-mono:
99
+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
100
+ 'Courier New', monospace;
101
+ --radius: 0.625rem;
102
+ --shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
103
+ --shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
104
+ --shadow-sm:
105
+ 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
106
+ --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
107
+ --shadow-md:
108
+ 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
109
+ --shadow-lg:
110
+ 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
111
+ --shadow-xl:
112
+ 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
113
+ --shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
114
+ }
115
+
116
+ @theme inline {
117
+ --color-background: var(--background);
118
+ --color-foreground: var(--foreground);
119
+ --color-card: var(--card);
120
+ --color-card-foreground: var(--card-foreground);
121
+ --color-popover: var(--popover);
122
+ --color-popover-foreground: var(--popover-foreground);
123
+ --color-primary: var(--primary);
124
+ --color-primary-foreground: var(--primary-foreground);
125
+ --color-secondary: var(--secondary);
126
+ --color-secondary-foreground: var(--secondary-foreground);
127
+ --color-muted: var(--muted);
128
+ --color-muted-foreground: var(--muted-foreground);
129
+ --color-accent: var(--accent);
130
+ --color-accent-foreground: var(--accent-foreground);
131
+ --color-destructive: var(--destructive);
132
+ --color-destructive-foreground: var(--destructive-foreground);
133
+ --color-border: var(--border);
134
+ --color-input: var(--input);
135
+ --color-ring: var(--ring);
136
+ --color-chart-1: var(--chart-1);
137
+ --color-chart-2: var(--chart-2);
138
+ --color-chart-3: var(--chart-3);
139
+ --color-chart-4: var(--chart-4);
140
+ --color-chart-5: var(--chart-5);
141
+ --color-sidebar: var(--sidebar);
142
+ --color-sidebar-foreground: var(--sidebar-foreground);
143
+ --color-sidebar-primary: var(--sidebar-primary);
144
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
145
+ --color-sidebar-accent: var(--sidebar-accent);
146
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
147
+ --color-sidebar-border: var(--sidebar-border);
148
+ --color-sidebar-ring: var(--sidebar-ring);
149
+
150
+ --font-sans: var(--font-sans);
151
+ --font-mono: var(--font-mono);
152
+ --font-serif: var(--font-serif);
153
+
154
+ --radius-sm: calc(var(--radius) - 4px);
155
+ --radius-md: calc(var(--radius) - 2px);
156
+ --radius-lg: var(--radius);
157
+ --radius-xl: calc(var(--radius) + 4px);
158
+
159
+ --shadow-2xs: var(--shadow-2xs);
160
+ --shadow-xs: var(--shadow-xs);
161
+ --shadow-sm: var(--shadow-sm);
162
+ --shadow: var(--shadow);
163
+ --shadow-md: var(--shadow-md);
164
+ --shadow-lg: var(--shadow-lg);
165
+ --shadow-xl: var(--shadow-xl);
166
+ --shadow-2xl: var(--shadow-2xl);
167
+ }
168
+
169
+ @layer base {
170
+ * {
171
+ @apply border-border outline-ring/50;
172
+ }
173
+ html {
174
+ scroll-behavior: smooth;
175
+ }
176
+ body {
177
+ @apply bg-background text-foreground;
178
+ }
179
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@repo/packages-types",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "exports": {
6
+ "./api-response": "./src/api-response.ts",
7
+ "./audit-log": "./src/audit-log.ts",
8
+ "./health-check": "./src/health-check.ts",
9
+ "./pagination": "./src/pagination.ts",
10
+ "./role": "./src/role.ts",
11
+ "./session": "./src/session.ts",
12
+ "./stats": "./src/stats.ts",
13
+ "./upload": "./src/upload.ts",
14
+ "./user": "./src/user.ts"
15
+ },
16
+ "scripts": {
17
+ "typecheck": "tsc --noEmit",
18
+ "lint": "eslint src",
19
+ "lint:fix": "eslint src --fix",
20
+ "test": "vitest run",
21
+ "test:unit": "vitest run",
22
+ "test:integration": "echo 'No integration tests for packages-types'",
23
+ "test:watch": "vitest",
24
+ "test:coverage": "vitest run --coverage"
25
+ },
26
+ "dependencies": {
27
+ "zod": "^4.1.12"
28
+ }
29
+ }