@sibyllinesoft/arbiter 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.
- package/README.md +222 -0
- package/dist/cli.js +28718 -0
- package/dist/templates/plopfiles/__tests__/build-systems.test.ts +730 -0
- package/dist/templates/plopfiles/__tests__/e2e.test.ts +451 -0
- package/dist/templates/plopfiles/__tests__/generation.test.ts +384 -0
- package/dist/templates/plopfiles/__tests__/linting.test.ts +854 -0
- package/dist/templates/plopfiles/__tests__/modules.test.ts +278 -0
- package/dist/templates/plopfiles/__tests__/smoke.test.ts +619 -0
- package/dist/templates/plopfiles/__tests__/templates.test.ts +341 -0
- package/dist/templates/plopfiles/_modules/backends/go-chi/module.js +43 -0
- package/dist/templates/plopfiles/_modules/backends/go-chi/templates/.air.toml.hbs +30 -0
- package/dist/templates/plopfiles/_modules/backends/go-chi/templates/cmd/server/main.go.hbs +50 -0
- package/dist/templates/plopfiles/_modules/backends/go-chi/templates/go.mod.hbs +9 -0
- package/dist/templates/plopfiles/_modules/backends/go-chi/templates/internal/handlers/health.go.hbs +51 -0
- package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/module.js +38 -0
- package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/build.gradle.kts.hbs +37 -0
- package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/settings.gradle.kts.hbs +1 -0
- package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/src/main/kotlin/Application.kt.hbs +44 -0
- package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/src/main/kotlin/routes/Health.kt.hbs +41 -0
- package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/src/main/resources/logback.xml.hbs +11 -0
- package/dist/templates/plopfiles/_modules/backends/node-express/module.js +54 -0
- package/dist/templates/plopfiles/_modules/backends/node-express/templates/src/index.ts.hbs +37 -0
- package/dist/templates/plopfiles/_modules/backends/node-express/templates/src/routes/health.ts.hbs +21 -0
- package/dist/templates/plopfiles/_modules/backends/node-express/templates/tsconfig.json.hbs +18 -0
- package/dist/templates/plopfiles/_modules/backends/node-hono/module.js +56 -0
- package/dist/templates/plopfiles/_modules/backends/node-hono/templates/src/index.ts.hbs +30 -0
- package/dist/templates/plopfiles/_modules/backends/node-hono/templates/src/routes/health.ts.hbs +64 -0
- package/dist/templates/plopfiles/_modules/backends/node-hono/templates/src/routes/index.ts.hbs +38 -0
- package/dist/templates/plopfiles/_modules/backends/node-hono/templates/tsconfig.json.hbs +20 -0
- package/dist/templates/plopfiles/_modules/backends/node-hono/templates/typedoc.json.hbs +25 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/module.js +65 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/__init__.py.hbs +1 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/config.py.hbs +28 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/main.py.hbs +40 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/routers/__init__.py.hbs +1 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/routers/health.py.hbs +24 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/pyproject.toml.hbs +40 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/requirements.txt.hbs +6 -0
- package/dist/templates/plopfiles/_modules/backends/rust-axum/module.js +44 -0
- package/dist/templates/plopfiles/_modules/backends/rust-axum/templates/Cargo.toml.hbs +23 -0
- package/dist/templates/plopfiles/_modules/backends/rust-axum/templates/src/health.rs.hbs +41 -0
- package/dist/templates/plopfiles/_modules/backends/rust-axum/templates/src/main.rs.hbs +57 -0
- package/dist/templates/plopfiles/_modules/cloud/aws/module.js +33 -0
- package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws-alb.tf.hbs +92 -0
- package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws-ecs.tf.hbs +84 -0
- package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws-iam.tf.hbs +60 -0
- package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws-vpc.tf.hbs +106 -0
- package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws.tf.hbs +56 -0
- package/dist/templates/plopfiles/_modules/cloud/azure/module.js +31 -0
- package/dist/templates/plopfiles/_modules/cloud/azure/templates/azure-container-apps.tf.hbs +99 -0
- package/dist/templates/plopfiles/_modules/cloud/azure/templates/azure.tf.hbs +54 -0
- package/dist/templates/plopfiles/_modules/cloud/cloudflare/module.js +43 -0
- package/dist/templates/plopfiles/_modules/cloud/cloudflare/templates/src/types.d.ts.hbs +6 -0
- package/dist/templates/plopfiles/_modules/cloud/cloudflare/templates/src/worker.ts.hbs +51 -0
- package/dist/templates/plopfiles/_modules/cloud/cloudflare/templates/wrangler.toml.hbs +36 -0
- package/dist/templates/plopfiles/_modules/cloud/gcp/module.js +31 -0
- package/dist/templates/plopfiles/_modules/cloud/gcp/templates/gcp-cloudrun.tf.hbs +89 -0
- package/dist/templates/plopfiles/_modules/cloud/gcp/templates/gcp.tf.hbs +62 -0
- package/dist/templates/plopfiles/_modules/cloud/supabase/module.js +51 -0
- package/dist/templates/plopfiles/_modules/cloud/supabase/templates/src/lib/supabase.ts.hbs +25 -0
- package/dist/templates/plopfiles/_modules/cloud/supabase/templates/src/types/supabase.ts.hbs +52 -0
- package/dist/templates/plopfiles/_modules/cloud/supabase/templates/supabase/config.toml.hbs +71 -0
- package/dist/templates/plopfiles/_modules/cloud/supabase/templates/supabase/functions/hello/index.ts.hbs +34 -0
- package/dist/templates/plopfiles/_modules/cloud/supabase/templates/supabase/migrations/00000000000000_init.sql.hbs +60 -0
- package/dist/templates/plopfiles/_modules/composer.js +180 -0
- package/dist/templates/plopfiles/_modules/databases/postgres-drizzle/drizzle.config.ts.hbs +10 -0
- package/dist/templates/plopfiles/_modules/databases/postgres-drizzle/module.js +53 -0
- package/dist/templates/plopfiles/_modules/databases/postgres-drizzle/templates/index.ts.hbs +15 -0
- package/dist/templates/plopfiles/_modules/databases/postgres-drizzle/templates/schema.ts.hbs +21 -0
- package/dist/templates/plopfiles/_modules/desktop/electron/module.js +51 -0
- package/dist/templates/plopfiles/_modules/desktop/electron/templates/forge.config.ts.hbs +38 -0
- package/dist/templates/plopfiles/_modules/desktop/electron/templates/package.json.hbs +22 -0
- package/dist/templates/plopfiles/_modules/desktop/electron/templates/src/main.ts.hbs +48 -0
- package/dist/templates/plopfiles/_modules/desktop/electron/templates/src/preload.ts.hbs +18 -0
- package/dist/templates/plopfiles/_modules/desktop/electron/templates/tsconfig.json.hbs +14 -0
- package/dist/templates/plopfiles/_modules/desktop/tauri/module.js +38 -0
- package/dist/templates/plopfiles/_modules/desktop/tauri/templates/src-tauri/Cargo.toml.hbs +20 -0
- package/dist/templates/plopfiles/_modules/desktop/tauri/templates/src-tauri/build.rs.hbs +3 -0
- package/dist/templates/plopfiles/_modules/desktop/tauri/templates/src-tauri/src/main.rs.hbs +30 -0
- package/dist/templates/plopfiles/_modules/desktop/tauri/templates/src-tauri/tauri.conf.json.hbs +44 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/module.js +61 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/architecture/components.md.hbs +37 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/architecture/overview.md.hbs +43 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/contributing/development.md.hbs +164 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/contributing/guidelines.md.hbs +50 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/getting-started/configuration.md.hbs +37 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/getting-started/installation.md.hbs +53 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/getting-started/quickstart.md.hbs +39 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/index.md.hbs +44 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/javascripts/extra.js.hbs +23 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/stylesheets/extra.css.hbs +51 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/mkdocs.yml.hbs +141 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/requirements-docs.txt.hbs +15 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/scripts/aggregate-docs.mjs.hbs +188 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/scripts/gen_ref_pages.py.hbs +54 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/module.js +60 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/index.html.hbs +13 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/nginx.conf.hbs +31 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/postcss.config.js.hbs +6 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/App.tsx.hbs +12 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/index.css.hbs +25 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/lib/api.ts.hbs +52 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/main.tsx.hbs +18 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/pages/Home.tsx.hbs +31 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/tailwind.config.js.hbs +8 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/tsconfig.json.hbs +25 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/tsconfig.node.json.hbs +10 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/vite.config.ts.hbs +21 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/module.js +51 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/index.html.hbs +13 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/postcss.config.js.hbs +6 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/App.tsx.hbs +12 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/index.css.hbs +3 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/index.tsx.hbs +21 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/lib/api.ts.hbs +52 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/pages/Home.tsx.hbs +34 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/tailwind.config.js.hbs +8 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/tsconfig.json.hbs +24 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/vite.config.ts.hbs +21 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/module.js +54 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/index.html.hbs +13 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/postcss.config.js.hbs +6 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/App.vue.hbs +9 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/index.css.hbs +3 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/lib/api.ts.hbs +52 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/main.ts.hbs +14 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/pages/Home.vue.hbs +27 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/router.ts.hbs +13 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/tailwind.config.js.hbs +8 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/tsconfig.json.hbs +25 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/vite.config.ts.hbs +21 -0
- package/dist/templates/plopfiles/_modules/infra/docker-compose/module.js +52 -0
- package/dist/templates/plopfiles/_modules/infra/docker-compose/templates/Dockerfile.backend.hbs +32 -0
- package/dist/templates/plopfiles/_modules/infra/docker-compose/templates/Dockerfile.frontend.hbs +31 -0
- package/dist/templates/plopfiles/_modules/infra/docker-compose/templates/docker-compose.yml.hbs +97 -0
- package/dist/templates/plopfiles/_modules/infra/github-actions/module.js +24 -0
- package/dist/templates/plopfiles/_modules/infra/github-actions/templates/.github/workflows/ci.yml.hbs +78 -0
- package/dist/templates/plopfiles/_modules/infra/github-actions/templates/.github/workflows/deploy.yml.hbs +60 -0
- package/dist/templates/plopfiles/_modules/infra/just/module.js +26 -0
- package/dist/templates/plopfiles/_modules/infra/just/templates/justfile.hbs +205 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/module.js +30 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/base/deployment.yaml.hbs +48 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/base/ingress.yaml.hbs +23 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/base/kustomization.yaml.hbs +11 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/base/service.yaml.hbs +15 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/overlays/dev/deployment-patch.yaml.hbs +17 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/overlays/dev/kustomization.yaml.hbs +15 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/overlays/prod/deployment-patch.yaml.hbs +17 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/overlays/prod/kustomization.yaml.hbs +15 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/module.js +30 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/templates/.gitignore.hbs +5 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/templates/Pulumi.dev.yaml.hbs +3 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/templates/Pulumi.yaml.hbs +7 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/templates/index.ts.hbs +26 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/templates/package.json.hbs +12 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/templates/tsconfig.json.hbs +16 -0
- package/dist/templates/plopfiles/_modules/infra/terraform/module.js +31 -0
- package/dist/templates/plopfiles/_modules/infra/terraform/templates/.gitignore.hbs +12 -0
- package/dist/templates/plopfiles/_modules/infra/terraform/templates/main.tf.hbs +34 -0
- package/dist/templates/plopfiles/_modules/infra/terraform/templates/outputs.tf.hbs +15 -0
- package/dist/templates/plopfiles/_modules/infra/terraform/templates/terraform.tfvars.example.hbs +6 -0
- package/dist/templates/plopfiles/_modules/infra/terraform/templates/variables.tf.hbs +30 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/module.js +38 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/build.gradle.kts.hbs +102 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/proguard-rules.pro.hbs +20 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/AndroidManifest.xml.hbs +25 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/ApiClient.kt.hbs +38 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/App.kt.hbs +116 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/MainActivity.kt.hbs +28 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/ui/theme/Color.kt.hbs +11 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/ui/theme/Theme.kt.hbs +55 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/ui/theme/Type.kt.hbs +31 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/res/values/strings.xml.hbs +3 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/res/values/themes.xml.hbs +4 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/build.gradle.kts.hbs +6 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/gradle.properties.hbs +4 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/settings.gradle.kts.hbs +18 -0
- package/dist/templates/plopfiles/_modules/mobile/flutter/module.js +36 -0
- package/dist/templates/plopfiles/_modules/mobile/flutter/templates/.env.hbs +1 -0
- package/dist/templates/plopfiles/_modules/mobile/flutter/templates/lib/main.dart.hbs +29 -0
- package/dist/templates/plopfiles/_modules/mobile/flutter/templates/lib/screens/home_screen.dart.hbs +88 -0
- package/dist/templates/plopfiles/_modules/mobile/flutter/templates/lib/services/api_service.dart.hbs +61 -0
- package/dist/templates/plopfiles/_modules/mobile/flutter/templates/pubspec.yaml.hbs +25 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/module.js +39 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/App.swift.hbs +10 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Assets.xcassets/AccentColor.colorset/Contents.json.hbs +11 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Assets.xcassets/AppIcon.appiconset/Contents.json.hbs +13 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Assets.xcassets/Contents.json.hbs +6 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/ContentView.swift.hbs +13 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Services/APIClient.swift.hbs +58 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Views/DetailsView.swift.hbs +22 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Views/HomeView.swift.hbs +62 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App.xcodeproj/project.pbxproj.hbs +363 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/module.js +36 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/templates/app/_layout.tsx.hbs +16 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/templates/app/index.tsx.hbs +66 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/templates/app.json.hbs +37 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/templates/package.json.hbs +29 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/templates/src/lib/api.ts.hbs +52 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/templates/tsconfig.json.hbs +11 -0
- package/dist/templates/plopfiles/_modules/quality/biome/module.js +44 -0
- package/dist/templates/plopfiles/_modules/quality/biome/templates/biome.json.hbs +126 -0
- package/dist/templates/plopfiles/_modules/quality/clippy/module.js +40 -0
- package/dist/templates/plopfiles/_modules/quality/clippy/templates/clippy.toml.hbs +29 -0
- package/dist/templates/plopfiles/_modules/quality/clippy/templates/rustfmt.toml.hbs +44 -0
- package/dist/templates/plopfiles/_modules/quality/golangci-lint/module.js +40 -0
- package/dist/templates/plopfiles/_modules/quality/golangci-lint/templates/.golangci.yml.hbs +199 -0
- package/dist/templates/plopfiles/_modules/quality/ruff/module.js +43 -0
- package/dist/templates/plopfiles/_modules/quality/ruff/templates/mypy.ini.hbs +48 -0
- package/dist/templates/plopfiles/_modules/quality/ruff/templates/ruff.toml.hbs +111 -0
- package/dist/templates/plopfiles/_modules/storybook/react-storybook/module.js +54 -0
- package/dist/templates/plopfiles/_modules/storybook/react-storybook/templates/.storybook/main.ts.hbs +44 -0
- package/dist/templates/plopfiles/_modules/storybook/react-storybook/templates/.storybook/preview.ts.hbs +68 -0
- package/dist/templates/plopfiles/_modules/storybook/react-storybook/templates/src/stories/Button.stories.tsx.hbs +158 -0
- package/dist/templates/plopfiles/_modules/types.ts +98 -0
- package/dist/templates/plopfiles/full-stack/plopfile.js +132 -0
- package/dist/templates/plopfiles/full-stack/templates/gitignore.hbs +44 -0
- package/dist/templates/plopfiles/full-stack/templates/package.json.hbs +21 -0
- package/dist/templates/plopfiles/presets/cli-go/module.js +43 -0
- package/dist/templates/plopfiles/presets/cli-go/templates/README.md.hbs +42 -0
- package/dist/templates/plopfiles/presets/cli-go/templates/config.json.hbs +9 -0
- package/dist/templates/plopfiles/presets/cli-node/module.js +45 -0
- package/dist/templates/plopfiles/presets/cli-node/templates/README.md.hbs +42 -0
- package/dist/templates/plopfiles/presets/cli-node/templates/config.json.hbs +9 -0
- package/dist/templates/plopfiles/presets/cli-python/module.js +43 -0
- package/dist/templates/plopfiles/presets/cli-python/templates/README.md.hbs +42 -0
- package/dist/templates/plopfiles/presets/cli-python/templates/config.json.hbs +9 -0
- package/dist/templates/plopfiles/presets/cli-rust/module.js +43 -0
- package/dist/templates/plopfiles/presets/cli-rust/templates/README.md.hbs +42 -0
- package/dist/templates/plopfiles/presets/cli-rust/templates/config.json.hbs +9 -0
- package/dist/templates/plopfiles/presets/loader.js +125 -0
- package/dist/templates/plopfiles/typescript-service/plopfile.js +186 -0
- package/dist/templates/plopfiles/typescript-service/templates/Dockerfile.hbs +29 -0
- package/dist/templates/plopfiles/typescript-service/templates/README.md.hbs +85 -0
- package/dist/templates/plopfiles/typescript-service/templates/config.ts.hbs +15 -0
- package/dist/templates/plopfiles/typescript-service/templates/db/index.ts.hbs +19 -0
- package/dist/templates/plopfiles/typescript-service/templates/db/schema.ts.hbs +16 -0
- package/dist/templates/plopfiles/typescript-service/templates/index.ts.hbs +89 -0
- package/dist/templates/plopfiles/typescript-service/templates/package.json.hbs +36 -0
- package/dist/templates/plopfiles/typescript-service/templates/routes/health.ts.hbs +61 -0
- package/dist/templates/plopfiles/typescript-service/templates/routes/index.ts.hbs +35 -0
- package/dist/templates/plopfiles/typescript-service/templates/tsconfig.json.hbs +24 -0
- package/dist/templates/plopfiles/typescript-service/templates/types.ts.hbs +28 -0
- package/dist/templates/typescript/component.module.css.tpl +6 -0
- package/dist/templates/typescript/component.test.tsx.tpl +9 -0
- package/dist/templates/typescript/component.tsx.tpl +17 -0
- package/dist/templates/typescript/component.types.ts.tpl +3 -0
- package/dist/templates/typescript/project/nextjs/app/globals.css.tpl +10 -0
- package/dist/templates/typescript/project/nextjs/app/layout.tsx.tpl +15 -0
- package/dist/templates/typescript/project/nextjs/app/page.tsx.tpl +8 -0
- package/dist/templates/typescript/project/nextjs/babel.config.js.tpl +8 -0
- package/dist/templates/typescript/project/nextjs/jest.config.js.tpl +10 -0
- package/dist/templates/typescript/project/nextjs/jest.setup.ts.tpl +6 -0
- package/dist/templates/typescript/project/nextjs/next-env.d.ts.tpl +5 -0
- package/dist/templates/typescript/project/nextjs/next.config.js.tpl +9 -0
- package/dist/templates/typescript/project/nextjs/package.json.tpl +1 -0
- package/dist/templates/typescript/project/nextjs/tsconfig.json.tpl +1 -0
- package/dist/templates/typescript/project/vite/App.css.tpl +8 -0
- package/dist/templates/typescript/project/vite/App.tsx.tpl +17 -0
- package/dist/templates/typescript/project/vite/index.css.tpl +8 -0
- package/dist/templates/typescript/project/vite/index.html.tpl +13 -0
- package/dist/templates/typescript/project/vite/main.tsx.tpl +10 -0
- package/dist/templates/typescript/project/vite/package.json.tpl +1 -0
- package/dist/templates/typescript/project/vite/test-setup.ts.tpl +1 -0
- package/dist/templates/typescript/project/vite/tsconfig.build.json.tpl +1 -0
- package/dist/templates/typescript/project/vite/tsconfig.json.tpl +1 -0
- package/dist/templates/typescript/project/vite/tsconfig.node.json.tpl +1 -0
- package/dist/templates/typescript/project/vite/vite.config.ts.tpl +18 -0
- package/dist/templates/typescript/service.api.ts.tpl +27 -0
- package/dist/templates/typescript/service.class.ts.tpl +28 -0
- package/dist/templates/typescript/service.handler.ts.tpl +42 -0
- package/dist/templates/typescript/service.schema.ts.tpl +16 -0
- package/package.json +95 -0
- package/templates/typescript/component.module.css.tpl +6 -0
- package/templates/typescript/component.test.tsx.tpl +9 -0
- package/templates/typescript/component.tsx.tpl +17 -0
- package/templates/typescript/component.types.ts.tpl +3 -0
- package/templates/typescript/project/nextjs/app/globals.css.tpl +10 -0
- package/templates/typescript/project/nextjs/app/layout.tsx.tpl +15 -0
- package/templates/typescript/project/nextjs/app/page.tsx.tpl +8 -0
- package/templates/typescript/project/nextjs/babel.config.js.tpl +8 -0
- package/templates/typescript/project/nextjs/jest.config.js.tpl +10 -0
- package/templates/typescript/project/nextjs/jest.setup.ts.tpl +6 -0
- package/templates/typescript/project/nextjs/next-env.d.ts.tpl +5 -0
- package/templates/typescript/project/nextjs/next.config.js.tpl +9 -0
- package/templates/typescript/project/nextjs/package.json.tpl +1 -0
- package/templates/typescript/project/nextjs/tsconfig.json.tpl +1 -0
- package/templates/typescript/project/vite/App.css.tpl +8 -0
- package/templates/typescript/project/vite/App.tsx.tpl +17 -0
- package/templates/typescript/project/vite/index.css.tpl +8 -0
- package/templates/typescript/project/vite/index.html.tpl +13 -0
- package/templates/typescript/project/vite/main.tsx.tpl +10 -0
- package/templates/typescript/project/vite/package.json.tpl +1 -0
- package/templates/typescript/project/vite/test-setup.ts.tpl +1 -0
- package/templates/typescript/project/vite/tsconfig.build.json.tpl +1 -0
- package/templates/typescript/project/vite/tsconfig.json.tpl +1 -0
- package/templates/typescript/project/vite/tsconfig.node.json.tpl +1 -0
- package/templates/typescript/project/vite/vite.config.ts.tpl +18 -0
- package/templates/typescript/service.api.ts.tpl +27 -0
- package/templates/typescript/service.class.ts.tpl +28 -0
- package/templates/typescript/service.handler.ts.tpl +42 -0
- package/templates/typescript/service.schema.ts.tpl +16 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<configuration>
|
|
2
|
+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
|
3
|
+
<encoder>
|
|
4
|
+
<pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
|
5
|
+
</encoder>
|
|
6
|
+
</appender>
|
|
7
|
+
<root level="INFO">
|
|
8
|
+
<appender-ref ref="STDOUT"/>
|
|
9
|
+
</root>
|
|
10
|
+
<logger name="io.ktor" level="INFO"/>
|
|
11
|
+
</configuration>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js + Express Backend Module
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { dirname, resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const templatesDir = resolve(__dirname, "templates");
|
|
10
|
+
|
|
11
|
+
export default function (data) {
|
|
12
|
+
const backendDir = data.backendDir || "backend";
|
|
13
|
+
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
type: "addMany",
|
|
17
|
+
destination: `{{projectDir}}/${backendDir}`,
|
|
18
|
+
base: templatesDir,
|
|
19
|
+
templateFiles: `${templatesDir}/**/*.hbs`,
|
|
20
|
+
stripExtensions: ["hbs"],
|
|
21
|
+
data,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const description = "Node.js backend with Express and TypeScript";
|
|
27
|
+
|
|
28
|
+
export const dependencies = {
|
|
29
|
+
express: "^4.18.0",
|
|
30
|
+
cors: "^2.8.5",
|
|
31
|
+
dotenv: "^16.3.0",
|
|
32
|
+
helmet: "^7.1.0",
|
|
33
|
+
"express-rate-limit": "^7.1.0",
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const devDependencies = {
|
|
37
|
+
"@types/express": "^4.17.0",
|
|
38
|
+
"@types/cors": "^2.8.0",
|
|
39
|
+
"@types/node": "^20.10.0",
|
|
40
|
+
typescript: "^5.3.0",
|
|
41
|
+
"ts-node": "^10.9.0",
|
|
42
|
+
nodemon: "^3.0.0",
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const scripts = {
|
|
46
|
+
"dev:backend": "nodemon --exec ts-node backend/src/index.ts",
|
|
47
|
+
"build:backend": "tsc -p backend/tsconfig.json",
|
|
48
|
+
"start:backend": "node backend/dist/index.js",
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const envVars = {
|
|
52
|
+
PORT: "3000",
|
|
53
|
+
NODE_ENV: "development",
|
|
54
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import express from "express";
|
|
2
|
+
import cors from "cors";
|
|
3
|
+
import helmet from "helmet";
|
|
4
|
+
import rateLimit from "express-rate-limit";
|
|
5
|
+
import { config } from "dotenv";
|
|
6
|
+
|
|
7
|
+
import { healthRouter } from "./routes/health";
|
|
8
|
+
|
|
9
|
+
config();
|
|
10
|
+
|
|
11
|
+
const app = express();
|
|
12
|
+
const port = process.env.PORT || 3000;
|
|
13
|
+
|
|
14
|
+
// Middleware
|
|
15
|
+
app.use(helmet());
|
|
16
|
+
app.use(cors());
|
|
17
|
+
app.use(express.json());
|
|
18
|
+
|
|
19
|
+
// Rate limiting
|
|
20
|
+
const limiter = rateLimit({
|
|
21
|
+
windowMs: 15 * 60 * 1000, // 15 minutes
|
|
22
|
+
max: 100, // Limit each IP to 100 requests per windowMs
|
|
23
|
+
});
|
|
24
|
+
app.use(limiter);
|
|
25
|
+
|
|
26
|
+
// Routes
|
|
27
|
+
app.use("/health", healthRouter);
|
|
28
|
+
|
|
29
|
+
// Error handler
|
|
30
|
+
app.use((err: Error, req: express.Request, res: express.Response, next: express.NextFunction) => {
|
|
31
|
+
console.error(err.stack);
|
|
32
|
+
res.status(500).json({ error: "Something went wrong!" });
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
app.listen(port, () => {
|
|
36
|
+
console.log(`{{titleCase name}} backend listening on port ${port}`);
|
|
37
|
+
});
|
package/dist/templates/plopfiles/_modules/backends/node-express/templates/src/routes/health.ts.hbs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Router } from "express";
|
|
2
|
+
|
|
3
|
+
export const healthRouter = Router();
|
|
4
|
+
|
|
5
|
+
healthRouter.get("/", (req, res) => {
|
|
6
|
+
res.json({
|
|
7
|
+
status: "ok",
|
|
8
|
+
timestamp: new Date().toISOString(),
|
|
9
|
+
service: "{{kebabCase name}}-backend",
|
|
10
|
+
uptime: process.uptime(),
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
healthRouter.get("/ready", (req, res) => {
|
|
15
|
+
// Add readiness checks here (database, external services, etc.)
|
|
16
|
+
res.json({ ready: true });
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
healthRouter.get("/live", (req, res) => {
|
|
20
|
+
res.json({ alive: true });
|
|
21
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"outDir": "./dist",
|
|
11
|
+
"rootDir": "./src",
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"sourceMap": true,
|
|
14
|
+
"resolveJsonModule": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*"],
|
|
17
|
+
"exclude": ["node_modules", "dist"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js + Hono Backend Module
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { dirname, resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const templatesDir = resolve(__dirname, "templates");
|
|
10
|
+
|
|
11
|
+
export default function (data) {
|
|
12
|
+
const backendDir = data.backendDir || "backend";
|
|
13
|
+
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
type: "addMany",
|
|
17
|
+
destination: `{{projectDir}}/${backendDir}`,
|
|
18
|
+
base: templatesDir,
|
|
19
|
+
templateFiles: `${templatesDir}/**/*.hbs`,
|
|
20
|
+
stripExtensions: ["hbs"],
|
|
21
|
+
data,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const description = "Node.js backend with Hono framework and Bun runtime";
|
|
27
|
+
|
|
28
|
+
export const dependencies = {
|
|
29
|
+
hono: "^4.0.0",
|
|
30
|
+
"@hono/node-server": "^1.8.0",
|
|
31
|
+
"@hono/zod-validator": "^0.2.0",
|
|
32
|
+
zod: "^3.22.0",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const devDependencies = {
|
|
36
|
+
"@types/bun": "latest",
|
|
37
|
+
typescript: "^5.3.0",
|
|
38
|
+
"@biomejs/biome": "^1.9.0",
|
|
39
|
+
typedoc: "^0.27.0",
|
|
40
|
+
"typedoc-plugin-markdown": "^4.2.0",
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const scripts = {
|
|
44
|
+
"dev:backend": "bun run --watch backend/src/index.ts",
|
|
45
|
+
"build:backend": "bun build backend/src/index.ts --outdir dist/backend --target node",
|
|
46
|
+
"start:backend": "bun run dist/backend/index.js",
|
|
47
|
+
"test:backend": "bun test backend",
|
|
48
|
+
"lint:backend": "biome check backend",
|
|
49
|
+
"lint:backend:fix": "biome check --write backend",
|
|
50
|
+
"docs:backend": "typedoc --out docs/api/backend backend/src",
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const envVars = {
|
|
54
|
+
PORT: "3000",
|
|
55
|
+
NODE_ENV: "development",
|
|
56
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {{pascalCase name}} Backend
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Hono } from "hono";
|
|
6
|
+
import { serve } from "@hono/node-server";
|
|
7
|
+
import { logger } from "hono/logger";
|
|
8
|
+
import { cors } from "hono/cors";
|
|
9
|
+
import { routes } from "./routes/index.js";
|
|
10
|
+
{{#if database}}
|
|
11
|
+
import { db } from "./db/index.js";
|
|
12
|
+
{{/if}}
|
|
13
|
+
|
|
14
|
+
const app = new Hono();
|
|
15
|
+
|
|
16
|
+
// Middleware
|
|
17
|
+
app.use("*", logger());
|
|
18
|
+
app.use("*", cors());
|
|
19
|
+
|
|
20
|
+
// Routes
|
|
21
|
+
app.route("/", routes);
|
|
22
|
+
|
|
23
|
+
// Start server
|
|
24
|
+
const port = parseInt(process.env.PORT ?? "3000", 10);
|
|
25
|
+
|
|
26
|
+
serve({ fetch: app.fetch, port }, (info) => {
|
|
27
|
+
console.log(`🚀 {{pascalCase name}} backend running on http://localhost:${info.port}`);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export default app;
|
package/dist/templates/plopfiles/_modules/backends/node-hono/templates/src/routes/health.ts.hbs
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module routes/health
|
|
3
|
+
* @description Health check endpoints for monitoring and orchestration.
|
|
4
|
+
*
|
|
5
|
+
* Provides Kubernetes-compatible health probes:
|
|
6
|
+
* - `/health` - General health status
|
|
7
|
+
* - `/health/ready` - Readiness probe (dependencies ready)
|
|
8
|
+
* - `/health/live` - Liveness probe (process alive)
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { Hono } from "hono";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Health check router.
|
|
15
|
+
*/
|
|
16
|
+
export const health = new Hono();
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* General health status endpoint.
|
|
20
|
+
*
|
|
21
|
+
* @description Returns the overall health of the service including
|
|
22
|
+
* service name and current timestamp.
|
|
23
|
+
*
|
|
24
|
+
* @returns Health status object.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```bash
|
|
28
|
+
* curl http://localhost:3000/health
|
|
29
|
+
* # { "status": "ok", "service": "my-app", "timestamp": "2024-..." }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
health.get("/", (c) => {
|
|
33
|
+
return c.json({
|
|
34
|
+
status: "ok",
|
|
35
|
+
service: "{{kebabCase name}}",
|
|
36
|
+
timestamp: new Date().toISOString(),
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Kubernetes readiness probe.
|
|
42
|
+
*
|
|
43
|
+
* @description Indicates whether the service is ready to accept traffic.
|
|
44
|
+
* Returns `ready: true` when all dependencies (database, cache, etc.)
|
|
45
|
+
* are available and the service can handle requests.
|
|
46
|
+
*
|
|
47
|
+
* @returns Readiness status.
|
|
48
|
+
*/
|
|
49
|
+
health.get("/ready", (c) => {
|
|
50
|
+
// TODO: Add actual readiness checks (db, cache, external services)
|
|
51
|
+
return c.json({ ready: true });
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Kubernetes liveness probe.
|
|
56
|
+
*
|
|
57
|
+
* @description Indicates whether the service process is running.
|
|
58
|
+
* If this fails, the container should be restarted.
|
|
59
|
+
*
|
|
60
|
+
* @returns Liveness status.
|
|
61
|
+
*/
|
|
62
|
+
health.get("/live", (c) => {
|
|
63
|
+
return c.json({ live: true });
|
|
64
|
+
});
|
package/dist/templates/plopfiles/_modules/backends/node-hono/templates/src/routes/index.ts.hbs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module routes
|
|
3
|
+
* @description API route definitions for {{pascalCase name}} backend.
|
|
4
|
+
*
|
|
5
|
+
* All routes are organized under this module and mounted on the main app.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { Hono } from "hono";
|
|
9
|
+
import { health } from "./health.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Main router instance.
|
|
13
|
+
*
|
|
14
|
+
* Aggregates all sub-routes and provides the base routing structure.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { routes } from "./routes/index.js";
|
|
19
|
+
* app.route("/", routes);
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export const routes = new Hono();
|
|
23
|
+
|
|
24
|
+
// Health check endpoints
|
|
25
|
+
routes.route("/health", health);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Root endpoint.
|
|
29
|
+
*
|
|
30
|
+
* @returns Welcome message with API version.
|
|
31
|
+
*/
|
|
32
|
+
routes.get("/", (c) => {
|
|
33
|
+
return c.json({
|
|
34
|
+
name: "{{pascalCase name}} API",
|
|
35
|
+
version: "1.0.0",
|
|
36
|
+
docs: "/docs",
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"outDir": "../dist/backend",
|
|
11
|
+
"rootDir": "./src",
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"sourceMap": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"types": ["bun-types"]
|
|
17
|
+
},
|
|
18
|
+
"include": ["src/**/*"],
|
|
19
|
+
"exclude": ["node_modules"]
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://typedoc.org/schema.json",
|
|
3
|
+
"entryPoints": ["src/index.ts"],
|
|
4
|
+
"out": "../docs/api/backend",
|
|
5
|
+
"plugin": ["typedoc-plugin-markdown"],
|
|
6
|
+
"readme": "README.md",
|
|
7
|
+
"name": "{{pascalCase name}} Backend API",
|
|
8
|
+
"includeVersion": true,
|
|
9
|
+
"excludePrivate": true,
|
|
10
|
+
"excludeProtected": true,
|
|
11
|
+
"excludeExternals": true,
|
|
12
|
+
"excludeInternal": true,
|
|
13
|
+
"hideGenerator": true,
|
|
14
|
+
"navigation": {
|
|
15
|
+
"includeCategories": true,
|
|
16
|
+
"includeGroups": true
|
|
17
|
+
},
|
|
18
|
+
"categorizeByGroup": true,
|
|
19
|
+
"sort": ["source-order"],
|
|
20
|
+
"validation": {
|
|
21
|
+
"notExported": true,
|
|
22
|
+
"invalidLink": true,
|
|
23
|
+
"notDocumented": false
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python + FastAPI Backend Module
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { dirname, resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const templatesDir = resolve(__dirname, "templates");
|
|
10
|
+
|
|
11
|
+
export default function (data) {
|
|
12
|
+
const backendDir = data.backendDir || "backend";
|
|
13
|
+
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
type: "addMany",
|
|
17
|
+
destination: `{{projectDir}}/${backendDir}`,
|
|
18
|
+
base: templatesDir,
|
|
19
|
+
templateFiles: `${templatesDir}/**/*.hbs`,
|
|
20
|
+
stripExtensions: ["hbs"],
|
|
21
|
+
data,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const description = "Python backend with FastAPI and async support";
|
|
27
|
+
|
|
28
|
+
export const dependencies = {};
|
|
29
|
+
|
|
30
|
+
export const devDependencies = {};
|
|
31
|
+
|
|
32
|
+
export const scripts = {
|
|
33
|
+
"dev:backend": "cd backend && uvicorn app.main:app --reload --port 3000",
|
|
34
|
+
"start:backend": "cd backend && uvicorn app.main:app --host 0.0.0.0 --port 3000",
|
|
35
|
+
"test:backend": "cd backend && pytest",
|
|
36
|
+
"lint:backend": "cd backend && ruff check .",
|
|
37
|
+
"lint:backend:fix": "cd backend && ruff check --fix .",
|
|
38
|
+
"format:backend": "cd backend && ruff format .",
|
|
39
|
+
"typecheck:backend": "cd backend && mypy app",
|
|
40
|
+
"docs:backend": "cd backend && pdoc --html --output-dir ../docs/api/backend app",
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const envVars = {
|
|
44
|
+
PORT: "3000",
|
|
45
|
+
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/{{snakeCase name}}",
|
|
46
|
+
SECRET_KEY: "change-me-in-production",
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const pythonDependencies = {
|
|
50
|
+
fastapi: "^0.109.0",
|
|
51
|
+
uvicorn: "^0.27.0",
|
|
52
|
+
pydantic: "^2.5.0",
|
|
53
|
+
"pydantic-settings": "^2.1.0",
|
|
54
|
+
"python-dotenv": "^1.0.0",
|
|
55
|
+
httpx: "^0.26.0",
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const pythonDevDependencies = {
|
|
59
|
+
pytest: "^8.3.0",
|
|
60
|
+
"pytest-asyncio": "^0.24.0",
|
|
61
|
+
"pytest-cov": "^6.0.0",
|
|
62
|
+
ruff: "^0.8.0",
|
|
63
|
+
mypy: "^1.13.0",
|
|
64
|
+
pdoc: "^15.0.0",
|
|
65
|
+
};
|
package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/__init__.py.hbs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# {{titleCase name}} Backend
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from pydantic_settings import BaseSettings
|
|
2
|
+
from functools import lru_cache
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Settings(BaseSettings):
|
|
6
|
+
app_name: str = "{{titleCase name}}"
|
|
7
|
+
debug: bool = False
|
|
8
|
+
|
|
9
|
+
# Database
|
|
10
|
+
database_url: str = "postgresql://postgres:postgres@localhost:5432/{{snakeCase name}}"
|
|
11
|
+
|
|
12
|
+
# Security
|
|
13
|
+
secret_key: str = "change-me-in-production"
|
|
14
|
+
|
|
15
|
+
# CORS
|
|
16
|
+
cors_origins: list[str] = ["http://localhost:5173", "http://localhost:3000"]
|
|
17
|
+
|
|
18
|
+
class Config:
|
|
19
|
+
env_file = ".env"
|
|
20
|
+
env_file_encoding = "utf-8"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@lru_cache
|
|
24
|
+
def get_settings() -> Settings:
|
|
25
|
+
return Settings()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
settings = get_settings()
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from contextlib import asynccontextmanager
|
|
2
|
+
from fastapi import FastAPI
|
|
3
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
4
|
+
|
|
5
|
+
from app.routers import health
|
|
6
|
+
from app.config import settings
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@asynccontextmanager
|
|
10
|
+
async def lifespan(app: FastAPI):
|
|
11
|
+
# Startup
|
|
12
|
+
print(f"Starting {{titleCase name}} API...")
|
|
13
|
+
yield
|
|
14
|
+
# Shutdown
|
|
15
|
+
print("Shutting down...")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
app = FastAPI(
|
|
19
|
+
title="{{titleCase name}} API",
|
|
20
|
+
description="{{titleCase name}} backend service",
|
|
21
|
+
version="0.1.0",
|
|
22
|
+
lifespan=lifespan,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
# CORS middleware
|
|
26
|
+
app.add_middleware(
|
|
27
|
+
CORSMiddleware,
|
|
28
|
+
allow_origins=settings.cors_origins,
|
|
29
|
+
allow_credentials=True,
|
|
30
|
+
allow_methods=["*"],
|
|
31
|
+
allow_headers=["*"],
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
# Include routers
|
|
35
|
+
app.include_router(health.router, prefix="/health", tags=["health"])
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@app.get("/")
|
|
39
|
+
async def root():
|
|
40
|
+
return {"message": "Welcome to {{titleCase name}} API"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Routers
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from fastapi import APIRouter
|
|
3
|
+
|
|
4
|
+
router = APIRouter()
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@router.get("/")
|
|
8
|
+
async def health_check():
|
|
9
|
+
return {
|
|
10
|
+
"status": "ok",
|
|
11
|
+
"timestamp": datetime.utcnow().isoformat(),
|
|
12
|
+
"service": "{{kebabCase name}}-backend",
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@router.get("/ready")
|
|
17
|
+
async def readiness_check():
|
|
18
|
+
# Add database/service checks here
|
|
19
|
+
return {"ready": True}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@router.get("/live")
|
|
23
|
+
async def liveness_check():
|
|
24
|
+
return {"alive": True}
|
package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/pyproject.toml.hbs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "{{kebabCase name}}-backend"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "{{titleCase name}} backend service"
|
|
5
|
+
requires-python = ">=3.11"
|
|
6
|
+
dependencies = [
|
|
7
|
+
"fastapi>=0.109.0",
|
|
8
|
+
"uvicorn[standard]>=0.27.0",
|
|
9
|
+
"pydantic>=2.5.0",
|
|
10
|
+
"pydantic-settings>=2.1.0",
|
|
11
|
+
"python-dotenv>=1.0.0",
|
|
12
|
+
"httpx>=0.26.0",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
[project.optional-dependencies]
|
|
16
|
+
dev = [
|
|
17
|
+
"pytest>=7.4.0",
|
|
18
|
+
"pytest-asyncio>=0.23.0",
|
|
19
|
+
"ruff>=0.1.0",
|
|
20
|
+
"mypy>=1.8.0",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[build-system]
|
|
24
|
+
requires = ["hatchling"]
|
|
25
|
+
build-backend = "hatchling.build"
|
|
26
|
+
|
|
27
|
+
[tool.ruff]
|
|
28
|
+
line-length = 100
|
|
29
|
+
target-version = "py311"
|
|
30
|
+
|
|
31
|
+
[tool.ruff.lint]
|
|
32
|
+
select = ["E", "F", "I", "N", "W", "UP"]
|
|
33
|
+
|
|
34
|
+
[tool.mypy]
|
|
35
|
+
python_version = "3.11"
|
|
36
|
+
strict = true
|
|
37
|
+
|
|
38
|
+
[tool.pytest.ini_options]
|
|
39
|
+
asyncio_mode = "auto"
|
|
40
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rust + Axum Backend Module
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { dirname, resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const templatesDir = resolve(__dirname, "templates");
|
|
10
|
+
|
|
11
|
+
export default function (data) {
|
|
12
|
+
const backendDir = data.backendDir || "backend";
|
|
13
|
+
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
type: "addMany",
|
|
17
|
+
destination: `{{projectDir}}/${backendDir}`,
|
|
18
|
+
base: templatesDir,
|
|
19
|
+
templateFiles: `${templatesDir}/**/*.hbs`,
|
|
20
|
+
stripExtensions: ["hbs"],
|
|
21
|
+
data,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const description = "Rust backend with Axum web framework";
|
|
27
|
+
|
|
28
|
+
export const scripts = {
|
|
29
|
+
"dev:backend": "cd backend && cargo watch -x run",
|
|
30
|
+
"build:backend": "cd backend && cargo build --release",
|
|
31
|
+
"start:backend": "cd backend && ./target/release/{{snakeCase name}}",
|
|
32
|
+
"test:backend": "cd backend && cargo test",
|
|
33
|
+
"lint:backend": "cd backend && cargo clippy --all-targets --all-features -- -D warnings",
|
|
34
|
+
"lint:backend:fix": "cd backend && cargo clippy --fix --allow-dirty --allow-staged",
|
|
35
|
+
"format:backend": "cd backend && cargo fmt",
|
|
36
|
+
"format:backend:check": "cd backend && cargo fmt -- --check",
|
|
37
|
+
"docs:backend": "cd backend && cargo doc --no-deps --open",
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const envVars = {
|
|
41
|
+
PORT: "3000",
|
|
42
|
+
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/{{snakeCase name}}",
|
|
43
|
+
RUST_LOG: "info,{{snakeCase name}}=debug",
|
|
44
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "{{snakeCase name}}"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
[dependencies]
|
|
7
|
+
axum = "0.7"
|
|
8
|
+
tokio = { version = "1", features = ["full"] }
|
|
9
|
+
tower = "0.4"
|
|
10
|
+
tower-http = { version = "0.5", features = ["cors", "trace"] }
|
|
11
|
+
serde = { version = "1", features = ["derive"] }
|
|
12
|
+
serde_json = "1"
|
|
13
|
+
tracing = "0.1"
|
|
14
|
+
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
15
|
+
dotenvy = "0.15"
|
|
16
|
+
thiserror = "1"
|
|
17
|
+
anyhow = "1"
|
|
18
|
+
|
|
19
|
+
# Database (optional)
|
|
20
|
+
# sqlx = { version = "0.7", features = ["runtime-tokio", "postgres"] }
|
|
21
|
+
|
|
22
|
+
[dev-dependencies]
|
|
23
|
+
reqwest = { version = "0.11", features = ["json"] }
|