@digilogiclabs/create-saas-app 2.0.0 → 2.2.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.
- package/CHANGELOG.md +7 -0
- package/README.md +975 -891
- package/dist/.tsbuildinfo +1 -1
- package/dist/generators/template-generator.d.ts +11 -0
- package/dist/generators/template-generator.d.ts.map +1 -1
- package/dist/generators/template-generator.js +389 -18
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/index.js +1837 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/infrastructure/kubernetes/base/template/README.md +253 -0
- package/dist/templates/infrastructure/kubernetes/base/template/configmap.yaml +12 -0
- package/dist/templates/infrastructure/kubernetes/base/template/deployment.yaml +123 -0
- package/dist/templates/infrastructure/kubernetes/base/template/hpa.yaml +45 -0
- package/dist/templates/infrastructure/kubernetes/base/template/ingress.yaml +31 -0
- package/dist/templates/infrastructure/kubernetes/base/template/kustomization.yaml +25 -0
- package/dist/templates/infrastructure/kubernetes/base/template/namespace.yaml +8 -0
- package/dist/templates/infrastructure/kubernetes/base/template/networkpolicy.yaml +48 -0
- package/dist/templates/infrastructure/kubernetes/base/template/pdb.yaml +14 -0
- package/dist/templates/infrastructure/kubernetes/base/template/secret.yaml +17 -0
- package/dist/templates/infrastructure/kubernetes/base/template/service.yaml +19 -0
- package/dist/templates/infrastructure/kubernetes/base/template/serviceaccount.yaml +9 -0
- package/dist/templates/infrastructure/kubernetes/production/template/kustomization.yaml +92 -0
- package/dist/templates/infrastructure/terraform/aws/template/README.md +156 -0
- package/dist/templates/infrastructure/terraform/aws/template/main.tf +343 -0
- package/dist/templates/infrastructure/terraform/aws/template/outputs.tf +66 -0
- package/dist/templates/infrastructure/terraform/aws/template/terraform.tfvars.example +28 -0
- package/dist/templates/infrastructure/terraform/aws/template/variables.tf +110 -0
- package/dist/templates/infrastructure/terraform/gcp/template/README.md +165 -0
- package/dist/templates/infrastructure/terraform/gcp/template/main.tf +397 -0
- package/dist/templates/infrastructure/terraform/gcp/template/outputs.tf +51 -0
- package/dist/templates/infrastructure/terraform/gcp/template/terraform.tfvars.example +29 -0
- package/dist/templates/infrastructure/terraform/gcp/template/variables.tf +115 -0
- package/dist/templates/shared/admin/web/app/admin/layout.tsx +34 -0
- package/dist/templates/shared/admin/web/components/admin-nav.tsx +48 -0
- package/dist/templates/shared/audit/web/lib/audit.ts +24 -0
- package/dist/templates/shared/auth/keycloak/web/app/api/auth/federated-logout/route.ts +173 -0
- package/dist/templates/shared/auth/keycloak/web/auth.config.ts +84 -0
- package/dist/templates/shared/auth/keycloak/web/auth.ts +26 -0
- package/dist/templates/shared/beta/web/app/api/beta-settings/route.ts +25 -0
- package/dist/templates/shared/beta/web/app/api/validate-beta-code/route.ts +67 -0
- package/dist/templates/shared/beta/web/lib/beta/settings.ts +31 -0
- package/dist/templates/shared/cache/web/lib/cache.ts +44 -0
- package/dist/templates/shared/config/web/lib/config.ts +112 -0
- package/dist/templates/shared/config/web/next.config.mjs +62 -0
- package/dist/templates/shared/contact/web/app/api/contact/route.ts +113 -0
- package/dist/templates/shared/contact/web/app/contact/page.tsx +195 -0
- package/dist/templates/shared/cookie-consent/web/components/cookie-consent.tsx +54 -0
- package/dist/templates/shared/database/postgresql/web/drizzle.config.ts +16 -0
- package/dist/templates/shared/database/postgresql/web/lib/db/drizzle.ts +39 -0
- package/dist/templates/shared/database/postgresql/web/lib/db/schema.ts +33 -0
- package/dist/templates/shared/database/supabase/web/lib/supabase/client.ts +12 -0
- package/dist/templates/shared/database/supabase/web/lib/supabase/server.ts +31 -0
- package/dist/templates/shared/database/supabase/web/lib/supabase/service.ts +15 -0
- package/dist/templates/shared/email/web/lib/email/branding.ts +18 -0
- package/dist/templates/shared/email/web/lib/email/client.ts +96 -0
- package/dist/templates/shared/error-pages/web/app/error.tsx +70 -0
- package/dist/templates/shared/error-pages/web/app/global-error.tsx +102 -0
- package/dist/templates/shared/error-pages/web/app/not-found.tsx +39 -0
- package/dist/templates/shared/health/web/app/api/health/route.ts +68 -0
- package/dist/templates/shared/legal/web/app/(legal)/privacy/page.tsx +205 -0
- package/dist/templates/shared/legal/web/app/(legal)/terms/page.tsx +154 -0
- package/dist/templates/shared/legal/web/lib/legal-config.ts +50 -0
- package/dist/templates/shared/loading/web/app/loading.tsx +5 -0
- package/dist/templates/shared/loading/web/components/skeleton.tsx +95 -0
- package/dist/templates/shared/middleware/web/middleware.ts +68 -0
- package/dist/templates/shared/observability/web/lib/observability.ts +135 -0
- package/dist/templates/shared/payments/web/app/api/webhooks/stripe/route.ts +109 -0
- package/dist/templates/shared/platform/web/lib/platform.ts +37 -0
- package/dist/templates/shared/redis/web/lib/rate-limit-store.ts +18 -0
- package/dist/templates/shared/redis/web/lib/redis.ts +48 -0
- package/dist/templates/shared/security/web/lib/api-security.ts +318 -0
- package/dist/templates/shared/seo/web/app/api/og/route.tsx +97 -0
- package/dist/templates/shared/seo/web/app/robots.ts +53 -0
- package/dist/templates/shared/seo/web/app/sitemap.ts +53 -0
- package/dist/templates/shared/utils/web/lib/api-response.ts +71 -0
- package/dist/templates/shared/utils/web/lib/utils.ts +85 -0
- package/dist/templates/web/ai-platform/template/.env.example +16 -0
- package/dist/templates/web/ai-platform/template/README.md +84 -0
- package/dist/templates/web/ai-platform/template/middleware.ts +55 -0
- package/dist/templates/web/ai-platform/template/next.config.js +14 -0
- package/dist/templates/web/ai-platform/template/package.json +55 -0
- package/dist/templates/web/ai-platform/template/src/app/api/chat/route.ts +54 -0
- package/dist/templates/web/ai-platform/template/src/app/chat/page.tsx +235 -0
- package/dist/templates/web/ai-platform/template/src/app/dashboard/page.tsx +142 -0
- package/dist/templates/web/ai-platform/template/src/app/globals.css +34 -0
- package/dist/templates/web/ai-platform/template/src/app/layout.tsx +27 -0
- package/dist/templates/web/ai-platform/template/src/app/page.tsx +203 -0
- package/dist/templates/web/ai-platform/template/src/components/providers/app-providers.tsx +27 -0
- package/dist/templates/web/ai-platform/template/src/lib/auth-server.ts +33 -0
- package/dist/templates/web/ai-platform/template/src/lib/supabase/client.ts +8 -0
- package/dist/templates/web/ai-platform/template/src/lib/supabase/server.ts +27 -0
- package/dist/templates/web/ai-platform/template/src/lib/utils.ts +6 -0
- package/dist/templates/web/ai-platform/template/tsconfig.json +27 -0
- package/dist/templates/web/iot-dashboard/template/.env.example +12 -0
- package/dist/templates/web/iot-dashboard/template/README.md +101 -0
- package/dist/templates/web/iot-dashboard/template/middleware.ts +56 -0
- package/dist/templates/web/iot-dashboard/template/next.config.js +14 -0
- package/dist/templates/web/iot-dashboard/template/package.json +49 -0
- package/dist/templates/web/iot-dashboard/template/src/app/dashboard/page.tsx +229 -0
- package/dist/templates/web/iot-dashboard/template/src/app/globals.css +20 -0
- package/dist/templates/web/iot-dashboard/template/src/app/layout.tsx +27 -0
- package/dist/templates/web/iot-dashboard/template/src/app/page.tsx +191 -0
- package/dist/templates/web/iot-dashboard/template/src/components/providers/app-providers.tsx +24 -0
- package/dist/templates/web/iot-dashboard/template/src/lib/auth-server.ts +33 -0
- package/dist/templates/web/iot-dashboard/template/src/lib/supabase/client.ts +8 -0
- package/dist/templates/web/iot-dashboard/template/src/lib/supabase/server.ts +27 -0
- package/dist/templates/web/iot-dashboard/template/src/lib/utils.ts +25 -0
- package/dist/templates/web/iot-dashboard/template/tsconfig.json +27 -0
- package/dist/templates/web/marketplace/template/.env.example +12 -0
- package/dist/templates/web/marketplace/template/README.md +66 -0
- package/dist/templates/web/marketplace/template/middleware.ts +56 -0
- package/dist/templates/web/marketplace/template/next.config.js +14 -0
- package/dist/templates/web/marketplace/template/package.json +51 -0
- package/dist/templates/web/marketplace/template/src/app/cart/page.tsx +147 -0
- package/dist/templates/web/marketplace/template/src/app/dashboard/page.tsx +149 -0
- package/dist/templates/web/marketplace/template/src/app/globals.css +20 -0
- package/dist/templates/web/marketplace/template/src/app/layout.tsx +27 -0
- package/dist/templates/web/marketplace/template/src/app/page.tsx +167 -0
- package/dist/templates/web/marketplace/template/src/app/products/page.tsx +129 -0
- package/dist/templates/web/marketplace/template/src/components/providers/app-providers.tsx +27 -0
- package/dist/templates/web/marketplace/template/src/lib/auth-server.ts +33 -0
- package/dist/templates/web/marketplace/template/src/lib/supabase/client.ts +8 -0
- package/dist/templates/web/marketplace/template/src/lib/supabase/server.ts +27 -0
- package/dist/templates/web/marketplace/template/src/lib/utils.ts +19 -0
- package/dist/templates/web/marketplace/template/tsconfig.json +27 -0
- package/dist/templates/web/micro-saas/template/.env.example +10 -0
- package/dist/templates/web/micro-saas/template/README.md +63 -0
- package/dist/templates/web/micro-saas/template/middleware.ts +53 -0
- package/dist/templates/web/micro-saas/template/next.config.js +14 -0
- package/dist/templates/web/micro-saas/template/package.json +41 -0
- package/dist/templates/web/micro-saas/template/src/app/dashboard/page.tsx +117 -0
- package/dist/templates/web/micro-saas/template/src/app/globals.css +20 -0
- package/dist/templates/web/micro-saas/template/src/app/layout.tsx +27 -0
- package/dist/templates/web/micro-saas/template/src/app/login/page.tsx +87 -0
- package/dist/templates/web/micro-saas/template/src/app/page.tsx +137 -0
- package/dist/templates/web/micro-saas/template/src/app/signup/page.tsx +108 -0
- package/dist/templates/web/micro-saas/template/src/components/providers/app-providers.tsx +24 -0
- package/dist/templates/web/micro-saas/template/src/lib/auth-server.ts +33 -0
- package/dist/templates/web/micro-saas/template/src/lib/supabase/client.ts +8 -0
- package/dist/templates/web/micro-saas/template/src/lib/supabase/server.ts +29 -0
- package/dist/templates/web/micro-saas/template/src/lib/utils.ts +6 -0
- package/dist/templates/web/micro-saas/template/tsconfig.json +27 -0
- package/package.json +5 -4
- package/src/templates/infrastructure/kubernetes/base/template/README.md +253 -0
- package/src/templates/infrastructure/kubernetes/base/template/configmap.yaml +12 -0
- package/src/templates/infrastructure/kubernetes/base/template/deployment.yaml +123 -0
- package/src/templates/infrastructure/kubernetes/base/template/hpa.yaml +45 -0
- package/src/templates/infrastructure/kubernetes/base/template/ingress.yaml +31 -0
- package/src/templates/infrastructure/kubernetes/base/template/kustomization.yaml +25 -0
- package/src/templates/infrastructure/kubernetes/base/template/namespace.yaml +8 -0
- package/src/templates/infrastructure/kubernetes/base/template/networkpolicy.yaml +48 -0
- package/src/templates/infrastructure/kubernetes/base/template/pdb.yaml +14 -0
- package/src/templates/infrastructure/kubernetes/base/template/secret.yaml +17 -0
- package/src/templates/infrastructure/kubernetes/base/template/service.yaml +19 -0
- package/src/templates/infrastructure/kubernetes/base/template/serviceaccount.yaml +9 -0
- package/src/templates/infrastructure/kubernetes/production/template/kustomization.yaml +92 -0
- package/src/templates/infrastructure/terraform/aws/template/README.md +156 -0
- package/src/templates/infrastructure/terraform/aws/template/main.tf +343 -0
- package/src/templates/infrastructure/terraform/aws/template/outputs.tf +66 -0
- package/src/templates/infrastructure/terraform/aws/template/terraform.tfvars.example +28 -0
- package/src/templates/infrastructure/terraform/aws/template/variables.tf +110 -0
- package/src/templates/infrastructure/terraform/gcp/template/README.md +165 -0
- package/src/templates/infrastructure/terraform/gcp/template/main.tf +397 -0
- package/src/templates/infrastructure/terraform/gcp/template/outputs.tf +51 -0
- package/src/templates/infrastructure/terraform/gcp/template/terraform.tfvars.example +29 -0
- package/src/templates/infrastructure/terraform/gcp/template/variables.tf +115 -0
- package/src/templates/shared/admin/web/app/admin/layout.tsx +34 -0
- package/src/templates/shared/admin/web/components/admin-nav.tsx +48 -0
- package/src/templates/shared/audit/web/lib/audit.ts +24 -0
- package/src/templates/shared/auth/keycloak/web/app/api/auth/federated-logout/route.ts +173 -0
- package/src/templates/shared/auth/keycloak/web/auth.config.ts +84 -0
- package/src/templates/shared/auth/keycloak/web/auth.ts +26 -0
- package/src/templates/shared/beta/web/app/api/beta-settings/route.ts +25 -0
- package/src/templates/shared/beta/web/app/api/validate-beta-code/route.ts +67 -0
- package/src/templates/shared/beta/web/lib/beta/settings.ts +31 -0
- package/src/templates/shared/cache/web/lib/cache.ts +44 -0
- package/src/templates/shared/config/web/lib/config.ts +112 -0
- package/src/templates/shared/config/web/next.config.mjs +62 -0
- package/src/templates/shared/contact/web/app/api/contact/route.ts +113 -0
- package/src/templates/shared/contact/web/app/contact/page.tsx +195 -0
- package/src/templates/shared/cookie-consent/web/components/cookie-consent.tsx +54 -0
- package/src/templates/shared/database/postgresql/web/drizzle.config.ts +16 -0
- package/src/templates/shared/database/postgresql/web/lib/db/drizzle.ts +39 -0
- package/src/templates/shared/database/postgresql/web/lib/db/schema.ts +33 -0
- package/src/templates/shared/database/supabase/web/lib/supabase/client.ts +12 -0
- package/src/templates/shared/database/supabase/web/lib/supabase/server.ts +31 -0
- package/src/templates/shared/database/supabase/web/lib/supabase/service.ts +15 -0
- package/src/templates/shared/email/web/lib/email/branding.ts +18 -0
- package/src/templates/shared/email/web/lib/email/client.ts +96 -0
- package/src/templates/shared/error-pages/web/app/error.tsx +70 -0
- package/src/templates/shared/error-pages/web/app/global-error.tsx +102 -0
- package/src/templates/shared/error-pages/web/app/not-found.tsx +39 -0
- package/src/templates/shared/health/web/app/api/health/route.ts +68 -0
- package/src/templates/shared/legal/web/app/(legal)/privacy/page.tsx +205 -0
- package/src/templates/shared/legal/web/app/(legal)/terms/page.tsx +154 -0
- package/src/templates/shared/legal/web/lib/legal-config.ts +50 -0
- package/src/templates/shared/loading/web/app/loading.tsx +5 -0
- package/src/templates/shared/loading/web/components/skeleton.tsx +95 -0
- package/src/templates/shared/middleware/web/middleware.ts +68 -0
- package/src/templates/shared/observability/web/lib/observability.ts +135 -0
- package/src/templates/shared/payments/web/app/api/webhooks/stripe/route.ts +109 -0
- package/src/templates/shared/platform/web/lib/platform.ts +37 -0
- package/src/templates/shared/redis/web/lib/rate-limit-store.ts +18 -0
- package/src/templates/shared/redis/web/lib/redis.ts +48 -0
- package/src/templates/shared/security/web/lib/api-security.ts +318 -0
- package/src/templates/shared/seo/web/app/api/og/route.tsx +97 -0
- package/src/templates/shared/seo/web/app/robots.ts +53 -0
- package/src/templates/shared/seo/web/app/sitemap.ts +53 -0
- package/src/templates/shared/utils/web/lib/api-response.ts +71 -0
- package/src/templates/shared/utils/web/lib/utils.ts +85 -0
- package/src/templates/web/ai-platform/template/.env.example +16 -0
- package/src/templates/web/ai-platform/template/README.md +84 -0
- package/src/templates/web/ai-platform/template/middleware.ts +55 -0
- package/src/templates/web/ai-platform/template/next.config.js +14 -0
- package/src/templates/web/ai-platform/template/package.json +55 -0
- package/src/templates/web/ai-platform/template/src/app/api/chat/route.ts +54 -0
- package/src/templates/web/ai-platform/template/src/app/chat/page.tsx +235 -0
- package/src/templates/web/ai-platform/template/src/app/dashboard/page.tsx +142 -0
- package/src/templates/web/ai-platform/template/src/app/globals.css +34 -0
- package/src/templates/web/ai-platform/template/src/app/layout.tsx +27 -0
- package/src/templates/web/ai-platform/template/src/app/page.tsx +203 -0
- package/src/templates/web/ai-platform/template/src/components/providers/app-providers.tsx +27 -0
- package/src/templates/web/ai-platform/template/src/lib/auth-server.ts +33 -0
- package/src/templates/web/ai-platform/template/src/lib/supabase/client.ts +8 -0
- package/src/templates/web/ai-platform/template/src/lib/supabase/server.ts +27 -0
- package/src/templates/web/ai-platform/template/src/lib/utils.ts +6 -0
- package/src/templates/web/ai-platform/template/tsconfig.json +27 -0
- package/src/templates/web/iot-dashboard/template/.env.example +12 -0
- package/src/templates/web/iot-dashboard/template/README.md +101 -0
- package/src/templates/web/iot-dashboard/template/middleware.ts +56 -0
- package/src/templates/web/iot-dashboard/template/next.config.js +14 -0
- package/src/templates/web/iot-dashboard/template/package.json +49 -0
- package/src/templates/web/iot-dashboard/template/src/app/dashboard/page.tsx +229 -0
- package/src/templates/web/iot-dashboard/template/src/app/globals.css +20 -0
- package/src/templates/web/iot-dashboard/template/src/app/layout.tsx +27 -0
- package/src/templates/web/iot-dashboard/template/src/app/page.tsx +191 -0
- package/src/templates/web/iot-dashboard/template/src/components/providers/app-providers.tsx +24 -0
- package/src/templates/web/iot-dashboard/template/src/lib/auth-server.ts +33 -0
- package/src/templates/web/iot-dashboard/template/src/lib/supabase/client.ts +8 -0
- package/src/templates/web/iot-dashboard/template/src/lib/supabase/server.ts +27 -0
- package/src/templates/web/iot-dashboard/template/src/lib/utils.ts +25 -0
- package/src/templates/web/iot-dashboard/template/tsconfig.json +27 -0
- package/src/templates/web/marketplace/template/.env.example +12 -0
- package/src/templates/web/marketplace/template/README.md +66 -0
- package/src/templates/web/marketplace/template/middleware.ts +56 -0
- package/src/templates/web/marketplace/template/next.config.js +14 -0
- package/src/templates/web/marketplace/template/package.json +51 -0
- package/src/templates/web/marketplace/template/src/app/cart/page.tsx +147 -0
- package/src/templates/web/marketplace/template/src/app/dashboard/page.tsx +149 -0
- package/src/templates/web/marketplace/template/src/app/globals.css +20 -0
- package/src/templates/web/marketplace/template/src/app/layout.tsx +27 -0
- package/src/templates/web/marketplace/template/src/app/page.tsx +167 -0
- package/src/templates/web/marketplace/template/src/app/products/page.tsx +129 -0
- package/src/templates/web/marketplace/template/src/components/providers/app-providers.tsx +27 -0
- package/src/templates/web/marketplace/template/src/lib/auth-server.ts +33 -0
- package/src/templates/web/marketplace/template/src/lib/supabase/client.ts +8 -0
- package/src/templates/web/marketplace/template/src/lib/supabase/server.ts +27 -0
- package/src/templates/web/marketplace/template/src/lib/utils.ts +19 -0
- package/src/templates/web/marketplace/template/tsconfig.json +27 -0
- package/src/templates/web/micro-saas/template/.env.example +10 -0
- package/src/templates/web/micro-saas/template/README.md +63 -0
- package/src/templates/web/micro-saas/template/middleware.ts +53 -0
- package/src/templates/web/micro-saas/template/next.config.js +14 -0
- package/src/templates/web/micro-saas/template/package.json +41 -0
- package/src/templates/web/micro-saas/template/src/app/dashboard/page.tsx +117 -0
- package/src/templates/web/micro-saas/template/src/app/globals.css +20 -0
- package/src/templates/web/micro-saas/template/src/app/layout.tsx +27 -0
- package/src/templates/web/micro-saas/template/src/app/login/page.tsx +87 -0
- package/src/templates/web/micro-saas/template/src/app/page.tsx +137 -0
- package/src/templates/web/micro-saas/template/src/app/signup/page.tsx +108 -0
- package/src/templates/web/micro-saas/template/src/components/providers/app-providers.tsx +24 -0
- package/src/templates/web/micro-saas/template/src/lib/auth-server.ts +33 -0
- package/src/templates/web/micro-saas/template/src/lib/supabase/client.ts +8 -0
- package/src/templates/web/micro-saas/template/src/lib/supabase/server.ts +29 -0
- package/src/templates/web/micro-saas/template/src/lib/utils.ts +6 -0
- package/src/templates/web/micro-saas/template/tsconfig.json +27 -0
- package/dist/cli/commands/add.d.ts +0 -6
- package/dist/cli/commands/add.d.ts.map +0 -1
- package/dist/cli/commands/add.js +0 -39
- package/dist/cli/commands/add.js.map +0 -1
- package/dist/cli/commands/create.d.ts +0 -45
- package/dist/cli/commands/create.d.ts.map +0 -1
- package/dist/cli/commands/create.js +0 -175
- package/dist/cli/commands/create.js.map +0 -1
- package/dist/cli/commands/index.d.ts +0 -4
- package/dist/cli/commands/index.d.ts.map +0 -1
- package/dist/cli/commands/index.js +0 -20
- package/dist/cli/commands/index.js.map +0 -1
- package/dist/cli/commands/update.d.ts +0 -6
- package/dist/cli/commands/update.d.ts.map +0 -1
- package/dist/cli/commands/update.js +0 -68
- package/dist/cli/commands/update.js.map +0 -1
- package/dist/cli/index.d.ts +0 -4
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -61
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/prompts/index.d.ts +0 -2
- package/dist/cli/prompts/index.d.ts.map +0 -1
- package/dist/cli/prompts/index.js +0 -18
- package/dist/cli/prompts/index.js.map +0 -1
- package/dist/cli/prompts/project-setup.d.ts +0 -5
- package/dist/cli/prompts/project-setup.d.ts.map +0 -1
- package/dist/cli/prompts/project-setup.js +0 -316
- package/dist/cli/prompts/project-setup.js.map +0 -1
- package/dist/cli/utils/git.d.ts +0 -9
- package/dist/cli/utils/git.d.ts.map +0 -1
- package/dist/cli/utils/git.js +0 -77
- package/dist/cli/utils/git.js.map +0 -1
- package/dist/cli/utils/index.d.ts +0 -5
- package/dist/cli/utils/index.d.ts.map +0 -1
- package/dist/cli/utils/index.js +0 -21
- package/dist/cli/utils/index.js.map +0 -1
- package/dist/cli/utils/logger.d.ts +0 -16
- package/dist/cli/utils/logger.d.ts.map +0 -1
- package/dist/cli/utils/logger.js +0 -55
- package/dist/cli/utils/logger.js.map +0 -1
- package/dist/cli/utils/package-manager.d.ts +0 -8
- package/dist/cli/utils/package-manager.d.ts.map +0 -1
- package/dist/cli/utils/package-manager.js +0 -92
- package/dist/cli/utils/package-manager.js.map +0 -1
- package/dist/cli/utils/spinner.d.ts +0 -7
- package/dist/cli/utils/spinner.d.ts.map +0 -1
- package/dist/cli/utils/spinner.js +0 -48
- package/dist/cli/utils/spinner.js.map +0 -1
- package/dist/cli/validators/dependencies.d.ts +0 -15
- package/dist/cli/validators/dependencies.d.ts.map +0 -1
- package/dist/cli/validators/dependencies.js +0 -108
- package/dist/cli/validators/dependencies.js.map +0 -1
- package/dist/cli/validators/index.d.ts +0 -3
- package/dist/cli/validators/index.d.ts.map +0 -1
- package/dist/cli/validators/index.js +0 -19
- package/dist/cli/validators/index.js.map +0 -1
- package/dist/cli/validators/project-name.d.ts +0 -5
- package/dist/cli/validators/project-name.d.ts.map +0 -1
- package/dist/cli/validators/project-name.js +0 -151
- package/dist/cli/validators/project-name.js.map +0 -1
- package/dist/generators/file-processor.d.ts +0 -28
- package/dist/generators/file-processor.d.ts.map +0 -1
- package/dist/generators/file-processor.js +0 -224
- package/dist/generators/file-processor.js.map +0 -1
- package/dist/generators/index.d.ts +0 -4
- package/dist/generators/index.d.ts.map +0 -1
- package/dist/generators/index.js +0 -20
- package/dist/generators/index.js.map +0 -1
- package/dist/generators/package-installer.d.ts +0 -29
- package/dist/generators/package-installer.d.ts.map +0 -1
- package/dist/generators/package-installer.js +0 -177
- package/dist/generators/package-installer.js.map +0 -1
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { Metadata } from 'next';
|
|
2
|
+
import { LEGAL_CONFIG } from '@/lib/legal-config';
|
|
3
|
+
|
|
4
|
+
export const metadata: Metadata = {
|
|
5
|
+
title: `Privacy Policy | ${LEGAL_CONFIG.appName}`,
|
|
6
|
+
description: `Privacy Policy for ${LEGAL_CONFIG.appName}. Learn how we collect, use, and protect your data.`,
|
|
7
|
+
alternates: {
|
|
8
|
+
canonical: `${LEGAL_CONFIG.appUrl}/privacy`,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default function PrivacyPage() {
|
|
13
|
+
const {
|
|
14
|
+
appName,
|
|
15
|
+
companyName,
|
|
16
|
+
appUrl,
|
|
17
|
+
supportEmail,
|
|
18
|
+
privacyEmail,
|
|
19
|
+
effectiveDate,
|
|
20
|
+
thirdPartyServices,
|
|
21
|
+
usesAnalyticsCookies,
|
|
22
|
+
dataRetentionPeriod,
|
|
23
|
+
} = LEGAL_CONFIG;
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<main className="min-h-screen bg-white dark:bg-gray-950">
|
|
27
|
+
<div className="mx-auto max-w-3xl px-4 py-16 sm:px-6 lg:px-8">
|
|
28
|
+
<h1 className="mb-2 text-3xl font-bold tracking-tight text-gray-900 dark:text-white">
|
|
29
|
+
Privacy Policy
|
|
30
|
+
</h1>
|
|
31
|
+
<p className="mb-8 text-sm text-gray-500 dark:text-gray-400">
|
|
32
|
+
Effective: {effectiveDate}
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<div className="prose prose-gray dark:prose-invert max-w-none">
|
|
36
|
+
<section>
|
|
37
|
+
<h2>1. Information We Collect</h2>
|
|
38
|
+
<p>We collect information you provide directly:</p>
|
|
39
|
+
<ul>
|
|
40
|
+
<li>
|
|
41
|
+
<strong>Account data:</strong> name, email, profile information
|
|
42
|
+
</li>
|
|
43
|
+
<li>
|
|
44
|
+
<strong>Usage data:</strong> pages visited, features used,
|
|
45
|
+
interactions
|
|
46
|
+
</li>
|
|
47
|
+
<li>
|
|
48
|
+
<strong>Device data:</strong> browser type, IP address, operating
|
|
49
|
+
system
|
|
50
|
+
</li>
|
|
51
|
+
</ul>
|
|
52
|
+
</section>
|
|
53
|
+
|
|
54
|
+
<section>
|
|
55
|
+
<h2>2. How We Use Your Information</h2>
|
|
56
|
+
<ul>
|
|
57
|
+
<li>Provide and improve the service</li>
|
|
58
|
+
<li>Send transactional emails (account, security, updates)</li>
|
|
59
|
+
<li>Analyze usage patterns to improve user experience</li>
|
|
60
|
+
<li>Prevent fraud and enforce our terms</li>
|
|
61
|
+
<li>Comply with legal obligations</li>
|
|
62
|
+
</ul>
|
|
63
|
+
</section>
|
|
64
|
+
|
|
65
|
+
<section>
|
|
66
|
+
<h2>3. Information Sharing</h2>
|
|
67
|
+
<p>
|
|
68
|
+
We do not sell your personal data. We may share information with:
|
|
69
|
+
</p>
|
|
70
|
+
<ul>
|
|
71
|
+
<li>
|
|
72
|
+
<strong>Service providers:</strong> who help us operate{' '}
|
|
73
|
+
{appName}
|
|
74
|
+
</li>
|
|
75
|
+
<li>
|
|
76
|
+
<strong>Legal authorities:</strong> when required by law or to
|
|
77
|
+
protect rights
|
|
78
|
+
</li>
|
|
79
|
+
</ul>
|
|
80
|
+
{thirdPartyServices.length > 0 && (
|
|
81
|
+
<>
|
|
82
|
+
<p>Third-party services we use:</p>
|
|
83
|
+
<ul>
|
|
84
|
+
{thirdPartyServices.map((service) => (
|
|
85
|
+
<li key={service}>{service}</li>
|
|
86
|
+
))}
|
|
87
|
+
</ul>
|
|
88
|
+
</>
|
|
89
|
+
)}
|
|
90
|
+
</section>
|
|
91
|
+
|
|
92
|
+
<section>
|
|
93
|
+
<h2>4. Cookies</h2>
|
|
94
|
+
<p>We use cookies for:</p>
|
|
95
|
+
<ul>
|
|
96
|
+
<li>
|
|
97
|
+
<strong>Essential cookies:</strong> authentication, security,
|
|
98
|
+
preferences
|
|
99
|
+
</li>
|
|
100
|
+
{usesAnalyticsCookies && (
|
|
101
|
+
<li>
|
|
102
|
+
<strong>Analytics cookies:</strong> understanding how users
|
|
103
|
+
interact with {appName}
|
|
104
|
+
</li>
|
|
105
|
+
)}
|
|
106
|
+
</ul>
|
|
107
|
+
<p>
|
|
108
|
+
You can control cookies through your browser settings. Disabling
|
|
109
|
+
essential cookies may limit functionality.
|
|
110
|
+
</p>
|
|
111
|
+
</section>
|
|
112
|
+
|
|
113
|
+
<section>
|
|
114
|
+
<h2>5. Your Rights</h2>
|
|
115
|
+
<p>You have the right to:</p>
|
|
116
|
+
<ul>
|
|
117
|
+
<li>
|
|
118
|
+
<strong>Access:</strong> request a copy of your personal data
|
|
119
|
+
</li>
|
|
120
|
+
<li>
|
|
121
|
+
<strong>Rectification:</strong> correct inaccurate data
|
|
122
|
+
</li>
|
|
123
|
+
<li>
|
|
124
|
+
<strong>Erasure:</strong> request deletion of your data
|
|
125
|
+
</li>
|
|
126
|
+
<li>
|
|
127
|
+
<strong>Portability:</strong> receive your data in a portable
|
|
128
|
+
format
|
|
129
|
+
</li>
|
|
130
|
+
<li>
|
|
131
|
+
<strong>Objection:</strong> object to certain processing of your
|
|
132
|
+
data
|
|
133
|
+
</li>
|
|
134
|
+
</ul>
|
|
135
|
+
<p>
|
|
136
|
+
To exercise these rights, contact{' '}
|
|
137
|
+
<a href={`mailto:${privacyEmail}`}>{privacyEmail}</a>.
|
|
138
|
+
</p>
|
|
139
|
+
</section>
|
|
140
|
+
|
|
141
|
+
<section>
|
|
142
|
+
<h2>6. Data Security</h2>
|
|
143
|
+
<p>
|
|
144
|
+
We implement industry-standard security measures including
|
|
145
|
+
encryption in transit (TLS), encrypted storage, and access
|
|
146
|
+
controls. No method of transmission is 100% secure, but we strive
|
|
147
|
+
to protect your data.
|
|
148
|
+
</p>
|
|
149
|
+
</section>
|
|
150
|
+
|
|
151
|
+
<section>
|
|
152
|
+
<h2>7. Data Retention</h2>
|
|
153
|
+
<p>
|
|
154
|
+
We retain your data for as long as your account is active. After
|
|
155
|
+
deletion, data is retained for {dataRetentionPeriod} for legal and
|
|
156
|
+
operational purposes, then permanently deleted.
|
|
157
|
+
</p>
|
|
158
|
+
</section>
|
|
159
|
+
|
|
160
|
+
<section>
|
|
161
|
+
<h2>8. Children's Privacy</h2>
|
|
162
|
+
<p>
|
|
163
|
+
{appName} is not directed at children under 13. We do not
|
|
164
|
+
knowingly collect data from children. If you believe a child has
|
|
165
|
+
provided us data, contact us for removal.
|
|
166
|
+
</p>
|
|
167
|
+
</section>
|
|
168
|
+
|
|
169
|
+
<section>
|
|
170
|
+
<h2>9. International Transfers</h2>
|
|
171
|
+
<p>
|
|
172
|
+
Your data may be processed in countries outside your own. We
|
|
173
|
+
ensure appropriate safeguards are in place for such transfers in
|
|
174
|
+
compliance with applicable data protection laws.
|
|
175
|
+
</p>
|
|
176
|
+
</section>
|
|
177
|
+
|
|
178
|
+
<section>
|
|
179
|
+
<h2>10. Changes to This Policy</h2>
|
|
180
|
+
<p>
|
|
181
|
+
We may update this policy periodically. We will notify you of
|
|
182
|
+
material changes via email or prominent notice on {appName}.
|
|
183
|
+
Continued use after changes constitutes acceptance.
|
|
184
|
+
</p>
|
|
185
|
+
</section>
|
|
186
|
+
|
|
187
|
+
<section>
|
|
188
|
+
<h2>11. Contact</h2>
|
|
189
|
+
<p>
|
|
190
|
+
For privacy questions or data requests, contact us at{' '}
|
|
191
|
+
<a href={`mailto:${privacyEmail}`}>{privacyEmail}</a>.
|
|
192
|
+
</p>
|
|
193
|
+
<p>
|
|
194
|
+
{companyName}
|
|
195
|
+
<br />
|
|
196
|
+
{appUrl}
|
|
197
|
+
<br />
|
|
198
|
+
{supportEmail}
|
|
199
|
+
</p>
|
|
200
|
+
</section>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
</main>
|
|
204
|
+
);
|
|
205
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { Metadata } from 'next';
|
|
2
|
+
import { LEGAL_CONFIG } from '@/lib/legal-config';
|
|
3
|
+
|
|
4
|
+
export const metadata: Metadata = {
|
|
5
|
+
title: `Terms of Service | ${LEGAL_CONFIG.appName}`,
|
|
6
|
+
description: `Terms of Service for ${LEGAL_CONFIG.appName}. Read our terms and conditions.`,
|
|
7
|
+
alternates: {
|
|
8
|
+
canonical: `${LEGAL_CONFIG.appUrl}/terms`,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default function TermsPage() {
|
|
13
|
+
const {
|
|
14
|
+
appName,
|
|
15
|
+
companyName,
|
|
16
|
+
appUrl,
|
|
17
|
+
supportEmail,
|
|
18
|
+
effectiveDate,
|
|
19
|
+
minimumAge,
|
|
20
|
+
jurisdiction,
|
|
21
|
+
hasPayments,
|
|
22
|
+
platformFeePercent,
|
|
23
|
+
} = LEGAL_CONFIG;
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<main className="min-h-screen bg-white dark:bg-gray-950">
|
|
27
|
+
<div className="mx-auto max-w-3xl px-4 py-16 sm:px-6 lg:px-8">
|
|
28
|
+
<h1 className="mb-2 text-3xl font-bold tracking-tight text-gray-900 dark:text-white">
|
|
29
|
+
Terms of Service
|
|
30
|
+
</h1>
|
|
31
|
+
<p className="mb-8 text-sm text-gray-500 dark:text-gray-400">
|
|
32
|
+
Effective: {effectiveDate}
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<div className="prose prose-gray dark:prose-invert max-w-none">
|
|
36
|
+
<section>
|
|
37
|
+
<h2>1. Acceptance of Terms</h2>
|
|
38
|
+
<p>
|
|
39
|
+
By accessing or using {appName} ({appUrl}), you agree to be bound
|
|
40
|
+
by these Terms of Service. If you do not agree, do not use the
|
|
41
|
+
service.
|
|
42
|
+
</p>
|
|
43
|
+
</section>
|
|
44
|
+
|
|
45
|
+
{minimumAge > 0 && (
|
|
46
|
+
<section>
|
|
47
|
+
<h2>2. Age Requirement</h2>
|
|
48
|
+
<p>
|
|
49
|
+
You must be at least {minimumAge} years old to use {appName}. By
|
|
50
|
+
using this service, you represent that you meet this age
|
|
51
|
+
requirement.
|
|
52
|
+
</p>
|
|
53
|
+
</section>
|
|
54
|
+
)}
|
|
55
|
+
|
|
56
|
+
<section>
|
|
57
|
+
<h2>{minimumAge > 0 ? '3' : '2'}. User Accounts</h2>
|
|
58
|
+
<p>
|
|
59
|
+
You are responsible for maintaining the confidentiality of your
|
|
60
|
+
account credentials and for all activities under your account.
|
|
61
|
+
Notify us immediately of any unauthorized use.
|
|
62
|
+
</p>
|
|
63
|
+
</section>
|
|
64
|
+
|
|
65
|
+
<section>
|
|
66
|
+
<h2>{minimumAge > 0 ? '4' : '3'}. Acceptable Use</h2>
|
|
67
|
+
<p>You agree not to:</p>
|
|
68
|
+
<ul>
|
|
69
|
+
<li>Violate any applicable laws or regulations</li>
|
|
70
|
+
<li>
|
|
71
|
+
Upload harmful, offensive, or infringing content
|
|
72
|
+
</li>
|
|
73
|
+
<li>Attempt to access other users' accounts</li>
|
|
74
|
+
<li>
|
|
75
|
+
Use automated tools to scrape or interfere with the service
|
|
76
|
+
</li>
|
|
77
|
+
<li>Impersonate any person or entity</li>
|
|
78
|
+
</ul>
|
|
79
|
+
</section>
|
|
80
|
+
|
|
81
|
+
{hasPayments && (
|
|
82
|
+
<section>
|
|
83
|
+
<h2>{minimumAge > 0 ? '5' : '4'}. Payments & Fees</h2>
|
|
84
|
+
<p>
|
|
85
|
+
Payments are processed securely through Stripe. All fees are
|
|
86
|
+
listed at the time of purchase.
|
|
87
|
+
{Number(platformFeePercent) > 0 &&
|
|
88
|
+
` ${appName} charges a ${platformFeePercent}% platform fee on applicable transactions.`}
|
|
89
|
+
</p>
|
|
90
|
+
<p>
|
|
91
|
+
Refund policies are described at the point of sale. You are
|
|
92
|
+
responsible for any applicable taxes on your purchases.
|
|
93
|
+
</p>
|
|
94
|
+
</section>
|
|
95
|
+
)}
|
|
96
|
+
|
|
97
|
+
<section>
|
|
98
|
+
<h2>Intellectual Property</h2>
|
|
99
|
+
<p>
|
|
100
|
+
{appName} and its original content, features, and functionality
|
|
101
|
+
are owned by {companyName}. You retain ownership of content you
|
|
102
|
+
submit but grant us a license to display it as part of the
|
|
103
|
+
service.
|
|
104
|
+
</p>
|
|
105
|
+
</section>
|
|
106
|
+
|
|
107
|
+
<section>
|
|
108
|
+
<h2>Termination</h2>
|
|
109
|
+
<p>
|
|
110
|
+
We may suspend or terminate your account for violations of these
|
|
111
|
+
terms. You may delete your account at any time. Upon termination,
|
|
112
|
+
your right to use the service ceases immediately.
|
|
113
|
+
</p>
|
|
114
|
+
</section>
|
|
115
|
+
|
|
116
|
+
<section>
|
|
117
|
+
<h2>Limitation of Liability</h2>
|
|
118
|
+
<p>
|
|
119
|
+
{appName} is provided "as is" without warranties of any
|
|
120
|
+
kind. {companyName} shall not be liable for any indirect,
|
|
121
|
+
incidental, or consequential damages arising from your use of the
|
|
122
|
+
service.
|
|
123
|
+
</p>
|
|
124
|
+
</section>
|
|
125
|
+
|
|
126
|
+
<section>
|
|
127
|
+
<h2>Governing Law</h2>
|
|
128
|
+
<p>
|
|
129
|
+
These terms are governed by the laws of {jurisdiction}. Any
|
|
130
|
+
disputes shall be resolved in the courts of {jurisdiction}.
|
|
131
|
+
</p>
|
|
132
|
+
</section>
|
|
133
|
+
|
|
134
|
+
<section>
|
|
135
|
+
<h2>Changes to Terms</h2>
|
|
136
|
+
<p>
|
|
137
|
+
We may update these terms at any time. Continued use after changes
|
|
138
|
+
constitutes acceptance. We will notify registered users of
|
|
139
|
+
material changes via email.
|
|
140
|
+
</p>
|
|
141
|
+
</section>
|
|
142
|
+
|
|
143
|
+
<section>
|
|
144
|
+
<h2>Contact</h2>
|
|
145
|
+
<p>
|
|
146
|
+
Questions about these terms? Contact us at{' '}
|
|
147
|
+
<a href={`mailto:${supportEmail}`}>{supportEmail}</a>.
|
|
148
|
+
</p>
|
|
149
|
+
</section>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</main>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legal page configuration.
|
|
3
|
+
*
|
|
4
|
+
* Update these values to match your app's legal details.
|
|
5
|
+
* Used by the Terms of Service and Privacy Policy pages.
|
|
6
|
+
*/
|
|
7
|
+
export const LEGAL_CONFIG = {
|
|
8
|
+
/** App display name */
|
|
9
|
+
appName: 'My App',
|
|
10
|
+
|
|
11
|
+
/** Company or entity name */
|
|
12
|
+
companyName: 'My Company',
|
|
13
|
+
|
|
14
|
+
/** Production URL (no trailing slash) */
|
|
15
|
+
appUrl: process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000',
|
|
16
|
+
|
|
17
|
+
/** Support email address */
|
|
18
|
+
supportEmail: 'support@example.com',
|
|
19
|
+
|
|
20
|
+
/** Privacy-specific contact email */
|
|
21
|
+
privacyEmail: 'privacy@example.com',
|
|
22
|
+
|
|
23
|
+
/** Date the terms/privacy were last updated */
|
|
24
|
+
effectiveDate: 'January 1, 2026',
|
|
25
|
+
|
|
26
|
+
/** Minimum age requirement (0 to disable) */
|
|
27
|
+
minimumAge: 18,
|
|
28
|
+
|
|
29
|
+
/** Jurisdiction / governing law */
|
|
30
|
+
jurisdiction: 'the United States',
|
|
31
|
+
|
|
32
|
+
/** Whether the app processes payments */
|
|
33
|
+
hasPayments: true,
|
|
34
|
+
|
|
35
|
+
/** Platform fee percentage (if applicable) */
|
|
36
|
+
platformFeePercent: '0',
|
|
37
|
+
|
|
38
|
+
/** Whether the app uses cookies beyond essentials */
|
|
39
|
+
usesAnalyticsCookies: true,
|
|
40
|
+
|
|
41
|
+
/** Third-party services used (listed in privacy policy) */
|
|
42
|
+
thirdPartyServices: [
|
|
43
|
+
'Stripe (payment processing)',
|
|
44
|
+
'Cloudflare (CDN and security)',
|
|
45
|
+
'Resend (transactional email)',
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
/** Data retention period */
|
|
49
|
+
dataRetentionPeriod: '3 years after account deletion',
|
|
50
|
+
} as const;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable skeleton loading components.
|
|
3
|
+
*
|
|
4
|
+
* Use these in loading.tsx files for consistent loading states.
|
|
5
|
+
* All components use Tailwind's animate-pulse for the shimmer effect.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** Base skeleton block with customizable dimensions */
|
|
9
|
+
export function Skeleton({
|
|
10
|
+
className = '',
|
|
11
|
+
}: {
|
|
12
|
+
className?: string;
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
className={`animate-pulse rounded bg-gray-200 dark:bg-gray-800 ${className}`}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Skeleton for a card with title, description, and action area */
|
|
22
|
+
export function CardSkeleton() {
|
|
23
|
+
return (
|
|
24
|
+
<div className="rounded-lg border border-gray-200 p-6 dark:border-gray-800">
|
|
25
|
+
<Skeleton className="mb-4 h-4 w-3/4" />
|
|
26
|
+
<Skeleton className="mb-2 h-3 w-full" />
|
|
27
|
+
<Skeleton className="mb-4 h-3 w-5/6" />
|
|
28
|
+
<Skeleton className="h-8 w-24" />
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Skeleton for a grid of cards */
|
|
34
|
+
export function CardGridSkeleton({ count = 6 }: { count?: number }) {
|
|
35
|
+
return (
|
|
36
|
+
<div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
|
37
|
+
{Array.from({ length: count }, (_, i) => (
|
|
38
|
+
<CardSkeleton key={i} />
|
|
39
|
+
))}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Skeleton for a table with rows */
|
|
45
|
+
export function TableSkeleton({ rows = 5 }: { rows?: number }) {
|
|
46
|
+
return (
|
|
47
|
+
<div className="space-y-3">
|
|
48
|
+
{/* Header */}
|
|
49
|
+
<div className="flex gap-4 border-b border-gray-200 pb-3 dark:border-gray-800">
|
|
50
|
+
<Skeleton className="h-4 w-1/4" />
|
|
51
|
+
<Skeleton className="h-4 w-1/3" />
|
|
52
|
+
<Skeleton className="h-4 w-1/4" />
|
|
53
|
+
<Skeleton className="h-4 w-1/6" />
|
|
54
|
+
</div>
|
|
55
|
+
{/* Rows */}
|
|
56
|
+
{Array.from({ length: rows }, (_, i) => (
|
|
57
|
+
<div key={i} className="flex gap-4 py-2">
|
|
58
|
+
<Skeleton className="h-4 w-1/4" />
|
|
59
|
+
<Skeleton className="h-4 w-1/3" />
|
|
60
|
+
<Skeleton className="h-4 w-1/4" />
|
|
61
|
+
<Skeleton className="h-4 w-1/6" />
|
|
62
|
+
</div>
|
|
63
|
+
))}
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Skeleton for a full page with hero and content */
|
|
69
|
+
export function PageSkeleton() {
|
|
70
|
+
return (
|
|
71
|
+
<div className="mx-auto max-w-4xl px-4 py-8">
|
|
72
|
+
{/* Hero */}
|
|
73
|
+
<Skeleton className="mb-4 h-8 w-2/3" />
|
|
74
|
+
<Skeleton className="mb-8 h-4 w-1/2" />
|
|
75
|
+
{/* Content blocks */}
|
|
76
|
+
<div className="space-y-4">
|
|
77
|
+
<Skeleton className="h-4 w-full" />
|
|
78
|
+
<Skeleton className="h-4 w-5/6" />
|
|
79
|
+
<Skeleton className="h-4 w-4/5" />
|
|
80
|
+
<Skeleton className="h-32 w-full" />
|
|
81
|
+
<Skeleton className="h-4 w-full" />
|
|
82
|
+
<Skeleton className="h-4 w-3/4" />
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Default loading spinner for loading.tsx files */
|
|
89
|
+
export function LoadingSpinner() {
|
|
90
|
+
return (
|
|
91
|
+
<div className="flex min-h-[50vh] items-center justify-center">
|
|
92
|
+
<div className="h-8 w-8 animate-spin rounded-full border-4 border-gray-200 border-t-blue-600 dark:border-gray-700 dark:border-t-blue-400" />
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Next.js Middleware (Edge Runtime)
|
|
3
|
+
*
|
|
4
|
+
* IMPORTANT: This file runs in the Edge runtime. Do NOT import:
|
|
5
|
+
* - Server-only modules (ioredis, pg, nodemailer)
|
|
6
|
+
* - The main platform-core barrel (pulls in node:stream)
|
|
7
|
+
* - auth.ts (server-only) — use auth.config.ts instead
|
|
8
|
+
*
|
|
9
|
+
* Use @digilogiclabs/platform-core/auth subpath for Edge-safe imports.
|
|
10
|
+
*/
|
|
11
|
+
import NextAuth from 'next-auth';
|
|
12
|
+
import { authConfig } from './auth.config';
|
|
13
|
+
|
|
14
|
+
const { auth } = NextAuth(authConfig);
|
|
15
|
+
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Route definitions
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
/** Routes that require authentication */
|
|
21
|
+
const protectedRoutes = ['/dashboard', '/settings', '/account'];
|
|
22
|
+
|
|
23
|
+
/** Routes that are always public */
|
|
24
|
+
const publicRoutes = ['/', '/auth/signin', '/auth/signup', '/api/health', '/api/auth'];
|
|
25
|
+
|
|
26
|
+
/** Admin-only routes */
|
|
27
|
+
const adminRoutes = ['/admin'];
|
|
28
|
+
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Middleware handler
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
export default auth((req) => {
|
|
34
|
+
const { pathname } = req.nextUrl;
|
|
35
|
+
const session = req.auth;
|
|
36
|
+
|
|
37
|
+
// Allow public routes and API routes
|
|
38
|
+
if (publicRoutes.some((r) => pathname.startsWith(r))) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Allow static files and Next.js internals
|
|
43
|
+
if (pathname.startsWith('/_next') || pathname.startsWith('/favicon') || pathname.includes('.')) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Check authentication for protected routes
|
|
48
|
+
const isProtected = protectedRoutes.some((r) => pathname.startsWith(r));
|
|
49
|
+
const isAdmin = adminRoutes.some((r) => pathname.startsWith(r));
|
|
50
|
+
|
|
51
|
+
if ((isProtected || isAdmin) && !session) {
|
|
52
|
+
const signInUrl = new URL('/auth/signin', req.url);
|
|
53
|
+
signInUrl.searchParams.set('callbackUrl', pathname);
|
|
54
|
+
return Response.redirect(signInUrl);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Check admin role
|
|
58
|
+
if (isAdmin && session) {
|
|
59
|
+
const roles = (session.user as { roles?: string[] })?.roles || [];
|
|
60
|
+
if (!roles.includes('admin')) {
|
|
61
|
+
return Response.redirect(new URL('/dashboard', req.url));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export const config = {
|
|
67
|
+
matcher: ['/((?!_next/static|_next/image|favicon.ico|.*\\..*).*)'],
|
|
68
|
+
};
|