@aurostack/stacks 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/LICENSE +21 -0
- package/README.md +209 -0
- package/cli/src/extract.mjs +165 -0
- package/cli/src/fsx.mjs +197 -0
- package/cli/src/generate.mjs +235 -0
- package/cli/src/hooks.mjs +55 -0
- package/cli/src/manifest.mjs +163 -0
- package/cli/src/strip.mjs +208 -0
- package/cli/src/tokens.mjs +102 -0
- package/cli/stack.mjs +672 -0
- package/package.json +37 -0
- package/templates/nest-api/files/.bin/db.ts +123 -0
- package/templates/nest-api/files/.bin/dc.ts +74 -0
- package/templates/nest-api/files/.bin/helpers.ts +49 -0
- package/templates/nest-api/files/.bin/secrets.ts +68 -0
- package/templates/nest-api/files/.bin/start.ts +47 -0
- package/templates/nest-api/files/.dockerignore +7 -0
- package/templates/nest-api/files/.env.example +91 -0
- package/templates/nest-api/files/.env.test.example +75 -0
- package/templates/nest-api/files/.forgejo/workflows/build-and-push.yml +41 -0
- package/templates/nest-api/files/.forgejo/workflows/test-e2e.yml +83 -0
- package/templates/nest-api/files/.forgejo/workflows/test.yml +53 -0
- package/templates/nest-api/files/.npmrc.example +1 -0
- package/templates/nest-api/files/.nvmrc +1 -0
- package/templates/nest-api/files/.prettierrc +8 -0
- package/templates/nest-api/files/.swcrc +15 -0
- package/templates/nest-api/files/.watchmanconfig +3 -0
- package/templates/nest-api/files/.yarnrc.yml +1 -0
- package/templates/nest-api/files/Dockerfile +40 -0
- package/templates/nest-api/files/__mocks__/activation-twofa.js +7 -0
- package/templates/nest-api/files/__mocks__/activation.js +7 -0
- package/templates/nest-api/files/__mocks__/forgot-password.js +7 -0
- package/templates/nest-api/files/__mocks__/main-layout.js +7 -0
- package/templates/nest-api/files/__mocks__/password-changed.js +7 -0
- package/templates/nest-api/files/__mocks__/reset-password.js +7 -0
- package/templates/nest-api/files/__mocks__/set-password.js +7 -0
- package/templates/nest-api/files/__mocks__/welcome.js +7 -0
- package/templates/nest-api/files/_gitignore +62 -0
- package/templates/nest-api/files/compose.test.yml +33 -0
- package/templates/nest-api/files/compose.yml +39 -0
- package/templates/nest-api/files/emails/activation-twofa.tsx +58 -0
- package/templates/nest-api/files/emails/activation.tsx +36 -0
- package/templates/nest-api/files/emails/forgot-password.tsx +29 -0
- package/templates/nest-api/files/emails/main-layout.tsx +134 -0
- package/templates/nest-api/files/emails/password-changed.tsx +24 -0
- package/templates/nest-api/files/emails/reset-password.tsx +24 -0
- package/templates/nest-api/files/emails/set-password.tsx +25 -0
- package/templates/nest-api/files/emails/welcome.tsx +39 -0
- package/templates/nest-api/files/eslint.config.mjs +28 -0
- package/templates/nest-api/files/global.d.ts +5 -0
- package/templates/nest-api/files/nest-cli.json +8 -0
- package/templates/nest-api/files/package.json +150 -0
- package/templates/nest-api/files/prisma/schema/auth.prisma +75 -0
- package/templates/nest-api/files/prisma/schema/base.prisma +17 -0
- package/templates/nest-api/files/prisma/schema/enum.prisma +17 -0
- package/templates/nest-api/files/prisma/schema/notification.prisma +14 -0
- package/templates/nest-api/files/prisma.config.ts +13 -0
- package/templates/nest-api/files/public/.gitkeep +0 -0
- package/templates/nest-api/files/seeders/index.ts +27 -0
- package/templates/nest-api/files/seeders/util.ts +88 -0
- package/templates/nest-api/files/src/__tests__/app.controller.spec.ts +29 -0
- package/templates/nest-api/files/src/app.controller.ts +40 -0
- package/templates/nest-api/files/src/app.module.ts +268 -0
- package/templates/nest-api/files/src/app.resolver.ts +32 -0
- package/templates/nest-api/files/src/app.setup.ts +178 -0
- package/templates/nest-api/files/src/common/__tests__/auth.service.spec.ts +31 -0
- package/templates/nest-api/files/src/common/__tests__/cache.service.spec.ts +214 -0
- package/templates/nest-api/files/src/common/__tests__/config.service.spec.ts +56 -0
- package/templates/nest-api/files/src/common/__tests__/generator.service.spec.ts +114 -0
- package/templates/nest-api/files/src/common/__tests__/health.controller.spec.ts +72 -0
- package/templates/nest-api/files/src/common/__tests__/helpers.spec.ts +124 -0
- package/templates/nest-api/files/src/common/__tests__/mail.service.spec.ts +75 -0
- package/templates/nest-api/files/src/common/__tests__/prisma.indicator.spec.ts +39 -0
- package/templates/nest-api/files/src/common/__tests__/prisma.service.spec.ts +15 -0
- package/templates/nest-api/files/src/common/__tests__/records.spec.ts +87 -0
- package/templates/nest-api/files/src/common/__tests__/schemas.spec.ts +142 -0
- package/templates/nest-api/files/src/common/__tests__/throttler-storage.service.spec.ts +80 -0
- package/templates/nest-api/files/src/common/common.module.ts +72 -0
- package/templates/nest-api/files/src/common/constants/index.ts +2 -0
- package/templates/nest-api/files/src/common/constants/options.ts +52 -0
- package/templates/nest-api/files/src/common/constants/pino.ts +24 -0
- package/templates/nest-api/files/src/common/controllers/health.controller.ts +54 -0
- package/templates/nest-api/files/src/common/controllers/index.ts +2 -0
- package/templates/nest-api/files/src/common/controllers/metrics.controller.ts +21 -0
- package/templates/nest-api/files/src/common/decorators/index.ts +2 -0
- package/templates/nest-api/files/src/common/decorators/misc.decorator.ts +49 -0
- package/templates/nest-api/files/src/common/decorators/multi-part.decorator.ts +6 -0
- package/templates/nest-api/files/src/common/dto/filters.dto.ts +25 -0
- package/templates/nest-api/files/src/common/dto/index.ts +1 -0
- package/templates/nest-api/files/src/common/entity/index.ts +2 -0
- package/templates/nest-api/files/src/common/entity/ok.entity.ts +11 -0
- package/templates/nest-api/files/src/common/entity/pagination.entity.ts +24 -0
- package/templates/nest-api/files/src/common/exceptions/index.ts +1 -0
- package/templates/nest-api/files/src/common/exceptions/prisma.exception.ts +57 -0
- package/templates/nest-api/files/src/common/guards/feature-flag.guard.ts +51 -0
- package/templates/nest-api/files/src/common/guards/index.ts +1 -0
- package/templates/nest-api/files/src/common/interceptors/index.ts +1 -0
- package/templates/nest-api/files/src/common/interceptors/metrics.interceptor.ts +37 -0
- package/templates/nest-api/files/src/common/misc/helpers.ts +26 -0
- package/templates/nest-api/files/src/common/misc/index.ts +3 -0
- package/templates/nest-api/files/src/common/misc/origin-builder.ts +56 -0
- package/templates/nest-api/files/src/common/misc/prisma.indicator.ts +24 -0
- package/templates/nest-api/files/src/common/modules/index.ts +3 -0
- package/templates/nest-api/files/src/common/modules/logger.module.ts +104 -0
- package/templates/nest-api/files/src/common/modules/metrics.module.ts +28 -0
- package/templates/nest-api/files/src/common/modules/queue.module.ts +23 -0
- package/templates/nest-api/files/src/common/processors/index.ts +1 -0
- package/templates/nest-api/files/src/common/processors/mail/index.ts +47 -0
- package/templates/nest-api/files/src/common/processors/mail/process.ts +225 -0
- package/templates/nest-api/files/src/common/schemas/fields.ts +76 -0
- package/templates/nest-api/files/src/common/schemas/index.ts +1 -0
- package/templates/nest-api/files/src/common/services/auth-rate-limit.storage.ts +79 -0
- package/templates/nest-api/files/src/common/services/auth.service.ts +16 -0
- package/templates/nest-api/files/src/common/services/cache.service.ts +118 -0
- package/templates/nest-api/files/src/common/services/config.service.ts +388 -0
- package/templates/nest-api/files/src/common/services/feature-flag.service.ts +117 -0
- package/templates/nest-api/files/src/common/services/generator.service.ts +54 -0
- package/templates/nest-api/files/src/common/services/index.ts +10 -0
- package/templates/nest-api/files/src/common/services/logger.service.ts +14 -0
- package/templates/nest-api/files/src/common/services/mail.service.ts +44 -0
- package/templates/nest-api/files/src/common/services/prisma.service.ts +106 -0
- package/templates/nest-api/files/src/common/services/throttler-storage.service.ts +112 -0
- package/templates/nest-api/files/src/common/types/email.ts +55 -0
- package/templates/nest-api/files/src/common/types/index.ts +3 -0
- package/templates/nest-api/files/src/common/types/misc.ts +20 -0
- package/templates/nest-api/files/src/common/types/prisma.ts +18 -0
- package/templates/nest-api/files/src/common/utils/enum.ts +39 -0
- package/templates/nest-api/files/src/common/utils/helpers.ts +139 -0
- package/templates/nest-api/files/src/common/utils/index.ts +5 -0
- package/templates/nest-api/files/src/common/utils/ip.ts +22 -0
- package/templates/nest-api/files/src/common/utils/records.ts +66 -0
- package/templates/nest-api/files/src/common/utils/redis.keys.ts +31 -0
- package/templates/nest-api/files/src/lib/__tests__/access.spec.ts +33 -0
- package/templates/nest-api/files/src/lib/access.ts +114 -0
- package/templates/nest-api/files/src/lib/auth.ts +76 -0
- package/templates/nest-api/files/src/lib/rate-limit.ts +20 -0
- package/templates/nest-api/files/src/main.ts +28 -0
- package/templates/nest-api/files/src/media/__tests__/media.service.spec.ts +60 -0
- package/templates/nest-api/files/src/media/__tests__/s3.service.spec.ts +159 -0
- package/templates/nest-api/files/src/media/entity/file.entity.ts +7 -0
- package/templates/nest-api/files/src/media/entity/index.ts +1 -0
- package/templates/nest-api/files/src/media/media.module.ts +20 -0
- package/templates/nest-api/files/src/media/processors/index.ts +44 -0
- package/templates/nest-api/files/src/media/services/index.ts +2 -0
- package/templates/nest-api/files/src/media/services/media.service.ts +29 -0
- package/templates/nest-api/files/src/media/services/s3.service.ts +168 -0
- package/templates/nest-api/files/src/notifications/controllers/index.ts +1 -0
- package/templates/nest-api/files/src/notifications/controllers/notifications.controller.ts +72 -0
- package/templates/nest-api/files/src/notifications/dto/index.ts +1 -0
- package/templates/nest-api/files/src/notifications/dto/notification.dto.ts +11 -0
- package/templates/nest-api/files/src/notifications/entity/index.ts +1 -0
- package/templates/nest-api/files/src/notifications/entity/notification.entity.ts +37 -0
- package/templates/nest-api/files/src/notifications/notifications.module.ts +11 -0
- package/templates/nest-api/files/src/notifications/services/index.ts +1 -0
- package/templates/nest-api/files/src/notifications/services/notifications.service.ts +98 -0
- package/templates/nest-api/files/src/realtime/__tests__/events.gateway.spec.ts +88 -0
- package/templates/nest-api/files/src/realtime/__tests__/rooms.spec.ts +29 -0
- package/templates/nest-api/files/src/realtime/__tests__/ws-permissions.guard.spec.ts +54 -0
- package/templates/nest-api/files/src/realtime/adapters/redis-io.adapter.ts +57 -0
- package/templates/nest-api/files/src/realtime/constants/index.ts +68 -0
- package/templates/nest-api/files/src/realtime/decorators/index.ts +1 -0
- package/templates/nest-api/files/src/realtime/decorators/ws-permissions.decorator.ts +14 -0
- package/templates/nest-api/files/src/realtime/gateways/events.gateway.ts +187 -0
- package/templates/nest-api/files/src/realtime/guards/index.ts +2 -0
- package/templates/nest-api/files/src/realtime/guards/ws-auth.guard.ts +20 -0
- package/templates/nest-api/files/src/realtime/guards/ws-permissions.guard.ts +35 -0
- package/templates/nest-api/files/src/realtime/misc/session-from-socket.ts +54 -0
- package/templates/nest-api/files/src/realtime/realtime.module.ts +26 -0
- package/templates/nest-api/files/src/realtime/services/presence.service.ts +56 -0
- package/templates/nest-api/files/src/realtime/services/realtime.service.ts +72 -0
- package/templates/nest-api/files/src/users/__tests__/current-user.controller.spec.ts +77 -0
- package/templates/nest-api/files/src/users/__tests__/current-user.service.spec.ts +159 -0
- package/templates/nest-api/files/src/users/__tests__/user.entity.spec.ts +175 -0
- package/templates/nest-api/files/src/users/__tests__/users.controller.spec.ts +89 -0
- package/templates/nest-api/files/src/users/__tests__/users.service.spec.ts +398 -0
- package/templates/nest-api/files/src/users/controllers/current-user.controller.ts +82 -0
- package/templates/nest-api/files/src/users/controllers/index.ts +2 -0
- package/templates/nest-api/files/src/users/controllers/users.controller.ts +40 -0
- package/templates/nest-api/files/src/users/decorators/index.ts +1 -0
- package/templates/nest-api/files/src/users/decorators/permissions.decorator.ts +24 -0
- package/templates/nest-api/files/src/users/dto/avatar.dto.ts +13 -0
- package/templates/nest-api/files/src/users/dto/filters.dto.ts +8 -0
- package/templates/nest-api/files/src/users/dto/index.ts +2 -0
- package/templates/nest-api/files/src/users/entity/index.ts +1 -0
- package/templates/nest-api/files/src/users/entity/user.entity.ts +53 -0
- package/templates/nest-api/files/src/users/services/current-user.service.ts +46 -0
- package/templates/nest-api/files/src/users/services/index.ts +2 -0
- package/templates/nest-api/files/src/users/services/users.service.ts +88 -0
- package/templates/nest-api/files/src/users/users.module.ts +10 -0
- package/templates/nest-api/files/test/app.spec.ts +102 -0
- package/templates/nest-api/files/test/auth.spec.ts +108 -0
- package/templates/nest-api/files/test/current-user.spec.ts +154 -0
- package/templates/nest-api/files/test/factory/app.ts +172 -0
- package/templates/nest-api/files/test/factory/constants.ts +22 -0
- package/templates/nest-api/files/test/factory/dto.ts +27 -0
- package/templates/nest-api/files/test/factory/entity.ts +70 -0
- package/templates/nest-api/files/test/factory/gen.ts +75 -0
- package/templates/nest-api/files/test/factory/util.ts +21 -0
- package/templates/nest-api/files/test/notifications.spec.ts +176 -0
- package/templates/nest-api/files/test/rate-limit.spec.ts +180 -0
- package/templates/nest-api/files/test/setup.ts +1 -0
- package/templates/nest-api/files/test/users.spec.ts +437 -0
- package/templates/nest-api/files/tsconfig.build.json +13 -0
- package/templates/nest-api/files/tsconfig.json +35 -0
- package/templates/nest-api/files/vitest.config.ts +53 -0
- package/templates/nest-api/template.json +452 -0
- package/templates/node-worker/files/.bin/db.ts +123 -0
- package/templates/node-worker/files/.bin/helpers.ts +49 -0
- package/templates/node-worker/files/.bin/secrets.ts +68 -0
- package/templates/node-worker/files/.dockerignore +5 -0
- package/templates/node-worker/files/.env.example +21 -0
- package/templates/node-worker/files/.forgejo/workflows/build-and-push.yml +41 -0
- package/templates/node-worker/files/.nvmrc +1 -0
- package/templates/node-worker/files/.prettierignore +4 -0
- package/templates/node-worker/files/.prettierrc +8 -0
- package/templates/node-worker/files/.yarnrc.yml +5 -0
- package/templates/node-worker/files/Dockerfile +63 -0
- package/templates/node-worker/files/Dockerfile.dev +59 -0
- package/templates/node-worker/files/_gitignore +48 -0
- package/templates/node-worker/files/ecosystem.config.cjs +10 -0
- package/templates/node-worker/files/eslint.config.js +37 -0
- package/templates/node-worker/files/package.json +67 -0
- package/templates/node-worker/files/prisma/_gitignore +1 -0
- package/templates/node-worker/files/prisma/schema/base.prisma +36 -0
- package/templates/node-worker/files/prisma.config.ts +13 -0
- package/templates/node-worker/files/src/config.ts +55 -0
- package/templates/node-worker/files/src/db.ts +118 -0
- package/templates/node-worker/files/src/index.ts +7 -0
- package/templates/node-worker/files/src/logger.ts +45 -0
- package/templates/node-worker/files/src/types.ts +23 -0
- package/templates/node-worker/files/src/utils/browser.ts +16 -0
- package/templates/node-worker/files/src/utils/date.ts +68 -0
- package/templates/node-worker/files/src/utils/helpers.ts +17 -0
- package/templates/node-worker/files/src/utils/number.ts +47 -0
- package/templates/node-worker/files/src/utils/worker.ts +29 -0
- package/templates/node-worker/files/src/workers/constants.ts +6 -0
- package/templates/node-worker/files/src/workers/example/index.ts +27 -0
- package/templates/node-worker/files/src/workers/index.ts +1 -0
- package/templates/node-worker/files/tsconfig.json +30 -0
- package/templates/node-worker/template.json +135 -0
- package/templates/py-worker/files/.dockerignore +176 -0
- package/templates/py-worker/files/.env.example +20 -0
- package/templates/py-worker/files/.forgejo/workflows/build-amd-push.yml +39 -0
- package/templates/py-worker/files/Dockerfile +10 -0
- package/templates/py-worker/files/README.md +3 -0
- package/templates/py-worker/files/_gitignore +176 -0
- package/templates/py-worker/files/config.py +89 -0
- package/templates/py-worker/files/models/decorators.py +42 -0
- package/templates/py-worker/files/models/enums.py +32 -0
- package/templates/py-worker/files/models/mixins.py +61 -0
- package/templates/py-worker/files/requirements.txt +18 -0
- package/templates/py-worker/files/utils/db.py +67 -0
- package/templates/py-worker/files/utils/logger.py +97 -0
- package/templates/py-worker/files/utils/misc.py +45 -0
- package/templates/py-worker/files/utils/worker.py +80 -0
- package/templates/py-worker/files/worker.py +41 -0
- package/templates/py-worker/files/workers/hello/process.py +22 -0
- package/templates/py-worker/template.json +87 -0
- package/templates/react-app/README.md +78 -0
- package/templates/react-app/derive.sh +128 -0
- package/templates/react-app/files/.bin/openapi.js +32 -0
- package/templates/react-app/files/.bin/secrets.js +47 -0
- package/templates/react-app/files/.dockerignore +16 -0
- package/templates/react-app/files/.editorconfig +12 -0
- package/templates/react-app/files/.env.example +34 -0
- package/templates/react-app/files/.forgejo/workflows/build-and-push.yml +55 -0
- package/templates/react-app/files/.forgejo/workflows/ci.yml +39 -0
- package/templates/react-app/files/.husky/pre-commit +1 -0
- package/templates/react-app/files/.nvmrc +1 -0
- package/templates/react-app/files/.prettierignore +6 -0
- package/templates/react-app/files/.prettierrc +9 -0
- package/templates/react-app/files/.yarnrc.yml +2 -0
- package/templates/react-app/files/Dockerfile +52 -0
- package/templates/react-app/files/_gitignore +33 -0
- package/templates/react-app/files/build.sh +53 -0
- package/templates/react-app/files/docker/nginx.conf +134 -0
- package/templates/react-app/files/eslint.config.mjs +75 -0
- package/templates/react-app/files/index.html +62 -0
- package/templates/react-app/files/openapi-ts.config.ts +22 -0
- package/templates/react-app/files/package.json +80 -0
- package/templates/react-app/files/src/app/nav.tsx +32 -0
- package/templates/react-app/files/src/app/providers.tsx +39 -0
- package/templates/react-app/files/src/app/router.tsx +142 -0
- package/templates/react-app/files/src/app/store.ts +20 -0
- package/templates/react-app/files/src/features/auth/components/auth-card.tsx +23 -0
- package/templates/react-app/files/src/features/auth/components/checkbox-field.tsx +32 -0
- package/templates/react-app/files/src/features/auth/components/google-button.tsx +41 -0
- package/templates/react-app/files/src/features/auth/components/or-divider.tsx +9 -0
- package/templates/react-app/files/src/features/auth/components/password-field.tsx +70 -0
- package/templates/react-app/files/src/features/auth/components/submit-button.tsx +16 -0
- package/templates/react-app/files/src/features/auth/lib/auth-actions.ts +68 -0
- package/templates/react-app/files/src/features/auth/lib/password-strength.ts +20 -0
- package/templates/react-app/files/src/features/auth/lib/redirect.ts +6 -0
- package/templates/react-app/files/src/features/auth/lib/schemas.ts +37 -0
- package/templates/react-app/files/src/features/seo/routes.ts +65 -0
- package/templates/react-app/files/src/lib/env.ts +28 -0
- package/templates/react-app/files/src/lib/paths.ts +58 -0
- package/templates/react-app/files/src/main.tsx +19 -0
- package/templates/react-app/files/src/routes/admin/home.tsx +24 -0
- package/templates/react-app/files/src/routes/auth/forgot-password.tsx +93 -0
- package/templates/react-app/files/src/routes/auth/login.tsx +87 -0
- package/templates/react-app/files/src/routes/auth/reset-password.tsx +83 -0
- package/templates/react-app/files/src/routes/auth/signup.tsx +117 -0
- package/templates/react-app/files/src/routes/auth/verified.tsx +31 -0
- package/templates/react-app/files/src/routes/auth/verify-email.tsx +97 -0
- package/templates/react-app/files/src/routes/home.tsx +17 -0
- package/templates/react-app/files/src/routes/legal/privacy.tsx +26 -0
- package/templates/react-app/files/src/routes/legal/terms.tsx +28 -0
- package/templates/react-app/files/src/routes/marketing/home.tsx +18 -0
- package/templates/react-app/files/src/routes/settings.tsx +10 -0
- package/templates/react-app/files/src/shared/api/base-api.ts +24 -0
- package/templates/react-app/files/src/shared/api/base-query.ts +29 -0
- package/templates/react-app/files/src/shared/api/config.ts +21 -0
- package/templates/react-app/files/src/shared/api/index.ts +15 -0
- package/templates/react-app/files/src/shared/api/realtime-events.ts +34 -0
- package/templates/react-app/files/src/shared/api/socket.ts +41 -0
- package/templates/react-app/files/src/shared/api/store.ts +39 -0
- package/templates/react-app/files/src/shared/api/upload-query.ts +115 -0
- package/templates/react-app/files/src/shared/auth/client.ts +27 -0
- package/templates/react-app/files/src/shared/auth/config.ts +28 -0
- package/templates/react-app/files/src/shared/auth/guards.tsx +75 -0
- package/templates/react-app/files/src/shared/auth/hooks.ts +13 -0
- package/templates/react-app/files/src/shared/auth/index.ts +20 -0
- package/templates/react-app/files/src/shared/auth/logout.ts +23 -0
- package/templates/react-app/files/src/shared/auth/provider.tsx +52 -0
- package/templates/react-app/files/src/shared/auth/redirect.ts +65 -0
- package/templates/react-app/files/src/shared/auth/slice.ts +54 -0
- package/templates/react-app/files/src/shared/hooks/index.ts +6 -0
- package/templates/react-app/files/src/shared/layouts/app-shell/app-shell.tsx +225 -0
- package/templates/react-app/files/src/shared/layouts/app-shell/user-menu.tsx +74 -0
- package/templates/react-app/files/src/shared/layouts/auth-layout.tsx +137 -0
- package/templates/react-app/files/src/shared/layouts/error-boundary.tsx +38 -0
- package/templates/react-app/files/src/shared/layouts/index.ts +23 -0
- package/templates/react-app/files/src/shared/layouts/marketing/marketing-layout.tsx +29 -0
- package/templates/react-app/files/src/shared/layouts/marketing/section-heading.tsx +38 -0
- package/templates/react-app/files/src/shared/layouts/marketing/section.tsx +30 -0
- package/templates/react-app/files/src/shared/layouts/states/app-shell-skeleton.tsx +47 -0
- package/templates/react-app/files/src/shared/layouts/states/empty.tsx +22 -0
- package/templates/react-app/files/src/shared/layouts/states/forbidden.tsx +14 -0
- package/templates/react-app/files/src/shared/layouts/states/loading.tsx +11 -0
- package/templates/react-app/files/src/shared/layouts/states/not-found.tsx +21 -0
- package/templates/react-app/files/src/shared/layouts/states/page-skeleton.tsx +39 -0
- package/templates/react-app/files/src/shared/layouts/states/route-fallback.tsx +26 -0
- package/templates/react-app/files/src/shared/layouts/states/state-screen.tsx +22 -0
- package/templates/react-app/files/src/shared/types/README.md +28 -0
- package/templates/react-app/files/src/shared/types/api/index.ts +9 -0
- package/templates/react-app/files/src/shared/types/api/zod.gen.ts +5 -0
- package/templates/react-app/files/src/shared/types/index.ts +4 -0
- package/templates/react-app/files/src/shared/ui/components/brand/logo.tsx +51 -0
- package/templates/react-app/files/src/shared/ui/components/brand/social-icons.tsx +37 -0
- package/templates/react-app/files/src/shared/ui/components/form/form.tsx +120 -0
- package/templates/react-app/files/src/shared/ui/components/ui/alert.tsx +25 -0
- package/templates/react-app/files/src/shared/ui/components/ui/button.tsx +43 -0
- package/templates/react-app/files/src/shared/ui/components/ui/calendar.tsx +78 -0
- package/templates/react-app/files/src/shared/ui/components/ui/card.tsx +44 -0
- package/templates/react-app/files/src/shared/ui/components/ui/checkbox.tsx +16 -0
- package/templates/react-app/files/src/shared/ui/components/ui/date-picker.tsx +76 -0
- package/templates/react-app/files/src/shared/ui/components/ui/input.tsx +22 -0
- package/templates/react-app/files/src/shared/ui/components/ui/label.tsx +19 -0
- package/templates/react-app/files/src/shared/ui/components/ui/modal.tsx +94 -0
- package/templates/react-app/files/src/shared/ui/components/ui/popover.tsx +31 -0
- package/templates/react-app/files/src/shared/ui/components/ui/progress.tsx +33 -0
- package/templates/react-app/files/src/shared/ui/components/ui/search-input.tsx +69 -0
- package/templates/react-app/files/src/shared/ui/components/ui/select.tsx +80 -0
- package/templates/react-app/files/src/shared/ui/components/ui/skeleton.tsx +12 -0
- package/templates/react-app/files/src/shared/ui/components/ui/sonner.tsx +23 -0
- package/templates/react-app/files/src/shared/ui/components/ui/spinner.tsx +8 -0
- package/templates/react-app/files/src/shared/ui/components/ui/textarea.tsx +22 -0
- package/templates/react-app/files/src/shared/ui/index.ts +45 -0
- package/templates/react-app/files/src/shared/ui/lib/utils.ts +7 -0
- package/templates/react-app/files/src/shared/ui/lib/zod-setup.ts +28 -0
- package/templates/react-app/files/src/shared/ui/meta/brand.ts +18 -0
- package/templates/react-app/files/src/shared/ui/meta/meta-context.ts +30 -0
- package/templates/react-app/files/src/shared/ui/meta/meta-provider.tsx +24 -0
- package/templates/react-app/files/src/shared/ui/meta/page-meta.tsx +69 -0
- package/templates/react-app/files/src/shared/ui/meta/use-meta-config.ts +11 -0
- package/templates/react-app/files/src/shared/ui/styles/globals.css +285 -0
- package/templates/react-app/files/src/shared/ui/styles/theme.css +48 -0
- package/templates/react-app/files/src/shared/ui/theme/init-script.ts +23 -0
- package/templates/react-app/files/src/shared/ui/theme/theme-colors.ts +14 -0
- package/templates/react-app/files/src/shared/ui/theme/theme-context.ts +60 -0
- package/templates/react-app/files/src/shared/ui/theme/theme-provider.tsx +101 -0
- package/templates/react-app/files/src/shared/ui/theme/theme-toggle.tsx +40 -0
- package/templates/react-app/files/src/shared/ui/theme/use-theme.ts +11 -0
- package/templates/react-app/files/src/vite-env.d.ts +13 -0
- package/templates/react-app/files/tsconfig.json +26 -0
- package/templates/react-app/files/tsconfig.node.json +25 -0
- package/templates/react-app/files/vite.config.ts +344 -0
- package/templates/react-app/overrides/src/routes/auth/forgot-password.tsx +93 -0
- package/templates/react-app/overrides/src/routes/auth/login.tsx +87 -0
- package/templates/react-app/overrides/src/routes/auth/signup.tsx +117 -0
- package/templates/react-app/overrides/src/routes/auth/verified.tsx +31 -0
- package/templates/react-app/overrides/src/routes/auth/verify-email.tsx +97 -0
- package/templates/react-app/overrides/src/shared/auth/config.ts +28 -0
- package/templates/react-app/overrides/src/shared/auth/guards.tsx +75 -0
- package/templates/react-app/overrides/src/shared/auth/index.ts +20 -0
- package/templates/react-app/overrides/src/shared/auth/redirect.ts +65 -0
- package/templates/react-app/overrides/src/shared/hooks/index.ts +6 -0
- package/templates/react-app/overrides/src/shared/types/README.md +28 -0
- package/templates/react-app/template.json +222 -0
- package/templates/react-monorepo/files/.dockerignore +19 -0
- package/templates/react-monorepo/files/.editorconfig +12 -0
- package/templates/react-monorepo/files/.forgejo/workflows/build-and-push.yml +98 -0
- package/templates/react-monorepo/files/.forgejo/workflows/ci.yml +35 -0
- package/templates/react-monorepo/files/.husky/pre-commit +1 -0
- package/templates/react-monorepo/files/.nvmrc +1 -0
- package/templates/react-monorepo/files/.prettierignore +6 -0
- package/templates/react-monorepo/files/.prettierrc +9 -0
- package/templates/react-monorepo/files/.yarnrc.yml +2 -0
- package/templates/react-monorepo/files/Dockerfile +90 -0
- package/templates/react-monorepo/files/_gitignore +35 -0
- package/templates/react-monorepo/files/apps/admin/.bin/secrets.js +57 -0
- package/templates/react-monorepo/files/apps/admin/.env.example +16 -0
- package/templates/react-monorepo/files/apps/admin/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/apps/admin/index.html +57 -0
- package/templates/react-monorepo/files/apps/admin/package.json +33 -0
- package/templates/react-monorepo/files/apps/admin/src/App.tsx +3 -0
- package/templates/react-monorepo/files/apps/admin/src/app/nav.tsx +14 -0
- package/templates/react-monorepo/files/apps/admin/src/app/providers.tsx +42 -0
- package/templates/react-monorepo/files/apps/admin/src/app/router.tsx +50 -0
- package/templates/react-monorepo/files/apps/admin/src/app/store.ts +15 -0
- package/templates/react-monorepo/files/apps/admin/src/lib/env.ts +12 -0
- package/templates/react-monorepo/files/apps/admin/src/main.tsx +14 -0
- package/templates/react-monorepo/files/apps/admin/src/routes/home.tsx +17 -0
- package/templates/react-monorepo/files/apps/admin/src/routes/settings.tsx +10 -0
- package/templates/react-monorepo/files/apps/admin/src/vite-env.d.ts +14 -0
- package/templates/react-monorepo/files/apps/admin/tsconfig.json +10 -0
- package/templates/react-monorepo/files/apps/admin/vite.config.ts +13 -0
- package/templates/react-monorepo/files/apps/auth/.bin/secrets.js +57 -0
- package/templates/react-monorepo/files/apps/auth/.env.example +16 -0
- package/templates/react-monorepo/files/apps/auth/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/apps/auth/index.html +57 -0
- package/templates/react-monorepo/files/apps/auth/package.json +32 -0
- package/templates/react-monorepo/files/apps/auth/src/App.tsx +3 -0
- package/templates/react-monorepo/files/apps/auth/src/app/providers.tsx +42 -0
- package/templates/react-monorepo/files/apps/auth/src/app/router.tsx +19 -0
- package/templates/react-monorepo/files/apps/auth/src/app/store.ts +15 -0
- package/templates/react-monorepo/files/apps/auth/src/components/auth-card.tsx +23 -0
- package/templates/react-monorepo/files/apps/auth/src/components/checkbox-field.tsx +32 -0
- package/templates/react-monorepo/files/apps/auth/src/components/google-button.tsx +41 -0
- package/templates/react-monorepo/files/apps/auth/src/components/or-divider.tsx +9 -0
- package/templates/react-monorepo/files/apps/auth/src/components/password-field.tsx +70 -0
- package/templates/react-monorepo/files/apps/auth/src/components/submit-button.tsx +16 -0
- package/templates/react-monorepo/files/apps/auth/src/lib/auth-actions.ts +68 -0
- package/templates/react-monorepo/files/apps/auth/src/lib/env.ts +8 -0
- package/templates/react-monorepo/files/apps/auth/src/lib/password-strength.ts +20 -0
- package/templates/react-monorepo/files/apps/auth/src/lib/redirect.ts +6 -0
- package/templates/react-monorepo/files/apps/auth/src/lib/schemas.ts +37 -0
- package/templates/react-monorepo/files/apps/auth/src/main.tsx +14 -0
- package/templates/react-monorepo/files/apps/auth/src/routes/forgot-password.tsx +91 -0
- package/templates/react-monorepo/files/apps/auth/src/routes/login.tsx +82 -0
- package/templates/react-monorepo/files/apps/auth/src/routes/reset-password.tsx +83 -0
- package/templates/react-monorepo/files/apps/auth/src/routes/signup.tsx +117 -0
- package/templates/react-monorepo/files/apps/auth/src/routes/verified.tsx +30 -0
- package/templates/react-monorepo/files/apps/auth/src/routes/verify-email.tsx +96 -0
- package/templates/react-monorepo/files/apps/auth/src/vite-env.d.ts +14 -0
- package/templates/react-monorepo/files/apps/auth/tsconfig.json +10 -0
- package/templates/react-monorepo/files/apps/auth/vite.config.ts +13 -0
- package/templates/react-monorepo/files/apps/client/.bin/secrets.js +57 -0
- package/templates/react-monorepo/files/apps/client/.env.example +16 -0
- package/templates/react-monorepo/files/apps/client/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/apps/client/index.html +57 -0
- package/templates/react-monorepo/files/apps/client/package.json +35 -0
- package/templates/react-monorepo/files/apps/client/src/App.tsx +3 -0
- package/templates/react-monorepo/files/apps/client/src/app/nav.tsx +14 -0
- package/templates/react-monorepo/files/apps/client/src/app/providers.tsx +42 -0
- package/templates/react-monorepo/files/apps/client/src/app/router.tsx +50 -0
- package/templates/react-monorepo/files/apps/client/src/app/store.ts +15 -0
- package/templates/react-monorepo/files/apps/client/src/lib/env.ts +12 -0
- package/templates/react-monorepo/files/apps/client/src/main.tsx +19 -0
- package/templates/react-monorepo/files/apps/client/src/routes/home.tsx +17 -0
- package/templates/react-monorepo/files/apps/client/src/routes/settings.tsx +10 -0
- package/templates/react-monorepo/files/apps/client/src/vite-env.d.ts +15 -0
- package/templates/react-monorepo/files/apps/client/tsconfig.json +10 -0
- package/templates/react-monorepo/files/apps/client/vite.config.ts +120 -0
- package/templates/react-monorepo/files/apps/landing/.bin/secrets.js +57 -0
- package/templates/react-monorepo/files/apps/landing/.env.example +20 -0
- package/templates/react-monorepo/files/apps/landing/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/apps/landing/index.html +51 -0
- package/templates/react-monorepo/files/apps/landing/package.json +33 -0
- package/templates/react-monorepo/files/apps/landing/src/App.tsx +3 -0
- package/templates/react-monorepo/files/apps/landing/src/app/providers.tsx +42 -0
- package/templates/react-monorepo/files/apps/landing/src/app/router.tsx +21 -0
- package/templates/react-monorepo/files/apps/landing/src/app/store.ts +18 -0
- package/templates/react-monorepo/files/apps/landing/src/features/seo/routes.ts +65 -0
- package/templates/react-monorepo/files/apps/landing/src/lib/env.ts +10 -0
- package/templates/react-monorepo/files/apps/landing/src/main.tsx +14 -0
- package/templates/react-monorepo/files/apps/landing/src/routes/home.tsx +18 -0
- package/templates/react-monorepo/files/apps/landing/src/vite-env.d.ts +15 -0
- package/templates/react-monorepo/files/apps/landing/tsconfig.json +10 -0
- package/templates/react-monorepo/files/apps/landing/vite.config.ts +169 -0
- package/templates/react-monorepo/files/build.sh +61 -0
- package/templates/react-monorepo/files/docker/nginx.conf +136 -0
- package/templates/react-monorepo/files/package.json +37 -0
- package/templates/react-monorepo/files/packages/.gitkeep +0 -0
- package/templates/react-monorepo/files/packages/api/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/packages/api/package.json +30 -0
- package/templates/react-monorepo/files/packages/api/src/base-api.ts +24 -0
- package/templates/react-monorepo/files/packages/api/src/base-query.ts +29 -0
- package/templates/react-monorepo/files/packages/api/src/config.ts +21 -0
- package/templates/react-monorepo/files/packages/api/src/index.ts +15 -0
- package/templates/react-monorepo/files/packages/api/src/realtime-events.ts +34 -0
- package/templates/react-monorepo/files/packages/api/src/socket.ts +41 -0
- package/templates/react-monorepo/files/packages/api/src/store.ts +39 -0
- package/templates/react-monorepo/files/packages/api/src/upload-query.ts +115 -0
- package/templates/react-monorepo/files/packages/api/tsconfig.json +4 -0
- package/templates/react-monorepo/files/packages/auth/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/packages/auth/package.json +33 -0
- package/templates/react-monorepo/files/packages/auth/src/client.ts +27 -0
- package/templates/react-monorepo/files/packages/auth/src/config.ts +22 -0
- package/templates/react-monorepo/files/packages/auth/src/guards.tsx +61 -0
- package/templates/react-monorepo/files/packages/auth/src/hooks.ts +13 -0
- package/templates/react-monorepo/files/packages/auth/src/index.ts +20 -0
- package/templates/react-monorepo/files/packages/auth/src/logout.ts +23 -0
- package/templates/react-monorepo/files/packages/auth/src/provider.tsx +52 -0
- package/templates/react-monorepo/files/packages/auth/src/redirect.ts +37 -0
- package/templates/react-monorepo/files/packages/auth/src/slice.ts +54 -0
- package/templates/react-monorepo/files/packages/auth/tsconfig.json +4 -0
- package/templates/react-monorepo/files/packages/config/README.md +47 -0
- package/templates/react-monorepo/files/packages/config/eslint/base.mjs +83 -0
- package/templates/react-monorepo/files/packages/config/package.json +37 -0
- package/templates/react-monorepo/files/packages/config/tailwind/theme.css +48 -0
- package/templates/react-monorepo/files/packages/config/tsconfig/base.json +22 -0
- package/templates/react-monorepo/files/packages/config/tsconfig/node.json +9 -0
- package/templates/react-monorepo/files/packages/config/tsconfig/react.json +9 -0
- package/templates/react-monorepo/files/packages/config/vite/index.d.ts +18 -0
- package/templates/react-monorepo/files/packages/config/vite/index.mjs +129 -0
- package/templates/react-monorepo/files/packages/hooks/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/packages/hooks/package.json +16 -0
- package/templates/react-monorepo/files/packages/hooks/src/index.ts +3 -0
- package/templates/react-monorepo/files/packages/hooks/tsconfig.json +4 -0
- package/templates/react-monorepo/files/packages/layouts/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/packages/layouts/package.json +30 -0
- package/templates/react-monorepo/files/packages/layouts/src/app-shell/app-shell.tsx +225 -0
- package/templates/react-monorepo/files/packages/layouts/src/app-shell/user-menu.tsx +74 -0
- package/templates/react-monorepo/files/packages/layouts/src/auth-layout.tsx +137 -0
- package/templates/react-monorepo/files/packages/layouts/src/error-boundary.tsx +38 -0
- package/templates/react-monorepo/files/packages/layouts/src/index.ts +23 -0
- package/templates/react-monorepo/files/packages/layouts/src/marketing/marketing-layout.tsx +29 -0
- package/templates/react-monorepo/files/packages/layouts/src/marketing/section-heading.tsx +38 -0
- package/templates/react-monorepo/files/packages/layouts/src/marketing/section.tsx +30 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/app-shell-skeleton.tsx +47 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/empty.tsx +22 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/forbidden.tsx +14 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/loading.tsx +11 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/not-found.tsx +21 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/page-skeleton.tsx +39 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/route-fallback.tsx +26 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/state-screen.tsx +22 -0
- package/templates/react-monorepo/files/packages/layouts/tsconfig.json +4 -0
- package/templates/react-monorepo/files/packages/types/.bin/openapi.js +32 -0
- package/templates/react-monorepo/files/packages/types/.bin/secrets.js +57 -0
- package/templates/react-monorepo/files/packages/types/README.md +28 -0
- package/templates/react-monorepo/files/packages/types/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/packages/types/openapi-ts.config.ts +22 -0
- package/templates/react-monorepo/files/packages/types/package.json +29 -0
- package/templates/react-monorepo/files/packages/types/src/index.ts +4 -0
- package/templates/react-monorepo/files/packages/types/src/types/api/index.ts +9 -0
- package/templates/react-monorepo/files/packages/types/src/types/api/zod.gen.ts +5 -0
- package/templates/react-monorepo/files/packages/types/tsconfig.json +7 -0
- package/templates/react-monorepo/files/packages/ui/components.json +21 -0
- package/templates/react-monorepo/files/packages/ui/eslint.config.mjs +13 -0
- package/templates/react-monorepo/files/packages/ui/package.json +44 -0
- package/templates/react-monorepo/files/packages/ui/src/components/brand/logo.tsx +51 -0
- package/templates/react-monorepo/files/packages/ui/src/components/brand/social-icons.tsx +37 -0
- package/templates/react-monorepo/files/packages/ui/src/components/form/form.tsx +120 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/alert.tsx +25 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/button.tsx +43 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/calendar.tsx +78 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/card.tsx +44 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/checkbox.tsx +16 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/date-picker.tsx +76 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/input.tsx +22 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/label.tsx +19 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/modal.tsx +94 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/popover.tsx +31 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/progress.tsx +33 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/search-input.tsx +69 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/select.tsx +80 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/skeleton.tsx +12 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/sonner.tsx +23 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/spinner.tsx +8 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/textarea.tsx +22 -0
- package/templates/react-monorepo/files/packages/ui/src/index.ts +45 -0
- package/templates/react-monorepo/files/packages/ui/src/lib/utils.ts +7 -0
- package/templates/react-monorepo/files/packages/ui/src/lib/zod-setup.ts +28 -0
- package/templates/react-monorepo/files/packages/ui/src/meta/brand.ts +18 -0
- package/templates/react-monorepo/files/packages/ui/src/meta/meta-context.ts +30 -0
- package/templates/react-monorepo/files/packages/ui/src/meta/meta-provider.tsx +24 -0
- package/templates/react-monorepo/files/packages/ui/src/meta/page-meta.tsx +69 -0
- package/templates/react-monorepo/files/packages/ui/src/meta/use-meta-config.ts +11 -0
- package/templates/react-monorepo/files/packages/ui/src/styles/globals.css +285 -0
- package/templates/react-monorepo/files/packages/ui/src/theme/init-script.ts +23 -0
- package/templates/react-monorepo/files/packages/ui/src/theme/theme-colors.ts +14 -0
- package/templates/react-monorepo/files/packages/ui/src/theme/theme-context.ts +60 -0
- package/templates/react-monorepo/files/packages/ui/src/theme/theme-provider.tsx +101 -0
- package/templates/react-monorepo/files/packages/ui/src/theme/theme-toggle.tsx +40 -0
- package/templates/react-monorepo/files/packages/ui/src/theme/use-theme.ts +11 -0
- package/templates/react-monorepo/files/packages/ui/tsconfig.json +9 -0
- package/templates/react-monorepo/files/turbo.json +24 -0
- package/templates/react-monorepo/template.json +230 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-app",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"title": "React app (single Vite app)",
|
|
5
|
+
"description": "One Vite/React 19 app carrying the whole frontend: an RTK Query data layer with a single baseApi, better-auth session handling and route guards, the login/signup/reset screens as routes, a shadcn-style UI kit with light/dark theming, layouts and state screens, and generated OpenAPI types. Same stack as react-monorepo, one deployment.",
|
|
6
|
+
"derivedFrom": "react-monorepo",
|
|
7
|
+
"defaults": {
|
|
8
|
+
"port": 3000
|
|
9
|
+
},
|
|
10
|
+
"aliasRoots": {
|
|
11
|
+
"@/": "src/"
|
|
12
|
+
},
|
|
13
|
+
"generatedPaths": [
|
|
14
|
+
"**/node_modules/**",
|
|
15
|
+
"src/shared/types/api/**"
|
|
16
|
+
],
|
|
17
|
+
"replacements": [
|
|
18
|
+
{
|
|
19
|
+
"from": "acme-app",
|
|
20
|
+
"to": "{{name}}"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"from": "Acme Corp",
|
|
24
|
+
"to": "{{Name}}"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"from": "AcmeCorp",
|
|
28
|
+
"to": "{{pascal}}"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"from": "acme-corp",
|
|
32
|
+
"to": "{{name}}"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"from": "acme",
|
|
36
|
+
"to": "{{name}}"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"features": {
|
|
40
|
+
"ui": {
|
|
41
|
+
"title": "UI kit (src/shared/ui)",
|
|
42
|
+
"description": "shadcn-style Radix components, a Formik+Zod form helper, light/dark theming with a no-flash init script, and page-meta helpers.",
|
|
43
|
+
"core": true
|
|
44
|
+
},
|
|
45
|
+
"api": {
|
|
46
|
+
"title": "Data layer (src/shared/api)",
|
|
47
|
+
"description": "One RTK Query baseApi that every feature extends via injectEndpoints, a configured store, and an upload-aware base query. Endpoint names and tagTypes live in one global namespace — collisions are silent, so keep them unique.",
|
|
48
|
+
"core": true
|
|
49
|
+
},
|
|
50
|
+
"auth": {
|
|
51
|
+
"title": "Auth (src/shared/auth)",
|
|
52
|
+
"description": "better-auth browser client, session slice, and route guards. Single origin, so the guard navigates to /login rather than redirecting to another host.",
|
|
53
|
+
"core": true
|
|
54
|
+
},
|
|
55
|
+
"layouts": {
|
|
56
|
+
"title": "Layouts (src/shared/layouts)",
|
|
57
|
+
"description": "App shell, auth layout, marketing layout, error boundary and the loading/empty/forbidden/not-found state screens.",
|
|
58
|
+
"core": true
|
|
59
|
+
},
|
|
60
|
+
"auth-screens": {
|
|
61
|
+
"title": "Auth screens",
|
|
62
|
+
"description": "Login, signup, forgot/reset password, email verification as routes. Drop this only if you are bringing your own /login — the guards and the 401 handler both send unauthenticated users there.",
|
|
63
|
+
"default": true,
|
|
64
|
+
"files": [
|
|
65
|
+
"src/routes/auth/**",
|
|
66
|
+
"src/features/auth/**"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"hooks": {
|
|
70
|
+
"title": "Shared hooks (src/shared/hooks)",
|
|
71
|
+
"default": true,
|
|
72
|
+
"files": [
|
|
73
|
+
"src/shared/hooks/**"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"types": {
|
|
77
|
+
"title": "Generated API types (src/shared/types)",
|
|
78
|
+
"description": "OpenAPI-generated request/response types and Zod schemas, regenerated from the backend's /openapi-json by `yarn gen`.",
|
|
79
|
+
"default": true,
|
|
80
|
+
"files": [
|
|
81
|
+
"src/shared/types/**",
|
|
82
|
+
"openapi-ts.config.ts",
|
|
83
|
+
".bin/openapi.js"
|
|
84
|
+
],
|
|
85
|
+
"packageJson": {
|
|
86
|
+
"devDependencies": [
|
|
87
|
+
"@hey-api/client-fetch",
|
|
88
|
+
"@hey-api/openapi-ts",
|
|
89
|
+
"axios",
|
|
90
|
+
"dotenv",
|
|
91
|
+
"tiny-invariant"
|
|
92
|
+
],
|
|
93
|
+
"scripts": [
|
|
94
|
+
"gen",
|
|
95
|
+
"gen:schema",
|
|
96
|
+
"gen:types"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"marketing": {
|
|
101
|
+
"title": "Marketing site",
|
|
102
|
+
"description": "A public landing page at `/`, an SEO route table, and build-time robots.txt / sitemap.xml / security.txt. Including it moves the authenticated app to /app so the landing page can own the root — see src/lib/paths.ts.",
|
|
103
|
+
"files": [
|
|
104
|
+
"src/routes/marketing/**",
|
|
105
|
+
"src/features/seo/**"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"admin": {
|
|
109
|
+
"title": "Admin console",
|
|
110
|
+
"description": "A role-gated /admin branch with its own nav, over the same data layer. The guard decides what renders; the API still has to enforce the role.",
|
|
111
|
+
"files": [
|
|
112
|
+
"src/routes/admin/**"
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
"realtime": {
|
|
116
|
+
"title": "Socket.IO client",
|
|
117
|
+
"description": "socket.io-client wired to the backend's /realtime path, with room helpers and shared event-name constants. Pairs with the nest-api realtime feature.",
|
|
118
|
+
"files": [
|
|
119
|
+
"src/shared/api/socket.ts",
|
|
120
|
+
"src/shared/api/realtime-events.ts"
|
|
121
|
+
],
|
|
122
|
+
"packageJson": {
|
|
123
|
+
"dependencies": [
|
|
124
|
+
"socket.io-client"
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"pwa": {
|
|
129
|
+
"title": "Installable PWA",
|
|
130
|
+
"description": "vite-plugin-pwa: app-shell offline caching and an update prompt rather than a silent takeover.",
|
|
131
|
+
"packageJson": {
|
|
132
|
+
"devDependencies": [
|
|
133
|
+
"vite-plugin-pwa"
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"charts": {
|
|
138
|
+
"title": "Charts",
|
|
139
|
+
"description": "ApexCharts via react-apexcharts, theme-aware through the shared chart palette.",
|
|
140
|
+
"packageJson": {
|
|
141
|
+
"dependencies": [
|
|
142
|
+
"apexcharts",
|
|
143
|
+
"react-apexcharts"
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"husky": {
|
|
148
|
+
"title": "Git hooks + lint-staged",
|
|
149
|
+
"default": true,
|
|
150
|
+
"files": [
|
|
151
|
+
".husky/**"
|
|
152
|
+
],
|
|
153
|
+
"packageJson": {
|
|
154
|
+
"devDependencies": [
|
|
155
|
+
"husky",
|
|
156
|
+
"lint-staged"
|
|
157
|
+
],
|
|
158
|
+
"scripts": [
|
|
159
|
+
"prepare"
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"docker": {
|
|
164
|
+
"title": "Docker image",
|
|
165
|
+
"description": "Multi-stage build producing a static bundle, served by the nginx config in docker/ (cache rules, SPA fallback, security headers).",
|
|
166
|
+
"default": true,
|
|
167
|
+
"files": [
|
|
168
|
+
"Dockerfile",
|
|
169
|
+
".dockerignore",
|
|
170
|
+
"build.sh",
|
|
171
|
+
"docker/**"
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"ci": {
|
|
175
|
+
"title": "Forgejo Actions CI",
|
|
176
|
+
"default": true,
|
|
177
|
+
"files": [
|
|
178
|
+
".forgejo/**"
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
"secrets": {
|
|
182
|
+
"title": "Infisical secret sync",
|
|
183
|
+
"default": true,
|
|
184
|
+
"files": [
|
|
185
|
+
".bin/secrets.js"
|
|
186
|
+
],
|
|
187
|
+
"packageJson": {
|
|
188
|
+
"scripts": [
|
|
189
|
+
"secrets"
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"hooks": [
|
|
195
|
+
{
|
|
196
|
+
"title": "seed .env from .env.example",
|
|
197
|
+
"run": "cp -n .env.example .env; true",
|
|
198
|
+
"optional": true
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"title": "yarn install",
|
|
202
|
+
"run": "yarn install",
|
|
203
|
+
"optional": true
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"title": "format (the feature strip leaves valid but unformatted code)",
|
|
207
|
+
"run": "yarn format",
|
|
208
|
+
"optional": true
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"title": "git init",
|
|
212
|
+
"run": "git init -q && git add -A && git commit -qm 'chore: scaffold {{name}} from the react-app template'",
|
|
213
|
+
"optional": true
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"nextSteps": [
|
|
217
|
+
"Edit .env — VITE_APP_API_URL must point at your backend.",
|
|
218
|
+
"yarn dev # http://localhost:{{port}}",
|
|
219
|
+
"yarn typecheck # app + build config",
|
|
220
|
+
"Routes live in src/routes; shared code in src/shared; see src/lib/paths.ts for where the app is mounted."
|
|
221
|
+
]
|
|
222
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Keep the build context small and the image reproducible.
|
|
2
|
+
node_modules
|
|
3
|
+
**/node_modules
|
|
4
|
+
**/dist
|
|
5
|
+
**/dev-dist
|
|
6
|
+
.turbo
|
|
7
|
+
**/.turbo
|
|
8
|
+
|
|
9
|
+
# Env files are NOT copied into the image — the URLs are passed as build args.
|
|
10
|
+
# Copying them would bake whichever environment happened to be checked out.
|
|
11
|
+
**/.env
|
|
12
|
+
**/.env.*
|
|
13
|
+
!**/.env.example
|
|
14
|
+
|
|
15
|
+
.git
|
|
16
|
+
.github
|
|
17
|
+
.forgejo
|
|
18
|
+
*.log
|
|
19
|
+
.DS_Store
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Builds and pushes all four frontend apps from one Dockerfile.
|
|
2
|
+
#
|
|
3
|
+
# Unlike web-backend / web-coming-soon this repo produces FOUR images, so the
|
|
4
|
+
# tag is generated once in a separate job and shared by every matrix leg —
|
|
5
|
+
# otherwise each app would get its own random tag and there would be no way to
|
|
6
|
+
# deploy a matching set.
|
|
7
|
+
#
|
|
8
|
+
# Vite compiles the VITE_* URLs into each bundle at build time, so these images
|
|
9
|
+
# are specific to one environment. See frontend/docker/README.md.
|
|
10
|
+
|
|
11
|
+
name: Build and Push
|
|
12
|
+
|
|
13
|
+
on:
|
|
14
|
+
push:
|
|
15
|
+
branches:
|
|
16
|
+
- main
|
|
17
|
+
# Day-to-day work happens on `development`; this lets a build be cut without
|
|
18
|
+
# merging to main first.
|
|
19
|
+
workflow_dispatch:
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
# One tag for the whole set, so `web-client:26_07_26_12345` and
|
|
23
|
+
# `web-auth:26_07_26_12345` are guaranteed to be from the same commit.
|
|
24
|
+
meta:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
outputs:
|
|
27
|
+
tag: ${{ steps.tag.outputs.TAG }}
|
|
28
|
+
owner: ${{ steps.tag.outputs.OWNER }}
|
|
29
|
+
steps:
|
|
30
|
+
- name: Generate image tag
|
|
31
|
+
id: tag
|
|
32
|
+
run: |
|
|
33
|
+
DATE=$(date +'%y_%m_%d')
|
|
34
|
+
RAND=$(printf '%05d' "$((RANDOM % 100000))")
|
|
35
|
+
echo "TAG=${DATE}_${RAND}" >> "$GITHUB_OUTPUT"
|
|
36
|
+
# Derived from `github.repository` (which web-backend's workflow already
|
|
37
|
+
# relies on) rather than `github.repository_owner`, so this doesn't
|
|
38
|
+
# depend on a context variable Forgejo may not populate. This repo is
|
|
39
|
+
# `acme-corp/web-frontend`, so OWNER=acme-corp and the
|
|
40
|
+
# images land as <registry>/acme-corp/web-<app>, matching
|
|
41
|
+
# stack/frontend.compose.yml.
|
|
42
|
+
echo "OWNER=$(echo '${{ github.repository }}' | cut -d/ -f1)" >> "$GITHUB_OUTPUT"
|
|
43
|
+
|
|
44
|
+
build-and-push:
|
|
45
|
+
runs-on: ubuntu-latest
|
|
46
|
+
needs: meta
|
|
47
|
+
strategy:
|
|
48
|
+
# Report every app's result rather than cancelling siblings on the first
|
|
49
|
+
# failure. Note this means a partial set can be pushed — re-run the job.
|
|
50
|
+
fail-fast: false
|
|
51
|
+
matrix:
|
|
52
|
+
app: [landing, auth, client, admin]
|
|
53
|
+
|
|
54
|
+
steps:
|
|
55
|
+
- name: Checkout repository
|
|
56
|
+
uses: actions/checkout@v4
|
|
57
|
+
|
|
58
|
+
- name: Setup Docker Buildx
|
|
59
|
+
uses: docker/setup-buildx-action@v3
|
|
60
|
+
|
|
61
|
+
- name: Login to Registry
|
|
62
|
+
uses: docker/login-action@v3
|
|
63
|
+
with:
|
|
64
|
+
registry: ${{ secrets.REGISTRY_URL }}
|
|
65
|
+
username: ${{ secrets.DK_USER }}
|
|
66
|
+
password: ${{ secrets.DK_ACCESS_TOKEN }}
|
|
67
|
+
|
|
68
|
+
- name: Build and Push ${{ matrix.app }}
|
|
69
|
+
uses: docker/build-push-action@v6
|
|
70
|
+
with:
|
|
71
|
+
push: true
|
|
72
|
+
context: .
|
|
73
|
+
# Every value goes to every app; each app reads only what it needs.
|
|
74
|
+
# Passing an unused build arg is harmless and keeps this matrix from
|
|
75
|
+
# needing per-app argument lists. Note `landing` is NOT argument-free:
|
|
76
|
+
# it calls the API and renders the support address.
|
|
77
|
+
build-args: |
|
|
78
|
+
APP=${{ matrix.app }}
|
|
79
|
+
VITE_APP_API_URL=${{ secrets.VITE_APP_API_URL }}
|
|
80
|
+
VITE_APP_AUTH_HOST=${{ secrets.VITE_APP_AUTH_HOST }}
|
|
81
|
+
VITE_APP_CLIENT_HOST=${{ secrets.VITE_APP_CLIENT_HOST }}
|
|
82
|
+
VITE_APP_ADMIN_HOST=${{ secrets.VITE_APP_ADMIN_HOST }}
|
|
83
|
+
VITE_APP_LANDING=${{ secrets.VITE_APP_LANDING }}
|
|
84
|
+
VITE_APP_SUPPORT_EMAIL=${{ secrets.VITE_APP_SUPPORT_EMAIL }}
|
|
85
|
+
VITE_APP_SITE_URL=${{ secrets.VITE_APP_SITE_URL }}
|
|
86
|
+
tags: |
|
|
87
|
+
${{ secrets.REGISTRY }}/${{ needs.meta.outputs.owner }}/web-${{ matrix.app }}:latest
|
|
88
|
+
${{ secrets.REGISTRY }}/${{ needs.meta.outputs.owner }}/web-${{ matrix.app }}:${{ needs.meta.outputs.tag }}
|
|
89
|
+
# Optional speed-up: each matrix leg runs its own `yarn install`, so a
|
|
90
|
+
# registry layer cache cuts most of that. Enable only after confirming
|
|
91
|
+
# the registry accepts OCI cache manifests — some reject them and the
|
|
92
|
+
# push then fails.
|
|
93
|
+
# cache-from: type=registry,ref=${{ secrets.REGISTRY }}/${{ needs.meta.outputs.owner }}/web-${{ matrix.app }}:buildcache
|
|
94
|
+
# cache-to: type=registry,ref=${{ secrets.REGISTRY }}/${{ needs.meta.outputs.owner }}/web-${{ matrix.app }}:buildcache,mode=max
|
|
95
|
+
|
|
96
|
+
- name: Summary
|
|
97
|
+
run: |
|
|
98
|
+
echo "Pushed web-${{ matrix.app }}:${{ needs.meta.outputs.tag }}" >> "$GITHUB_STEP_SUMMARY"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- "**"
|
|
7
|
+
- "!main"
|
|
8
|
+
- "!development"
|
|
9
|
+
pull_request:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
verify:
|
|
13
|
+
name: Lint, typecheck, build
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout repository
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Enable Corepack
|
|
20
|
+
run: corepack enable
|
|
21
|
+
|
|
22
|
+
- name: Use Node.js 24
|
|
23
|
+
uses: actions/setup-node@v4
|
|
24
|
+
with:
|
|
25
|
+
node-version: 24
|
|
26
|
+
cache: 'yarn'
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: yarn install --immutable
|
|
30
|
+
|
|
31
|
+
- name: Format check
|
|
32
|
+
run: yarn format:check
|
|
33
|
+
|
|
34
|
+
- name: Lint, typecheck, build
|
|
35
|
+
run: yarn turbo run lint typecheck build
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
yarn lint-staged
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
24.13.0
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# One Dockerfile for all four apps — pick which with `--build-arg APP=<name>`.
|
|
2
|
+
#
|
|
3
|
+
# docker build --build-arg APP=client \
|
|
4
|
+
# --build-arg VITE_APP_API_URL=https://api.acme.site ... -t …/web-client .
|
|
5
|
+
#
|
|
6
|
+
# `landing` additionally requires --build-arg VITE_APP_SITE_URL=https://acme.site
|
|
7
|
+
# for canonical tags and sitemap.xml.
|
|
8
|
+
#
|
|
9
|
+
# IMPORTANT: Vite inlines `VITE_*` values into the JS bundle at BUILD time, so a
|
|
10
|
+
# built image is pinned to one environment. The URLs below are build args, not
|
|
11
|
+
# runtime env — setting them in compose does nothing. Build one image per
|
|
12
|
+
# environment, or move to runtime config (see docker/README.md).
|
|
13
|
+
|
|
14
|
+
# ---------- deps ----------
|
|
15
|
+
# Manifests only, so `yarn install` re-runs solely when a dependency changes.
|
|
16
|
+
FROM aurostack.dev/wesnetech/nodejs:24 AS deps
|
|
17
|
+
WORKDIR /repo
|
|
18
|
+
|
|
19
|
+
COPY package.json yarn.lock .yarnrc.yml turbo.json ./
|
|
20
|
+
COPY apps/admin/package.json apps/admin/
|
|
21
|
+
COPY apps/auth/package.json apps/auth/
|
|
22
|
+
COPY apps/client/package.json apps/client/
|
|
23
|
+
COPY apps/landing/package.json apps/landing/
|
|
24
|
+
COPY packages/api/package.json packages/api/
|
|
25
|
+
COPY packages/auth/package.json packages/auth/
|
|
26
|
+
COPY packages/config/package.json packages/config/
|
|
27
|
+
COPY packages/hooks/package.json packages/hooks/
|
|
28
|
+
COPY packages/layouts/package.json packages/layouts/
|
|
29
|
+
COPY packages/types/package.json packages/types/
|
|
30
|
+
COPY packages/ui/package.json packages/ui/
|
|
31
|
+
|
|
32
|
+
RUN corepack enable && yarn install --immutable
|
|
33
|
+
|
|
34
|
+
# ---------- build ----------
|
|
35
|
+
FROM aurostack.dev/wesnetech/nodejs:24 AS build
|
|
36
|
+
WORKDIR /repo
|
|
37
|
+
ENV NODE_ENV=production
|
|
38
|
+
# Each stage is a fresh image, so corepack has to be enabled again here —
|
|
39
|
+
# without it `yarn` is the bundled 1.x and refuses the packageManager field.
|
|
40
|
+
RUN corepack enable
|
|
41
|
+
|
|
42
|
+
COPY --from=deps /repo/node_modules ./node_modules
|
|
43
|
+
COPY . .
|
|
44
|
+
|
|
45
|
+
ARG APP
|
|
46
|
+
# Build args become env vars so Vite's define step picks them up. Verified:
|
|
47
|
+
# process env takes precedence over a committed .env, so a stale checked-in
|
|
48
|
+
# .env cannot leak into the image as long as the arg is supplied.
|
|
49
|
+
ARG VITE_APP_API_URL
|
|
50
|
+
ARG VITE_APP_AUTH_HOST
|
|
51
|
+
ARG VITE_APP_CLIENT_HOST
|
|
52
|
+
ARG VITE_APP_ADMIN_HOST
|
|
53
|
+
ARG VITE_APP_LANDING
|
|
54
|
+
ARG VITE_APP_SUPPORT_EMAIL
|
|
55
|
+
# Landing only: canonical origin for <link rel="canonical">, og:url and the
|
|
56
|
+
# generated sitemap.xml. Must be a build arg — .dockerignore excludes .env, so a
|
|
57
|
+
# local value never reaches the image.
|
|
58
|
+
ARG VITE_APP_SITE_URL
|
|
59
|
+
ENV VITE_APP_API_URL=$VITE_APP_API_URL \
|
|
60
|
+
VITE_APP_AUTH_HOST=$VITE_APP_AUTH_HOST \
|
|
61
|
+
VITE_APP_CLIENT_HOST=$VITE_APP_CLIENT_HOST \
|
|
62
|
+
VITE_APP_ADMIN_HOST=$VITE_APP_ADMIN_HOST \
|
|
63
|
+
VITE_APP_LANDING=$VITE_APP_LANDING \
|
|
64
|
+
VITE_APP_SUPPORT_EMAIL=$VITE_APP_SUPPORT_EMAIL \
|
|
65
|
+
VITE_APP_SITE_URL=$VITE_APP_SITE_URL
|
|
66
|
+
|
|
67
|
+
# Fail loudly rather than silently producing a bundle with `undefined` URLs
|
|
68
|
+
# baked in — that failure is invisible until the app 404s at runtime.
|
|
69
|
+
RUN test -n "$APP" || (echo "ERROR: --build-arg APP=<admin|auth|client|landing> is required" && exit 1)
|
|
70
|
+
RUN if [ "$APP" != "landing" ] && [ -z "$VITE_APP_API_URL" ]; then \
|
|
71
|
+
echo "ERROR: $APP needs --build-arg VITE_APP_API_URL"; exit 1; \
|
|
72
|
+
fi
|
|
73
|
+
# Landing fails silently without this: no canonical tags and no sitemap.xml, with
|
|
74
|
+
# only a build warning nobody reads. Same reasoning as the check above.
|
|
75
|
+
RUN if [ "$APP" = "landing" ] && [ -z "$VITE_APP_SITE_URL" ]; then \
|
|
76
|
+
echo "ERROR: landing needs --build-arg VITE_APP_SITE_URL (e.g. https://acme.site)"; exit 1; \
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
# `--filter` builds the app plus only the workspace packages it depends on.
|
|
80
|
+
RUN yarn turbo run build --filter="$APP"
|
|
81
|
+
|
|
82
|
+
# ---------- runtime ----------
|
|
83
|
+
FROM nginx:stable-alpine AS runtime
|
|
84
|
+
ARG APP
|
|
85
|
+
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
|
86
|
+
COPY --from=build /repo/apps/$APP/dist /usr/share/nginx/html
|
|
87
|
+
|
|
88
|
+
EXPOSE 80
|
|
89
|
+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
|
|
90
|
+
CMD wget -qO- http://127.0.0.1/healthz || exit 1
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# yarn (berry, node-modules linker)
|
|
5
|
+
.yarn/*
|
|
6
|
+
!.yarn/patches
|
|
7
|
+
!.yarn/plugins
|
|
8
|
+
!.yarn/releases
|
|
9
|
+
!.yarn/sdks
|
|
10
|
+
!.yarn/versions
|
|
11
|
+
.pnp.*
|
|
12
|
+
yarn-error.log
|
|
13
|
+
|
|
14
|
+
# build output
|
|
15
|
+
dist/
|
|
16
|
+
.turbo/
|
|
17
|
+
*.tsbuildinfo
|
|
18
|
+
|
|
19
|
+
# env
|
|
20
|
+
.env
|
|
21
|
+
.env.local
|
|
22
|
+
.env.*.local
|
|
23
|
+
.env.test
|
|
24
|
+
.env.production
|
|
25
|
+
|
|
26
|
+
# editor / os
|
|
27
|
+
.DS_Store
|
|
28
|
+
*.log
|
|
29
|
+
|
|
30
|
+
# generated OpenAPI schema dump
|
|
31
|
+
openapi.json
|
|
32
|
+
|
|
33
|
+
dev-dist/
|
|
34
|
+
# Intermediate SSR bundle for the landing prerender pass (MAI-88).
|
|
35
|
+
.prerender/
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
// Pulls this workspace's env from Infisical into the matching .env file.
|
|
7
|
+
// The Infisical path is derived from the package name, e.g.
|
|
8
|
+
// @scope/types -> /frontend/types, landing -> /frontend/landing
|
|
9
|
+
//
|
|
10
|
+
// The project ID comes from the environment rather than being hardcoded: it
|
|
11
|
+
// identifies one organisation's vault, so a value baked in here would follow
|
|
12
|
+
// every copy of this scaffold to projects it has nothing to do with. Put it in
|
|
13
|
+
// your shell profile, or in a committed `.infisical.json`.
|
|
14
|
+
const PROJECT_ID = process.env.INFISICAL_PROJECT_ID;
|
|
15
|
+
const SECRET_ROOT = process.env.INFISICAL_PATH_PREFIX ?? '/frontend';
|
|
16
|
+
|
|
17
|
+
const ENV_FILES = {
|
|
18
|
+
dev: '.env',
|
|
19
|
+
test: '.env.test',
|
|
20
|
+
staging: '.env.staging',
|
|
21
|
+
prod: '.env.production'
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const normalizeEnv = (raw) => {
|
|
25
|
+
if (['dev', 'development'].includes(raw)) return 'dev';
|
|
26
|
+
if (['test', 'testing'].includes(raw)) return 'test';
|
|
27
|
+
if (['prod', 'production'].includes(raw)) return 'prod';
|
|
28
|
+
if (raw === 'staging') return 'staging';
|
|
29
|
+
throw new Error(`Unknown env '${raw}' (use one of: dev, test, staging, prod)`);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const parseEnvArg = () => {
|
|
33
|
+
const args = process.argv.slice(2);
|
|
34
|
+
const flagIndex = args.findIndex((a) => a === '-e' || a === '--env');
|
|
35
|
+
if (flagIndex !== -1 && args[flagIndex + 1]) return args[flagIndex + 1];
|
|
36
|
+
const inline = args.find((a) => a.startsWith('--env='));
|
|
37
|
+
if (inline) return inline.slice('--env='.length);
|
|
38
|
+
return 'development';
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
42
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8'));
|
|
43
|
+
const slug = pkg.name.replace(/^@[^/]+\//, '');
|
|
44
|
+
const secretPath = `${SECRET_ROOT}/${slug}`;
|
|
45
|
+
|
|
46
|
+
if (!PROJECT_ID) {
|
|
47
|
+
console.error('INFISICAL_PROJECT_ID is not set — nothing to fetch from.');
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const env = normalizeEnv(parseEnvArg());
|
|
52
|
+
const envFile = ENV_FILES[env];
|
|
53
|
+
|
|
54
|
+
console.log(`Fetching secrets for '${slug}' (${env}) -> ${envFile}...`);
|
|
55
|
+
execSync(`infisical export --projectId="${PROJECT_ID}" --path="${secretPath}" --env=${env} > ${envFile}`, {
|
|
56
|
+
stdio: 'inherit'
|
|
57
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Copy to .env. Vite only exposes variables prefixed VITE_, and inlines them at
|
|
2
|
+
# build time — never put a secret here, it ships to the browser.
|
|
3
|
+
|
|
4
|
+
# Backend base URL. Better Auth lives at ${VITE_APP_API_URL}/auth.
|
|
5
|
+
VITE_APP_API_URL='http://localhost:5000'
|
|
6
|
+
|
|
7
|
+
# Sibling app origins. All four share one session cookie across subdomains, so
|
|
8
|
+
# these must agree with the backend's BETTER_AUTH_COOKIE_DOMAIN and its
|
|
9
|
+
# trustedOrigins list, or login will appear to succeed and then bounce.
|
|
10
|
+
VITE_APP_LANDING='http://localhost:3000'
|
|
11
|
+
VITE_APP_AUTH_HOST='http://localhost:3001'
|
|
12
|
+
VITE_APP_CLIENT_HOST='http://localhost:3002'
|
|
13
|
+
VITE_APP_ADMIN_HOST='http://localhost:3003'
|
|
14
|
+
|
|
15
|
+
# This app's own dev port.
|
|
16
|
+
PORT='3003'
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
|
7
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
|
|
8
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
|
|
9
|
+
<link rel="icon" href="/favicon.ico" sizes="any" />
|
|
10
|
+
<link rel="manifest" href="/site.webmanifest" />
|
|
11
|
+
<meta name="theme-color" content="%THEME_LIGHT%" />
|
|
12
|
+
<!--
|
|
13
|
+
Applies the saved (or system) theme before first paint, so the app never
|
|
14
|
+
flashes light then flips to dark. Mirrors `themeInitScript` in @acme/ui —
|
|
15
|
+
inlined because it must run before any module loads. Keep the two in sync.
|
|
16
|
+
%THEME_LIGHT/DARK% come from THEME_COLORS via the shared vite config.
|
|
17
|
+
-->
|
|
18
|
+
<script>
|
|
19
|
+
(function () {
|
|
20
|
+
try {
|
|
21
|
+
var m = localStorage.getItem('acme-theme');
|
|
22
|
+
var d =
|
|
23
|
+
m === 'dark' || ((m === null || m === 'system') && matchMedia('(prefers-color-scheme: dark)').matches);
|
|
24
|
+
var r = document.documentElement;
|
|
25
|
+
r.classList.toggle('dark', d);
|
|
26
|
+
r.style.colorScheme = d ? 'dark' : 'light';
|
|
27
|
+
var t = document.querySelector('meta[name="theme-color"]');
|
|
28
|
+
if (t) t.setAttribute('content', d ? '%THEME_DARK%' : '%THEME_LIGHT%');
|
|
29
|
+
} catch (e) {}
|
|
30
|
+
})();
|
|
31
|
+
</script>
|
|
32
|
+
<!--
|
|
33
|
+
globals.css only styles `body`, so without this the UA canvas paints white
|
|
34
|
+
for the moment before the stylesheet lands — a white flash on a dark load.
|
|
35
|
+
-->
|
|
36
|
+
<style>
|
|
37
|
+
html {
|
|
38
|
+
background: %THEME_LIGHT%;
|
|
39
|
+
}
|
|
40
|
+
html.dark {
|
|
41
|
+
background: %THEME_DARK%;
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
44
|
+
<meta name="description" content="Acme Corp admin console." />
|
|
45
|
+
<!--
|
|
46
|
+
Private surface: never indexed. `robots.txt` only discourages crawling,
|
|
47
|
+
while `noindex` prevents listing, so both are present. This app's routes
|
|
48
|
+
include password-reset and email-verify URLs.
|
|
49
|
+
-->
|
|
50
|
+
<meta name="robots" content="noindex, nofollow" />
|
|
51
|
+
<title>%APP_TITLE%</title>
|
|
52
|
+
</head>
|
|
53
|
+
<body>
|
|
54
|
+
<div id="root"></div>
|
|
55
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|