@shivasankaran18/stackd 1.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 (109) hide show
  1. package/.github/workflows/ci.yml +30 -0
  2. package/LICENSE +21 -0
  3. package/README.md +115 -0
  4. package/apps/cli/package.json +32 -0
  5. package/apps/cli/src/cli.ts +271 -0
  6. package/apps/cli/src/commands/create.ts +162 -0
  7. package/apps/cli/src/scripts/Auth/jwt.ts +83 -0
  8. package/apps/cli/src/scripts/Auth/nextAuth.ts +146 -0
  9. package/apps/cli/src/scripts/Auth/passport.ts +234 -0
  10. package/apps/cli/src/scripts/backend/django.ts +30 -0
  11. package/apps/cli/src/scripts/backend/expressjs.ts +72 -0
  12. package/apps/cli/src/scripts/backend/expressts.ts +95 -0
  13. package/apps/cli/src/scripts/frontend/angularjs.ts +0 -0
  14. package/apps/cli/src/scripts/frontend/angularts.ts +29 -0
  15. package/apps/cli/src/scripts/frontend/nextjs.ts +72 -0
  16. package/apps/cli/src/scripts/frontend/reactjs.ts +36 -0
  17. package/apps/cli/src/scripts/frontend/reactts.ts +34 -0
  18. package/apps/cli/src/scripts/frontend/vuejs.ts +43 -0
  19. package/apps/cli/src/scripts/frontend/vuets.ts +53 -0
  20. package/apps/cli/src/scripts/orms/drizzleSetup.ts +102 -0
  21. package/apps/cli/src/scripts/orms/mongoSetup.ts +68 -0
  22. package/apps/cli/src/scripts/orms/prismaSetup.ts +14 -0
  23. package/apps/cli/src/scripts/ui/shadcn.ts +228 -0
  24. package/apps/cli/src/scripts/ui/tailwindcss.ts +126 -0
  25. package/apps/cli/tsconfig.json +111 -0
  26. package/apps/web/app/api/auth/[...nextauth]/route.ts +7 -0
  27. package/apps/web/app/api/scaffold/route.ts +274 -0
  28. package/apps/web/app/favicon.ico +0 -0
  29. package/apps/web/app/fonts/GeistMonoVF.woff +0 -0
  30. package/apps/web/app/fonts/GeistVF.woff +0 -0
  31. package/apps/web/app/globals.css +158 -0
  32. package/apps/web/app/home/page.tsx +22 -0
  33. package/apps/web/app/layout.tsx +35 -0
  34. package/apps/web/app/page.module.css +188 -0
  35. package/apps/web/app/page.tsx +1 -0
  36. package/apps/web/app/providers.tsx +9 -0
  37. package/apps/web/app/scaffold/page.tsx +472 -0
  38. package/apps/web/components/Sidebar.tsx +108 -0
  39. package/apps/web/components/theme-provider.tsx +9 -0
  40. package/apps/web/components/ui/button.tsx +57 -0
  41. package/apps/web/components/ui/card.tsx +76 -0
  42. package/apps/web/components/ui/dropdown-menu.tsx +200 -0
  43. package/apps/web/components/ui/input.tsx +22 -0
  44. package/apps/web/components/ui/label.tsx +26 -0
  45. package/apps/web/components/ui/scroll-area.tsx +48 -0
  46. package/apps/web/components/ui/sonner.tsx +31 -0
  47. package/apps/web/components/ui/steps.tsx +36 -0
  48. package/apps/web/components/ui/switch.tsx +29 -0
  49. package/apps/web/components.json +21 -0
  50. package/apps/web/eslint.config.js +4 -0
  51. package/apps/web/lib/auth.ts +35 -0
  52. package/apps/web/lib/redis.ts +13 -0
  53. package/apps/web/lib/utils.ts +8 -0
  54. package/apps/web/next-env.d.ts +5 -0
  55. package/apps/web/next.config.js +4 -0
  56. package/apps/web/package.json +52 -0
  57. package/apps/web/postcss.config.js +6 -0
  58. package/apps/web/public/file-text.svg +3 -0
  59. package/apps/web/public/globe.svg +10 -0
  60. package/apps/web/public/next.svg +1 -0
  61. package/apps/web/public/turborepo-dark.svg +19 -0
  62. package/apps/web/public/turborepo-light.svg +19 -0
  63. package/apps/web/public/vercel.svg +10 -0
  64. package/apps/web/public/window.svg +3 -0
  65. package/apps/web/tailwind.config.js +65 -0
  66. package/apps/web/tsconfig.json +23 -0
  67. package/apps/web/types/global.d.ts +4 -0
  68. package/docker-compose.yml +14 -0
  69. package/package.json +55 -0
  70. package/packages/eslint-config/README.md +3 -0
  71. package/packages/eslint-config/base.js +32 -0
  72. package/packages/eslint-config/next.js +49 -0
  73. package/packages/eslint-config/package.json +24 -0
  74. package/packages/eslint-config/react-internal.js +39 -0
  75. package/packages/scripts/Auth/jwt.ts +83 -0
  76. package/packages/scripts/Auth/nextAuth.ts +146 -0
  77. package/packages/scripts/Auth/passport.ts +234 -0
  78. package/packages/scripts/backend/django.ts +30 -0
  79. package/packages/scripts/backend/expressjs.ts +72 -0
  80. package/packages/scripts/backend/expressts.ts +95 -0
  81. package/packages/scripts/frontend/angularjs.ts +0 -0
  82. package/packages/scripts/frontend/angularts.ts +29 -0
  83. package/packages/scripts/frontend/nextjs.ts +72 -0
  84. package/packages/scripts/frontend/reactjs.ts +36 -0
  85. package/packages/scripts/frontend/reactts.ts +34 -0
  86. package/packages/scripts/frontend/vuejs.ts +43 -0
  87. package/packages/scripts/frontend/vuets.ts +53 -0
  88. package/packages/scripts/orms/drizzleSetup.ts +102 -0
  89. package/packages/scripts/orms/mongoSetup.ts +68 -0
  90. package/packages/scripts/orms/prismaSetup.ts +14 -0
  91. package/packages/scripts/ui/shadcn.ts +228 -0
  92. package/packages/scripts/ui/tailwindcss.ts +126 -0
  93. package/packages/typescript-config/base.json +19 -0
  94. package/packages/typescript-config/nextjs.json +12 -0
  95. package/packages/typescript-config/package.json +9 -0
  96. package/packages/typescript-config/react-library.json +7 -0
  97. package/packages/ui/eslint.config.mjs +4 -0
  98. package/packages/ui/package.json +27 -0
  99. package/packages/ui/src/button.tsx +20 -0
  100. package/packages/ui/src/card.tsx +27 -0
  101. package/packages/ui/src/code.tsx +11 -0
  102. package/packages/ui/tsconfig.json +8 -0
  103. package/packages/ui/turbo/generators/config.ts +30 -0
  104. package/packages/ui/turbo/generators/templates/component.hbs +8 -0
  105. package/stackd.ts +134 -0
  106. package/start-web.sh +5 -0
  107. package/tsconfig.json +111 -0
  108. package/tsconfig.tsbuildinfo +1 -0
  109. package/turbo.json +21 -0
@@ -0,0 +1,19 @@
1
+ <svg width="473" height="76" viewBox="0 0 473 76" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M130.998 30.6565V22.3773H91.0977V30.6565H106.16V58.1875H115.935V30.6565H130.998Z" fill="black"/>
3
+ <path d="M153.542 58.7362C165.811 58.7362 172.544 52.5018 172.544 42.2275V22.3773H162.768V41.2799C162.768 47.0155 159.776 50.2574 153.542 50.2574C147.307 50.2574 144.315 47.0155 144.315 41.2799V22.3773H134.539V42.2275C134.539 52.5018 141.272 58.7362 153.542 58.7362Z" fill="black"/>
4
+ <path d="M187.508 46.3173H197.234L204.914 58.1875H216.136L207.458 45.2699C212.346 43.5243 215.338 39.634 215.338 34.3473C215.338 26.6665 209.603 22.3773 200.874 22.3773H177.732V58.1875H187.508V46.3173ZM187.508 38.5867V30.5568H200.376C203.817 30.5568 205.712 32.053 205.712 34.5967C205.712 36.9907 203.817 38.5867 200.376 38.5867H187.508Z" fill="black"/>
5
+ <path d="M219.887 58.1875H245.472C253.452 58.1875 258.041 54.397 258.041 48.0629C258.041 43.8235 255.348 40.9308 252.156 39.634C254.35 38.5867 257.043 36.0929 257.043 32.1528C257.043 25.8187 252.555 22.3773 244.625 22.3773H219.887V58.1875ZM229.263 36.3922V30.3074H243.627C246.32 30.3074 247.817 31.3548 247.817 33.3498C247.817 35.3448 246.32 36.3922 243.627 36.3922H229.263ZM229.263 43.7238H244.525C247.168 43.7238 248.615 45.0205 248.615 46.9657C248.615 48.9108 247.168 50.2075 244.525 50.2075H229.263V43.7238Z" fill="black"/>
6
+ <path d="M281.942 21.7788C269.423 21.7788 260.396 29.6092 260.396 40.2824C260.396 50.9557 269.423 58.786 281.942 58.786C294.461 58.786 303.438 50.9557 303.438 40.2824C303.438 29.6092 294.461 21.7788 281.942 21.7788ZM281.942 30.2575C288.525 30.2575 293.463 34.1478 293.463 40.2824C293.463 46.417 288.525 50.3073 281.942 50.3073C275.359 50.3073 270.421 46.417 270.421 40.2824C270.421 34.1478 275.359 30.2575 281.942 30.2575Z" fill="black"/>
7
+ <path d="M317.526 46.3173H327.251L334.932 58.1875H346.154L337.476 45.2699C342.364 43.5243 345.356 39.634 345.356 34.3473C345.356 26.6665 339.62 22.3773 330.892 22.3773H307.75V58.1875H317.526V46.3173ZM317.526 38.5867V30.5568H330.394C333.835 30.5568 335.73 32.053 335.73 34.5967C335.73 36.9907 333.835 38.5867 330.394 38.5867H317.526Z" fill="black"/>
8
+ <path d="M349.904 22.3773V58.1875H384.717V49.9083H359.48V44.0729H381.874V35.9932H359.48V30.6565H384.717V22.3773H349.904Z" fill="black"/>
9
+ <path d="M399.204 46.7662H412.221C420.95 46.7662 426.685 42.5767 426.685 34.5967C426.685 26.5668 420.95 22.3773 412.221 22.3773H389.428V58.1875H399.204V46.7662ZM399.204 38.6365V30.5568H411.673C415.164 30.5568 417.059 32.053 417.059 34.5967C417.059 37.0904 415.164 38.6365 411.673 38.6365H399.204Z" fill="black"/>
10
+ <path d="M450.948 21.7788C438.43 21.7788 429.402 29.6092 429.402 40.2824C429.402 50.9557 438.43 58.786 450.948 58.786C463.467 58.786 472.444 50.9557 472.444 40.2824C472.444 29.6092 463.467 21.7788 450.948 21.7788ZM450.948 30.2575C457.532 30.2575 462.469 34.1478 462.469 40.2824C462.469 46.417 457.532 50.3073 450.948 50.3073C444.365 50.3073 439.427 46.417 439.427 40.2824C439.427 34.1478 444.365 30.2575 450.948 30.2575Z" fill="black"/>
11
+ <path d="M38.5017 18.0956C27.2499 18.0956 18.0957 27.2498 18.0957 38.5016C18.0957 49.7534 27.2499 58.9076 38.5017 58.9076C49.7535 58.9076 58.9077 49.7534 58.9077 38.5016C58.9077 27.2498 49.7535 18.0956 38.5017 18.0956ZM38.5017 49.0618C32.6687 49.0618 27.9415 44.3346 27.9415 38.5016C27.9415 32.6686 32.6687 27.9414 38.5017 27.9414C44.3347 27.9414 49.0619 32.6686 49.0619 38.5016C49.0619 44.3346 44.3347 49.0618 38.5017 49.0618Z" fill="black"/>
12
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M40.2115 14.744V7.125C56.7719 8.0104 69.9275 21.7208 69.9275 38.5016C69.9275 55.2824 56.7719 68.989 40.2115 69.8782V62.2592C52.5539 61.3776 62.3275 51.0644 62.3275 38.5016C62.3275 25.9388 52.5539 15.6256 40.2115 14.744ZM20.5048 54.0815C17.233 50.3043 15.124 45.4935 14.7478 40.2115H7.125C7.5202 47.6025 10.4766 54.3095 15.1088 59.4737L20.501 54.0815H20.5048ZM36.7916 69.8782V62.2592C31.5058 61.883 26.695 59.7778 22.9178 56.5022L17.5256 61.8944C22.6936 66.5304 29.4006 69.483 36.7878 69.8782H36.7916Z" fill="url(#paint0_linear_2028_278)"/>
13
+ <defs>
14
+ <linearGradient id="paint0_linear_2028_278" x1="41.443" y1="11.5372" x2="10.5567" y2="42.4236" gradientUnits="userSpaceOnUse">
15
+ <stop stop-color="#0096FF"/>
16
+ <stop offset="1" stop-color="#FF1E56"/>
17
+ </linearGradient>
18
+ </defs>
19
+ </svg>
@@ -0,0 +1,19 @@
1
+ <svg width="473" height="76" viewBox="0 0 473 76" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M130.998 30.6566V22.3773H91.0977V30.6566H106.16V58.1876H115.935V30.6566H130.998Z" fill="white"/>
3
+ <path d="M153.542 58.7362C165.811 58.7362 172.544 52.5018 172.544 42.2276V22.3773H162.768V41.2799C162.768 47.0156 159.776 50.2574 153.542 50.2574C147.307 50.2574 144.315 47.0156 144.315 41.2799V22.3773H134.539V42.2276C134.539 52.5018 141.272 58.7362 153.542 58.7362Z" fill="white"/>
4
+ <path d="M187.508 46.3173H197.234L204.914 58.1876H216.136L207.458 45.2699C212.346 43.5243 215.338 39.6341 215.338 34.3473C215.338 26.6666 209.603 22.3773 200.874 22.3773H177.732V58.1876H187.508V46.3173ZM187.508 38.5867V30.5568H200.376C203.817 30.5568 205.712 32.0531 205.712 34.5967C205.712 36.9907 203.817 38.5867 200.376 38.5867H187.508Z" fill="white"/>
5
+ <path d="M219.887 58.1876H245.472C253.452 58.1876 258.041 54.3971 258.041 48.0629C258.041 43.8236 255.348 40.9308 252.156 39.6341C254.35 38.5867 257.043 36.0929 257.043 32.1528C257.043 25.8187 252.555 22.3773 244.625 22.3773H219.887V58.1876ZM229.263 36.3922V30.3074H243.627C246.32 30.3074 247.817 31.3548 247.817 33.3498C247.817 35.3448 246.32 36.3922 243.627 36.3922H229.263ZM229.263 43.7238H244.525C247.168 43.7238 248.615 45.0206 248.615 46.9657C248.615 48.9108 247.168 50.2076 244.525 50.2076H229.263V43.7238Z" fill="white"/>
6
+ <path d="M281.942 21.7788C269.423 21.7788 260.396 29.6092 260.396 40.2824C260.396 50.9557 269.423 58.7861 281.942 58.7861C294.461 58.7861 303.438 50.9557 303.438 40.2824C303.438 29.6092 294.461 21.7788 281.942 21.7788ZM281.942 30.2576C288.525 30.2576 293.463 34.1478 293.463 40.2824C293.463 46.4171 288.525 50.3073 281.942 50.3073C275.359 50.3073 270.421 46.4171 270.421 40.2824C270.421 34.1478 275.359 30.2576 281.942 30.2576Z" fill="white"/>
7
+ <path d="M317.526 46.3173H327.251L334.932 58.1876H346.154L337.476 45.2699C342.364 43.5243 345.356 39.6341 345.356 34.3473C345.356 26.6666 339.62 22.3773 330.892 22.3773H307.75V58.1876H317.526V46.3173ZM317.526 38.5867V30.5568H330.394C333.835 30.5568 335.73 32.0531 335.73 34.5967C335.73 36.9907 333.835 38.5867 330.394 38.5867H317.526Z" fill="white"/>
8
+ <path d="M349.904 22.3773V58.1876H384.717V49.9083H359.48V44.0729H381.874V35.9932H359.48V30.6566H384.717V22.3773H349.904Z" fill="white"/>
9
+ <path d="M399.204 46.7662H412.221C420.95 46.7662 426.685 42.5767 426.685 34.5967C426.685 26.5668 420.95 22.3773 412.221 22.3773H389.428V58.1876H399.204V46.7662ZM399.204 38.6366V30.5568H411.673C415.164 30.5568 417.059 32.0531 417.059 34.5967C417.059 37.0904 415.164 38.6366 411.673 38.6366H399.204Z" fill="white"/>
10
+ <path d="M450.948 21.7788C438.43 21.7788 429.402 29.6092 429.402 40.2824C429.402 50.9557 438.43 58.7861 450.948 58.7861C463.467 58.7861 472.444 50.9557 472.444 40.2824C472.444 29.6092 463.467 21.7788 450.948 21.7788ZM450.948 30.2576C457.532 30.2576 462.469 34.1478 462.469 40.2824C462.469 46.4171 457.532 50.3073 450.948 50.3073C444.365 50.3073 439.427 46.4171 439.427 40.2824C439.427 34.1478 444.365 30.2576 450.948 30.2576Z" fill="white"/>
11
+ <path d="M38.5017 18.0956C27.2499 18.0956 18.0957 27.2498 18.0957 38.5016C18.0957 49.7534 27.2499 58.9076 38.5017 58.9076C49.7535 58.9076 58.9077 49.7534 58.9077 38.5016C58.9077 27.2498 49.7535 18.0956 38.5017 18.0956ZM38.5017 49.0618C32.6687 49.0618 27.9415 44.3346 27.9415 38.5016C27.9415 32.6686 32.6687 27.9414 38.5017 27.9414C44.3347 27.9414 49.0619 32.6686 49.0619 38.5016C49.0619 44.3346 44.3347 49.0618 38.5017 49.0618Z" fill="white"/>
12
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M40.2115 14.744V7.125C56.7719 8.0104 69.9275 21.7208 69.9275 38.5016C69.9275 55.2824 56.7719 68.989 40.2115 69.8782V62.2592C52.5539 61.3776 62.3275 51.0644 62.3275 38.5016C62.3275 25.9388 52.5539 15.6256 40.2115 14.744ZM20.5048 54.0815C17.233 50.3043 15.124 45.4935 14.7478 40.2115H7.125C7.5202 47.6025 10.4766 54.3095 15.1088 59.4737L20.501 54.0815H20.5048ZM36.7916 69.8782V62.2592C31.5058 61.883 26.695 59.7778 22.9178 56.5022L17.5256 61.8944C22.6936 66.5304 29.4006 69.483 36.7878 69.8782H36.7916Z" fill="url(#paint0_linear_2028_477)"/>
13
+ <defs>
14
+ <linearGradient id="paint0_linear_2028_477" x1="41.443" y1="11.5372" x2="10.5567" y2="42.4236" gradientUnits="userSpaceOnUse">
15
+ <stop stop-color="#0096FF"/>
16
+ <stop offset="1" stop-color="#FF1E56"/>
17
+ </linearGradient>
18
+ </defs>
19
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_977_547)">
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.5 3L18.5 17H2.5L10.5 3Z" fill="white"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_977_547">
7
+ <rect width="16" height="16" fill="white" transform="translate(2.5 2)"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5H14.5V12.5C14.5 13.0523 14.0523 13.5 13.5 13.5H2.5C1.94772 13.5 1.5 13.0523 1.5 12.5V2.5ZM0 1H1.5H14.5H16V2.5V12.5C16 13.8807 14.8807 15 13.5 15H2.5C1.11929 15 0 13.8807 0 12.5V2.5V1ZM3.75 5.5C4.16421 5.5 4.5 5.16421 4.5 4.75C4.5 4.33579 4.16421 4 3.75 4C3.33579 4 3 4.33579 3 4.75C3 5.16421 3.33579 5.5 3.75 5.5ZM7 4.75C7 5.16421 6.66421 5.5 6.25 5.5C5.83579 5.5 5.5 5.16421 5.5 4.75C5.5 4.33579 5.83579 4 6.25 4C6.66421 4 7 4.33579 7 4.75ZM8.75 5.5C9.16421 5.5 9.5 5.16421 9.5 4.75C9.5 4.33579 9.16421 4 8.75 4C8.33579 4 8 4.33579 8 4.75C8 5.16421 8.33579 5.5 8.75 5.5Z" fill="#666666"/>
3
+ </svg>
@@ -0,0 +1,65 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ export default {
3
+ darkMode: ["class"],
4
+ content: [
5
+ "./app/**/*.{js,ts,jsx,tsx,mdx}",
6
+ "./pages/**/*.{js,ts,jsx,tsx,mdx}",
7
+ "./components/**/*.{js,ts,jsx,tsx,mdx}",
8
+
9
+ // Or if using `src` directory:
10
+ "./src/**/*.{js,ts,jsx,tsx,mdx}",
11
+ ],
12
+ theme: {
13
+ extend: {
14
+ borderRadius: {
15
+ lg: 'var(--radius)',
16
+ md: 'calc(var(--radius) - 2px)',
17
+ sm: 'calc(var(--radius) - 4px)'
18
+ },
19
+ colors: {
20
+ background: 'hsl(var(--background))',
21
+ foreground: 'hsl(var(--foreground))',
22
+ card: {
23
+ DEFAULT: 'hsl(var(--card))',
24
+ foreground: 'hsl(var(--card-foreground))'
25
+ },
26
+ popover: {
27
+ DEFAULT: 'hsl(var(--popover))',
28
+ foreground: 'hsl(var(--popover-foreground))'
29
+ },
30
+ primary: {
31
+ DEFAULT: 'hsl(var(--primary))',
32
+ foreground: 'hsl(var(--primary-foreground))'
33
+ },
34
+ secondary: {
35
+ DEFAULT: 'hsl(var(--secondary))',
36
+ foreground: 'hsl(var(--secondary-foreground))'
37
+ },
38
+ muted: {
39
+ DEFAULT: 'hsl(var(--muted))',
40
+ foreground: 'hsl(var(--muted-foreground))'
41
+ },
42
+ accent: {
43
+ DEFAULT: 'hsl(var(--accent))',
44
+ foreground: 'hsl(var(--accent-foreground))'
45
+ },
46
+ destructive: {
47
+ DEFAULT: 'hsl(var(--destructive))',
48
+ foreground: 'hsl(var(--destructive-foreground))'
49
+ },
50
+ border: 'hsl(var(--border))',
51
+ input: 'hsl(var(--input))',
52
+ ring: 'hsl(var(--ring))',
53
+ chart: {
54
+ '1': 'hsl(var(--chart-1))',
55
+ '2': 'hsl(var(--chart-2))',
56
+ '3': 'hsl(var(--chart-3))',
57
+ '4': 'hsl(var(--chart-4))',
58
+ '5': 'hsl(var(--chart-5))'
59
+ }
60
+ }
61
+ }
62
+ },
63
+ plugins: [require("tailwindcss-animate")],
64
+ }
65
+
@@ -0,0 +1,23 @@
1
+ {
2
+ "extends": "@repo/typescript-config/nextjs.json",
3
+ "compilerOptions": {
4
+ "plugins": [
5
+ {
6
+ "name": "next"
7
+ }
8
+ ],
9
+ "paths": {
10
+ "@/*": ["./*"]
11
+ }
12
+ },
13
+ "include": [
14
+ "**/*.ts",
15
+ "**/*.tsx",
16
+ "next-env.d.ts",
17
+ "next.config.js",
18
+ ".next/types/**/*.ts"
19
+ ],
20
+ "exclude": [
21
+ "node_modules"
22
+ ]
23
+ }
@@ -0,0 +1,4 @@
1
+ interface HTMLInputElement {
2
+ webkitdirectory: string;
3
+ directory: string;
4
+ }
@@ -0,0 +1,14 @@
1
+ version: '3.8'
2
+ services:
3
+ redis:
4
+ image: redis:alpine
5
+ ports:
6
+ - "6379:6379"
7
+ volumes:
8
+ - redis-data:/data
9
+ command: redis-server --appendonly yes
10
+ restart: unless-stopped
11
+
12
+ volumes:
13
+ redis-data:
14
+ driver: local
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@shivasankaran18/stackd",
3
+ "version": "1.1.0",
4
+ "bin": {
5
+ "stackd": "stackd.ts",
6
+ "pre-install": "npm install"
7
+ },
8
+ "type": "module",
9
+ "scripts": {
10
+ "build": "turbo run build",
11
+ "dev": "turbo run dev",
12
+ "lint": "turbo run lint",
13
+ "format": "prettier --write \"**/*.{ts,tsx,md}\"",
14
+ "check-types": "turbo run check-types",
15
+ "prepare": "husky install",
16
+ "setup": "sh start-web.sh",
17
+ "@types/node": "^22.13.5",
18
+ "chalk": "4",
19
+ "commander": "^13.1.0",
20
+ "fs": "^0.0.1-security",
21
+ "gradient-string": "^3.0.0",
22
+ "inquirer": "^12.4.2",
23
+ "ora": "^8.2.0",
24
+ "path": "^0.12.7",
25
+ "ts-node": "^10.9.2",
26
+ "create":"tsx ./stackd.ts init"
27
+ },
28
+ "devDependencies": {
29
+ "@types/chalk": "^2.2.4",
30
+ "@types/commander": "^2.12.5",
31
+ "@types/node": "^22.13.5",
32
+ "husky": "^9.1.7",
33
+ "lint-staged": "^15.4.3",
34
+ "prettier": "^3.5.0",
35
+ "turbo": "^2.4.2",
36
+ "typescript": "^5.7.3"
37
+ },
38
+ "engines": {
39
+ "node": ">=18"
40
+ },
41
+ "packageManager": "npm@11.0.0",
42
+ "workspaces": [
43
+ "apps/*",
44
+ "packages/*"
45
+ ],
46
+ "dependencies": {
47
+ "@octokit/rest": "^21.1.1",
48
+ "chalk": "^4.1.2",
49
+ "framer-motion": "^12.4.7",
50
+ "fs": "^0.0.1-security",
51
+ "simple-git": "^3.27.0",
52
+ "ts-node": "^10.9.2",
53
+ "tsx": "^4.19.3"
54
+ }
55
+ }
@@ -0,0 +1,3 @@
1
+ # `@turbo/eslint-config`
2
+
3
+ Collection of internal eslint configurations.
@@ -0,0 +1,32 @@
1
+ import js from "@eslint/js";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+ import turboPlugin from "eslint-plugin-turbo";
4
+ import tseslint from "typescript-eslint";
5
+ import onlyWarn from "eslint-plugin-only-warn";
6
+
7
+ /**
8
+ * A shared ESLint configuration for the repository.
9
+ *
10
+ * @type {import("eslint").Linter.Config}
11
+ * */
12
+ export const config = [
13
+ js.configs.recommended,
14
+ eslintConfigPrettier,
15
+ ...tseslint.configs.recommended,
16
+ {
17
+ plugins: {
18
+ turbo: turboPlugin,
19
+ },
20
+ rules: {
21
+ "turbo/no-undeclared-env-vars": "warn",
22
+ },
23
+ },
24
+ {
25
+ plugins: {
26
+ onlyWarn,
27
+ },
28
+ },
29
+ {
30
+ ignores: ["dist/**"],
31
+ },
32
+ ];
@@ -0,0 +1,49 @@
1
+ import js from "@eslint/js";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+ import tseslint from "typescript-eslint";
4
+ import pluginReactHooks from "eslint-plugin-react-hooks";
5
+ import pluginReact from "eslint-plugin-react";
6
+ import globals from "globals";
7
+ import pluginNext from "@next/eslint-plugin-next";
8
+ import { config as baseConfig } from "./base.js";
9
+
10
+ /**
11
+ * A custom ESLint configuration for libraries that use Next.js.
12
+ *
13
+ * @type {import("eslint").Linter.Config}
14
+ * */
15
+ export const nextJsConfig = [
16
+ ...baseConfig,
17
+ js.configs.recommended,
18
+ eslintConfigPrettier,
19
+ ...tseslint.configs.recommended,
20
+ {
21
+ ...pluginReact.configs.flat.recommended,
22
+ languageOptions: {
23
+ ...pluginReact.configs.flat.recommended.languageOptions,
24
+ globals: {
25
+ ...globals.serviceworker,
26
+ },
27
+ },
28
+ },
29
+ {
30
+ plugins: {
31
+ "@next/next": pluginNext,
32
+ },
33
+ rules: {
34
+ ...pluginNext.configs.recommended.rules,
35
+ ...pluginNext.configs["core-web-vitals"].rules,
36
+ },
37
+ },
38
+ {
39
+ plugins: {
40
+ "react-hooks": pluginReactHooks,
41
+ },
42
+ settings: { react: { version: "detect" } },
43
+ rules: {
44
+ ...pluginReactHooks.configs.recommended.rules,
45
+ // React scope no longer necessary with new JSX transform.
46
+ "react/react-in-jsx-scope": "off",
47
+ },
48
+ },
49
+ ];
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@repo/eslint-config",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "private": true,
6
+ "exports": {
7
+ "./base": "./base.js",
8
+ "./next-js": "./next.js",
9
+ "./react-internal": "./react-internal.js"
10
+ },
11
+ "devDependencies": {
12
+ "@eslint/js": "^9.20.0",
13
+ "@next/eslint-plugin-next": "^15.1.6",
14
+ "eslint": "^9.20.0",
15
+ "eslint-config-prettier": "^10.0.1",
16
+ "eslint-plugin-only-warn": "^1.1.0",
17
+ "eslint-plugin-react": "^7.37.4",
18
+ "eslint-plugin-react-hooks": "^5.1.0",
19
+ "eslint-plugin-turbo": "^2.4.0",
20
+ "globals": "^15.15.0",
21
+ "typescript": "^5.7.3",
22
+ "typescript-eslint": "^8.24.0"
23
+ }
24
+ }
@@ -0,0 +1,39 @@
1
+ import js from "@eslint/js";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+ import tseslint from "typescript-eslint";
4
+ import pluginReactHooks from "eslint-plugin-react-hooks";
5
+ import pluginReact from "eslint-plugin-react";
6
+ import globals from "globals";
7
+ import { config as baseConfig } from "./base.js";
8
+
9
+ /**
10
+ * A custom ESLint configuration for libraries that use React.
11
+ *
12
+ * @type {import("eslint").Linter.Config} */
13
+ export const config = [
14
+ ...baseConfig,
15
+ js.configs.recommended,
16
+ eslintConfigPrettier,
17
+ ...tseslint.configs.recommended,
18
+ pluginReact.configs.flat.recommended,
19
+ {
20
+ languageOptions: {
21
+ ...pluginReact.configs.flat.recommended.languageOptions,
22
+ globals: {
23
+ ...globals.serviceworker,
24
+ ...globals.browser,
25
+ },
26
+ },
27
+ },
28
+ {
29
+ plugins: {
30
+ "react-hooks": pluginReactHooks,
31
+ },
32
+ settings: { react: { version: "detect" } },
33
+ rules: {
34
+ ...pluginReactHooks.configs.recommended.rules,
35
+ // React scope no longer necessary with new JSX transform.
36
+ "react/react-in-jsx-scope": "off",
37
+ },
38
+ },
39
+ ];
@@ -0,0 +1,83 @@
1
+ import { mkdir, writeFile } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ import fs from 'fs';
4
+
5
+ export async function jwtAuthts(config: any, projectDir: any,emitLog: (log: string) => void) {
6
+ emitLog('Installing jsonwebtoken...');
7
+ const packageJsonPath = join(projectDir, 'backend','package.json');
8
+ const jsonData = await JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
9
+ emitLog('Updating package.json...');
10
+ jsonData.dependencies = jsonData.dependencies || {};
11
+ jsonData.dependencies["jsonwebtoken"] = "^9.0.2";
12
+
13
+ fs.writeFileSync(packageJsonPath, JSON.stringify(jsonData, null, 2), 'utf8');
14
+ emitLog('Writing jwt.ts...');
15
+ const jwtAuthFile = `
16
+ const jwt = require('jsonwebtoken');
17
+ export const authenticateToken = (req:any, res:any, next:any) => {
18
+ const token = req.header('Authorization')?.split(' ')[1];
19
+ if (!token) return res.status(401).json({ error: 'Access Denied' });
20
+
21
+ jwt.verify(token, process.env.JWT_SECRET, (err:any, user:any) => {
22
+ if (err) return res.status(403).json({ error: 'Invalid Token' });
23
+ req.user = user;
24
+ next();
25
+ });
26
+ };
27
+ `;
28
+ emitLog('Writing middleware.ts...');
29
+ const middlewareDir = join(projectDir, 'backend', 'src', 'middleware');
30
+ await mkdir(middlewareDir, { recursive: true });
31
+ emitLog('Writing middleware.ts...');
32
+ await writeFile(join(middlewareDir, 'middleware.ts'), jwtAuthFile, 'utf8');
33
+ emitLog('✅ JWT authentication setup completed successfully!');
34
+ }
35
+
36
+ export async function jwtAuthdjango(config: any, projectDir: any,emitLog: (log: string) => void) {
37
+ emitLog('Installing jsonwebtoken...');
38
+ const settingsPath = join(projectDir, 'backend', 'core', 'settings.py');
39
+ emitLog('Updating settings.py...');
40
+ try {
41
+ let settingsContent = fs.readFileSync(settingsPath, 'utf8');
42
+ const restFrameworkSettings = `
43
+
44
+ REST_FRAMEWORK = {
45
+ 'DEFAULT_AUTHENTICATION_CLASSES': [
46
+ 'rest_framework_simplejwt.authentication.JWTAuthentication',
47
+ ],
48
+ }
49
+ `;
50
+
51
+ const installedAppsIndex = settingsContent.indexOf('INSTALLED_APPS');
52
+ const insertPosition = settingsContent.indexOf(']', installedAppsIndex) + 1;
53
+
54
+ settingsContent =
55
+ settingsContent.slice(0, insertPosition) +
56
+ restFrameworkSettings +
57
+ settingsContent.slice(insertPosition);
58
+
59
+ fs.writeFileSync(settingsPath, settingsContent, 'utf8');
60
+ emitLog('Writing urls.py...');
61
+ let urlsContent = fs.readFileSync(`${projectDir}/backend/core/urls.py`, 'utf8');
62
+ const newUrlsContent = `from django.contrib import admin
63
+ from django.urls import path, include
64
+ from rest_framework_simplejwt import views as jwt_views
65
+
66
+ urlpatterns = [
67
+ path('admin/', admin.site.urls),
68
+ path('api/token/',
69
+ jwt_views.TokenObtainPairView.as_view(),
70
+ name='token_obtain_pair'),
71
+ path('api/token/refresh/',
72
+ jwt_views.TokenRefreshView.as_view(),
73
+ name='token_refresh'),
74
+ path('', include('main.urls')),
75
+ ]
76
+ `;
77
+ fs.writeFileSync(`${projectDir}/backend/core/urls.py`, newUrlsContent, 'utf8');
78
+ emitLog('✅ JWT authentication setup completed successfully!');
79
+ } catch (error) {
80
+ console.error('Error configuring Django settings:', error);
81
+ throw error;
82
+ }
83
+ }
@@ -0,0 +1,146 @@
1
+ import { join } from 'node:path'
2
+ import { mkdir, writeFile } from 'node:fs/promises'
3
+ import 'dotenv/config'
4
+
5
+ export async function setupNextAuth(config: any, projectDir: string,emitLog: (log: string) => void) {
6
+ try {
7
+ const authDir = join(projectDir, 'frontend', 'src', 'app', 'api', 'auth');
8
+ await mkdir(authDir, { recursive: true });
9
+ emitLog('Creating auth directory...');
10
+ const routeCode = `
11
+ import NextAuth from "next-auth";
12
+ import { AuthOptions } from "next-auth";
13
+ import GithubProvider from "next-auth/providers/github";
14
+ import GoogleProvider from "next-auth/providers/google";
15
+ import CredentialsProvider from "next-auth/providers/credentials";
16
+ export const authOptions: AuthOptions = {
17
+ providers: [
18
+ GithubProvider({
19
+ clientId: process.env.GITHUB_ID!,
20
+ clientSecret: process.env.GITHUB_SECRET!,
21
+ }),
22
+ GoogleProvider({
23
+ clientId: process.env.GOOGLE_CLIENT_ID!,
24
+ clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
25
+ }),
26
+ CredentialsProvider({
27
+ name: 'Credentials',
28
+ credentials: {
29
+ email: { label: "Email", type: "email" },
30
+ password: { label: "Password", type: "password" }
31
+ },
32
+ async authorize(credentials) {
33
+ // Add your credentials logic here
34
+ if (!credentials?.email || !credentials?.password) return null;
35
+
36
+ try {
37
+ // Example user verification
38
+ const user = { id: "1", email: credentials.email, name: "User" };
39
+ return user;
40
+ } catch (error) {
41
+ return null;
42
+ }
43
+ }
44
+ }),
45
+ ],
46
+ pages: {
47
+ signIn: '/auth/signin',
48
+ signOut: '/auth/signout',
49
+ error: '/auth/error',
50
+ },
51
+ callbacks: {
52
+ async jwt({ token, user }) {
53
+ if (user) {
54
+ token.id = user.id;
55
+ }
56
+ return token;
57
+ },
58
+ async session({ session, token }) {
59
+ if (session.user) {
60
+ (session.user as any).id = token.id;
61
+ }
62
+ return session;
63
+ },
64
+ },
65
+ session: {
66
+ strategy: "jwt",
67
+ },
68
+ secret: process.env.NEXTAUTH_SECRET,
69
+ };
70
+
71
+ const handler = NextAuth(authOptions);
72
+ export { handler as GET, handler as POST };
73
+ `;
74
+
75
+ await writeFile(
76
+ join(authDir, 'route.ts'),
77
+ routeCode.trim() + '\n'
78
+ );
79
+
80
+ const utilsDir = join(projectDir, 'frontend', 'src', 'utils');
81
+ await mkdir(utilsDir, { recursive: true });
82
+ emitLog('Creating utils directory...');
83
+ const utilsCode = `
84
+ import { getServerSession } from "next-auth/next";
85
+ import { authOptions } from "@/app/api/auth/route";
86
+
87
+ export async function getSession() {
88
+ return await getServerSession(authOptions);
89
+ }
90
+
91
+ export async function getCurrentUser() {
92
+ const session = await getSession();
93
+ return session?.user;
94
+ }
95
+
96
+ export async function isAuthenticated() {
97
+ const session = await getSession();
98
+ return !!session;
99
+ }
100
+ `;
101
+ emitLog('Writing utils.ts...');
102
+ await writeFile(
103
+ join(utilsDir, 'auth.ts'),
104
+ utilsCode.trim() + '\n'
105
+ );
106
+
107
+ const envContent = `
108
+ # NextAuth Configuration
109
+ NEXTAUTH_SECRET=your-secret-key-here
110
+ NEXTAUTH_URL=http://localhost:${config.frontendPort}
111
+
112
+ # OAuth Providers
113
+ GITHUB_ID=your-github-id
114
+ GITHUB_SECRET=your-github-secret
115
+
116
+ GOOGLE_CLIENT_ID=your-google-client-id
117
+ GOOGLE_CLIENT_SECRET=your-google-client-secret
118
+ `;
119
+ emitLog('Writing .env file...');
120
+ await writeFile(
121
+ join(projectDir, 'frontend', '.env'),
122
+ envContent.trim() + '\n'
123
+ );
124
+ emitLog('Writing AuthProvider.tsx...');
125
+ const providerCode = `
126
+ 'use client';
127
+
128
+ import { SessionProvider } from "next-auth/react";
129
+
130
+ export function AuthProvider({ children }: { children: React.ReactNode }) {
131
+ return <SessionProvider>{children}</SessionProvider>;
132
+ }
133
+ `;
134
+ emitLog('Creating components directory...');
135
+ const providersDir = join(projectDir, 'frontend', 'src', 'components', 'auth');
136
+ await mkdir(providersDir, { recursive: true });
137
+ await writeFile(
138
+ join(providersDir, 'AuthProvider.tsx'),
139
+ providerCode.trim() + '\n'
140
+ );
141
+ emitLog('✅ NextAuth setup completed successfully!');
142
+ } catch (error) {
143
+ emitLog(`❌ Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
144
+ throw error;
145
+ }
146
+ }