@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,117 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Form, Formik } from 'formik';
|
|
3
|
+
import { Link, useNavigate, useSearchParams } from 'react-router';
|
|
4
|
+
import { toFormikValidationSchema } from 'zod-formik-adapter';
|
|
5
|
+
import { getSafeRedirect } from '@/shared/auth';
|
|
6
|
+
import { AuthLayout } from '@/shared/layouts';
|
|
7
|
+
import { Alert, FormField } from '@/shared/ui';
|
|
8
|
+
import { AuthCard } from '@/features/auth/components/auth-card';
|
|
9
|
+
import { CheckboxField } from '@/features/auth/components/checkbox-field';
|
|
10
|
+
import { GoogleButton } from '@/features/auth/components/google-button';
|
|
11
|
+
import { OrDivider } from '@/features/auth/components/or-divider';
|
|
12
|
+
import { PasswordField } from '@/features/auth/components/password-field';
|
|
13
|
+
import { SubmitButton } from '@/features/auth/components/submit-button';
|
|
14
|
+
import { signInWithGoogle, signupWithEmail } from '@/features/auth/lib/auth-actions';
|
|
15
|
+
import { withRedirect } from '@/features/auth/lib/redirect';
|
|
16
|
+
import { signupSchema } from '@/features/auth/lib/schemas';
|
|
17
|
+
import { APP_ORIGIN } from '@/lib/env';
|
|
18
|
+
import { PRIVACY_PATH, TERMS_PATH } from '@/lib/paths';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Opened in a new tab rather than navigated to: a same-tab hop would discard a
|
|
22
|
+
* half-filled signup form, and asking someone to re-enter it to read what they
|
|
23
|
+
* are agreeing to is how consent gets clicked through unread. These two routes
|
|
24
|
+
* ship regardless of whether the marketing site is included, precisely so this
|
|
25
|
+
* link always resolves.
|
|
26
|
+
*/
|
|
27
|
+
const legalLinkClass = 'font-semibold text-ink-deep underline underline-offset-2';
|
|
28
|
+
|
|
29
|
+
function TermsLabel() {
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
I agree to the{' '}
|
|
33
|
+
<a href={TERMS_PATH} target="_blank" rel="noopener noreferrer" className={legalLinkClass}>
|
|
34
|
+
Terms of Service
|
|
35
|
+
</a>{' '}
|
|
36
|
+
and{' '}
|
|
37
|
+
<a href={PRIVACY_PATH} target="_blank" rel="noopener noreferrer" className={legalLinkClass}>
|
|
38
|
+
Privacy Policy
|
|
39
|
+
</a>
|
|
40
|
+
.
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function SignupRoute() {
|
|
46
|
+
const [params] = useSearchParams();
|
|
47
|
+
const redirect = params.get('redirect');
|
|
48
|
+
const navigate = useNavigate();
|
|
49
|
+
const [error, setError] = useState<string | null>(null);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<AuthLayout>
|
|
53
|
+
<AuthCard
|
|
54
|
+
title="Create your free account"
|
|
55
|
+
description="No fees, no card — get started in a minute."
|
|
56
|
+
footer={
|
|
57
|
+
<>
|
|
58
|
+
Already have an account?{' '}
|
|
59
|
+
<Link to={withRedirect('/login', redirect)} className="font-semibold text-ink-deep">
|
|
60
|
+
Log in
|
|
61
|
+
</Link>
|
|
62
|
+
</>
|
|
63
|
+
}
|
|
64
|
+
>
|
|
65
|
+
{error ? (
|
|
66
|
+
<Alert variant="destructive" className="mb-4">
|
|
67
|
+
{error}
|
|
68
|
+
</Alert>
|
|
69
|
+
) : null}
|
|
70
|
+
<Formik
|
|
71
|
+
initialValues={{ name: '', email: '', password: '', acceptedTerms: false }}
|
|
72
|
+
validationSchema={toFormikValidationSchema(signupSchema)}
|
|
73
|
+
onSubmit={async ({ name, email, password }, helpers) => {
|
|
74
|
+
setError(null);
|
|
75
|
+
const { error: err } = await signupWithEmail({
|
|
76
|
+
name,
|
|
77
|
+
email,
|
|
78
|
+
password,
|
|
79
|
+
// Absolute, and it has to be: this lands in an email, where a
|
|
80
|
+
// path has nothing to resolve against.
|
|
81
|
+
callbackURL: `${APP_ORIGIN}/verified`
|
|
82
|
+
});
|
|
83
|
+
helpers.setSubmitting(false);
|
|
84
|
+
if (err) {
|
|
85
|
+
setError(err);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
navigate(withRedirect(`/verify-email?email=${encodeURIComponent(email)}`, redirect));
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
{({ isSubmitting, values }) => (
|
|
92
|
+
<Form className="flex flex-col gap-4">
|
|
93
|
+
<FormField name="name" label="Full name" placeholder="Your name" autoComplete="name" />
|
|
94
|
+
<FormField name="email" label="Email" type="email" placeholder="you@example.com" autoComplete="email" />
|
|
95
|
+
<PasswordField
|
|
96
|
+
name="password"
|
|
97
|
+
label="Password"
|
|
98
|
+
placeholder="At least 8 characters"
|
|
99
|
+
autoComplete="new-password"
|
|
100
|
+
showStrength
|
|
101
|
+
/>
|
|
102
|
+
<CheckboxField name="acceptedTerms" label={<TermsLabel />} />
|
|
103
|
+
<SubmitButton loading={isSubmitting}>Create account</SubmitButton>
|
|
104
|
+
<OrDivider />
|
|
105
|
+
{/* Google is a second route to the same account, so the same gate applies —
|
|
106
|
+
otherwise the consent is one click away from being skipped entirely. */}
|
|
107
|
+
<GoogleButton
|
|
108
|
+
onClick={() => void signInWithGoogle({ callbackURL: getSafeRedirect(redirect) })}
|
|
109
|
+
disabled={isSubmitting || !values.acceptedTerms}
|
|
110
|
+
/>
|
|
111
|
+
</Form>
|
|
112
|
+
)}
|
|
113
|
+
</Formik>
|
|
114
|
+
</AuthCard>
|
|
115
|
+
</AuthLayout>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useSearchParams } from 'react-router';
|
|
2
|
+
import { Check } from 'lucide-react';
|
|
3
|
+
import { getSafeRedirect } from '@/shared/auth';
|
|
4
|
+
import { AuthLayout } from '@/shared/layouts';
|
|
5
|
+
import { Button, Card } from '@/shared/ui';
|
|
6
|
+
|
|
7
|
+
export function VerifiedRoute() {
|
|
8
|
+
const [params] = useSearchParams();
|
|
9
|
+
const redirect = params.get('redirect');
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<AuthLayout>
|
|
13
|
+
<Card className="items-center text-center">
|
|
14
|
+
<span className="flex size-16 items-center justify-center rounded-full bg-primary text-primary-foreground">
|
|
15
|
+
<Check className="size-8" strokeWidth={2.4} />
|
|
16
|
+
</span>
|
|
17
|
+
<div className="flex flex-col gap-2">
|
|
18
|
+
<h2 className="font-display text-2xl font-black text-foreground">You're verified</h2>
|
|
19
|
+
<p className="text-sm text-body">
|
|
20
|
+
Your email is confirmed. Continue to Acme Corp — everything is ready for you.
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
{/* No explicit fallback: `configureAuth({ defaultRedirect })` already
|
|
24
|
+
knows where the app lives. */}
|
|
25
|
+
<Button className="w-full" onClick={() => window.location.assign(getSafeRedirect(redirect))}>
|
|
26
|
+
Continue
|
|
27
|
+
</Button>
|
|
28
|
+
</Card>
|
|
29
|
+
</AuthLayout>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { Link, useNavigate, useSearchParams } from 'react-router';
|
|
3
|
+
import { Mail } from 'lucide-react';
|
|
4
|
+
import { getAuthClient } from '@/shared/auth';
|
|
5
|
+
import { AuthLayout } from '@/shared/layouts';
|
|
6
|
+
import { Alert, Button, Card } from '@/shared/ui';
|
|
7
|
+
import { SubmitButton } from '@/features/auth/components/submit-button';
|
|
8
|
+
import { resendVerification, verifyEmailToken } from '@/features/auth/lib/auth-actions';
|
|
9
|
+
import { APP_ORIGIN } from '@/lib/env';
|
|
10
|
+
|
|
11
|
+
export function VerifyEmailRoute() {
|
|
12
|
+
const [params] = useSearchParams();
|
|
13
|
+
const navigate = useNavigate();
|
|
14
|
+
const email = params.get('email') ?? '';
|
|
15
|
+
const token = params.get('token');
|
|
16
|
+
const [error, setError] = useState<string | null>(null);
|
|
17
|
+
const [checking, setChecking] = useState(Boolean(token));
|
|
18
|
+
const [resent, setResent] = useState(false);
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!token) return;
|
|
22
|
+
let active = true;
|
|
23
|
+
void (async () => {
|
|
24
|
+
const { error: err } = await verifyEmailToken(token);
|
|
25
|
+
if (!active) return;
|
|
26
|
+
if (err) {
|
|
27
|
+
setError(err);
|
|
28
|
+
setChecking(false);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
navigate('/verified', { replace: true });
|
|
32
|
+
})();
|
|
33
|
+
return () => {
|
|
34
|
+
active = false;
|
|
35
|
+
};
|
|
36
|
+
}, [token, navigate]);
|
|
37
|
+
|
|
38
|
+
const handleClickedLink = async () => {
|
|
39
|
+
setError(null);
|
|
40
|
+
setChecking(true);
|
|
41
|
+
const { data } = await getAuthClient().getSession();
|
|
42
|
+
setChecking(false);
|
|
43
|
+
if (data?.user?.emailVerified) {
|
|
44
|
+
navigate('/verified');
|
|
45
|
+
} else {
|
|
46
|
+
setError("We can't confirm it yet — click the link in your email, then try again.");
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const handleResend = async () => {
|
|
51
|
+
setError(null);
|
|
52
|
+
// Absolute: this lands in an email, where a path has nothing to resolve against.
|
|
53
|
+
const { error: err } = await resendVerification({ email, callbackURL: `${APP_ORIGIN}/verified` });
|
|
54
|
+
if (err) {
|
|
55
|
+
setError(err);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
setResent(true);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<AuthLayout>
|
|
63
|
+
<Card className="items-center text-center">
|
|
64
|
+
<span className="flex size-16 items-center justify-center rounded-full bg-accent text-ink-deep">
|
|
65
|
+
<Mail className="size-7" />
|
|
66
|
+
</span>
|
|
67
|
+
<div className="flex flex-col gap-2">
|
|
68
|
+
<h2 className="font-display text-2xl font-black text-foreground">Check your inbox</h2>
|
|
69
|
+
<p className="text-sm text-body">
|
|
70
|
+
We sent a verification link to{' '}
|
|
71
|
+
<strong className="font-semibold text-foreground">{email || 'your email'}</strong>.
|
|
72
|
+
</p>
|
|
73
|
+
<p className="text-sm text-mute">The link expires in 24 hours. Check spam if you don't see it.</p>
|
|
74
|
+
</div>
|
|
75
|
+
{error ? (
|
|
76
|
+
<Alert variant="destructive" className="w-full text-left">
|
|
77
|
+
{error}
|
|
78
|
+
</Alert>
|
|
79
|
+
) : null}
|
|
80
|
+
<div className="flex w-full flex-col gap-2">
|
|
81
|
+
<SubmitButton type="button" loading={checking} onClick={handleClickedLink}>
|
|
82
|
+
I've clicked the link
|
|
83
|
+
</SubmitButton>
|
|
84
|
+
<Button type="button" variant="outline" className="w-full" onClick={handleResend} disabled={resent}>
|
|
85
|
+
{resent ? 'Verification email sent' : 'Resend email'}
|
|
86
|
+
</Button>
|
|
87
|
+
</div>
|
|
88
|
+
<p className="text-sm text-body">
|
|
89
|
+
Wrong address?{' '}
|
|
90
|
+
<Link to="/signup" className="font-semibold text-ink-deep">
|
|
91
|
+
Edit your email
|
|
92
|
+
</Link>
|
|
93
|
+
</p>
|
|
94
|
+
</Card>
|
|
95
|
+
</AuthLayout>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { initAuthClient } from './client';
|
|
2
|
+
import { configureRedirects } from './redirect';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* One-shot auth wiring, called once at startup (before rendering).
|
|
6
|
+
*
|
|
7
|
+
* There is no `authAppUrl` here, unlike the multi-app build of this stack: the
|
|
8
|
+
* auth screens are routes in this bundle, so login is a path within the same
|
|
9
|
+
* origin. `trustedOrigins` therefore defaults to this app's own origin — the
|
|
10
|
+
* complete answer unless you deliberately hand off to another host.
|
|
11
|
+
*/
|
|
12
|
+
export function configureAuth(options: {
|
|
13
|
+
/** Backend Better Auth base URL (e.g. https://api.example.com/auth). */
|
|
14
|
+
authApiBaseUrl: string;
|
|
15
|
+
/** Route the login screen is mounted at. Defaults to `/login`. */
|
|
16
|
+
loginPath?: string;
|
|
17
|
+
/** Origins allowed as a post-login redirect target. Defaults to this origin. */
|
|
18
|
+
trustedOrigins?: string[];
|
|
19
|
+
/** Where a login with no `?redirect=` lands. */
|
|
20
|
+
defaultRedirect?: string;
|
|
21
|
+
}): void {
|
|
22
|
+
initAuthClient(options.authApiBaseUrl);
|
|
23
|
+
configureRedirects({
|
|
24
|
+
loginPath: options.loginPath,
|
|
25
|
+
trustedOrigins: options.trustedOrigins,
|
|
26
|
+
defaultRedirect: options.defaultRedirect
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { Navigate, Outlet, useLocation } from 'react-router';
|
|
3
|
+
import { useAuth } from './hooks';
|
|
4
|
+
import { loginRedirect } from './redirect';
|
|
5
|
+
|
|
6
|
+
type GuardProps = {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Shown while the session is resolving.
|
|
10
|
+
*
|
|
11
|
+
* Required on purpose. This used to default to `null`, which meant the app
|
|
12
|
+
* rendered *nothing* for the entire session round trip — ~880 ms measured
|
|
13
|
+
* against a deployed API, and worse on mobile. Pass the shell skeleton so the
|
|
14
|
+
* frame is on screen while the session resolves; there is no correct case for
|
|
15
|
+
* gating a whole app behind a blank screen.
|
|
16
|
+
*/
|
|
17
|
+
fallback: ReactNode;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Requires any authenticated session; otherwise sends the visitor to `/login`
|
|
22
|
+
* with a `?redirect=` back to where they were.
|
|
23
|
+
*
|
|
24
|
+
* `<Navigate>` rather than `window.location.assign`: the login screen is a route
|
|
25
|
+
* in this same bundle, so a full page load would re-download and re-boot the app
|
|
26
|
+
* to render a screen it already has. `replace` keeps the guarded URL out of
|
|
27
|
+
* history — without it, Back from the login screen bounces straight through the
|
|
28
|
+
* guard again.
|
|
29
|
+
*/
|
|
30
|
+
export function ProtectedRoute({ children, fallback }: GuardProps) {
|
|
31
|
+
const { status } = useAuth();
|
|
32
|
+
const location = useLocation();
|
|
33
|
+
|
|
34
|
+
if (status === 'loading') return <>{fallback}</>;
|
|
35
|
+
if (status === 'unauthenticated') {
|
|
36
|
+
return <Navigate to={loginRedirect(location.pathname + location.search)} replace />;
|
|
37
|
+
}
|
|
38
|
+
return <>{children ?? <Outlet />}</>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type RoleRouteProps = GuardProps & {
|
|
42
|
+
/** Roles allowed to view (any match). Compared against session.user.role. */
|
|
43
|
+
allow: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Rendered when authenticated but lacking a required role (403). Required for
|
|
46
|
+
* the same reason as `fallback` — a silent blank 403 looks like a broken app.
|
|
47
|
+
*/
|
|
48
|
+
forbidden: ReactNode;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Requires an authenticated session AND one of `allow` roles.
|
|
53
|
+
* 401 (no session) -> the login screen; 403 (wrong role) -> `forbidden`.
|
|
54
|
+
*
|
|
55
|
+
* This is a UI affordance, not a security boundary: the role it reads comes from
|
|
56
|
+
* the session the browser holds, so it decides what to *render*. Every endpoint
|
|
57
|
+
* behind it must enforce the same role server-side.
|
|
58
|
+
*/
|
|
59
|
+
export function RoleRoute({ allow, children, fallback, forbidden }: RoleRouteProps) {
|
|
60
|
+
const { status, user } = useAuth();
|
|
61
|
+
const location = useLocation();
|
|
62
|
+
|
|
63
|
+
if (status === 'loading') return <>{fallback}</>;
|
|
64
|
+
if (status === 'unauthenticated') {
|
|
65
|
+
return <Navigate to={loginRedirect(location.pathname + location.search)} replace />;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const roles = (user?.role ?? '')
|
|
69
|
+
.split(',')
|
|
70
|
+
.map((role) => role.trim())
|
|
71
|
+
.filter(Boolean);
|
|
72
|
+
if (!allow.some((role) => roles.includes(role))) return <>{forbidden}</>;
|
|
73
|
+
|
|
74
|
+
return <>{children ?? <Outlet />}</>;
|
|
75
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @/shared/auth — authentication on Better Auth.
|
|
2
|
+
export { configureAuth } from './config';
|
|
3
|
+
export { initAuthClient, getAuthClient } from './client';
|
|
4
|
+
export type { AuthClient } from './client';
|
|
5
|
+
export { AuthProvider } from './provider';
|
|
6
|
+
export { useAuth } from './hooks';
|
|
7
|
+
export { ProtectedRoute, RoleRoute } from './guards';
|
|
8
|
+
export { redirectToLogin, loginRedirect, getSafeRedirect, configureRedirects } from './redirect';
|
|
9
|
+
export { signOut, broadcastAuthEvent, AUTH_BROADCAST_CHANNEL } from './logout';
|
|
10
|
+
export {
|
|
11
|
+
authReducer,
|
|
12
|
+
sessionLoading,
|
|
13
|
+
sessionLoaded,
|
|
14
|
+
sessionCleared,
|
|
15
|
+
selectAuth,
|
|
16
|
+
selectAuthUser,
|
|
17
|
+
selectAuthStatus,
|
|
18
|
+
selectIsAuthenticated
|
|
19
|
+
} from './slice';
|
|
20
|
+
export type { AuthUser, AuthStatus } from './slice';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Redirect helpers with open-redirect protection.
|
|
2
|
+
//
|
|
3
|
+
// The multi-app build of this stack puts the auth screens on their own origin,
|
|
4
|
+
// so an unauthenticated user is bounced across hosts and back. Here they are
|
|
5
|
+
// routes in this same bundle, so login is a *path*, not a host — but the
|
|
6
|
+
// allowlist stays exactly as it was: `?redirect=` is still attacker-controllable
|
|
7
|
+
// and a monolith is no less vulnerable to being used as an open redirect than
|
|
8
|
+
// four apps were.
|
|
9
|
+
|
|
10
|
+
let loginPath = '/login';
|
|
11
|
+
let trustedOrigins: string[] = [];
|
|
12
|
+
let defaultRedirect = '/';
|
|
13
|
+
|
|
14
|
+
export function configureRedirects(options: {
|
|
15
|
+
/** Route the auth screens are mounted at. */
|
|
16
|
+
loginPath?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Origins allowed as a post-login redirect target. Defaults to this app's
|
|
19
|
+
* own origin, which is the whole answer for a single deployment; add to it
|
|
20
|
+
* only if you deliberately hand off to another host.
|
|
21
|
+
*/
|
|
22
|
+
trustedOrigins?: string[];
|
|
23
|
+
/** Where a login with no `?redirect=` lands. */
|
|
24
|
+
defaultRedirect?: string;
|
|
25
|
+
}): void {
|
|
26
|
+
if (options.loginPath) loginPath = options.loginPath;
|
|
27
|
+
trustedOrigins = (options.trustedOrigins ?? [window.location.origin]).map((origin) => origin.replace(/\/$/, ''));
|
|
28
|
+
if (options.defaultRedirect) defaultRedirect = options.defaultRedirect;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Validate a redirect target against the trusted-origin allowlist. */
|
|
32
|
+
export function getSafeRedirect(target: string | null | undefined, fallback: string = defaultRedirect): string {
|
|
33
|
+
if (!target) return fallback;
|
|
34
|
+
try {
|
|
35
|
+
const url = new URL(target, window.location.origin);
|
|
36
|
+
if (trustedOrigins.includes(url.origin)) return url.toString();
|
|
37
|
+
} catch {
|
|
38
|
+
/* not a valid URL — fall through to fallback */
|
|
39
|
+
}
|
|
40
|
+
return fallback;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The login route, carrying where the user was heading.
|
|
45
|
+
*
|
|
46
|
+
* Returned as a path rather than navigated to, so the caller can decide: the
|
|
47
|
+
* route guard renders `<Navigate>` with it (a client-side transition), while the
|
|
48
|
+
* 401 handler below does a hard load.
|
|
49
|
+
*/
|
|
50
|
+
export function loginRedirect(returnTo: string = window.location.pathname + window.location.search): string {
|
|
51
|
+
const params = new URLSearchParams({ redirect: returnTo });
|
|
52
|
+
return `${loginPath}?${params.toString()}`;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Hard navigation to the login screen.
|
|
57
|
+
*
|
|
58
|
+
* This is the 401 chokepoint (`configureApi({ onUnauthorized })`), which fires
|
|
59
|
+
* from outside React — there is no router context to navigate with. A full load
|
|
60
|
+
* is also the right behaviour here: a 401 means the session died mid-session, so
|
|
61
|
+
* discarding in-memory state is the point, not a cost.
|
|
62
|
+
*/
|
|
63
|
+
export function redirectToLogin(returnTo?: string): void {
|
|
64
|
+
window.location.assign(loginRedirect(returnTo));
|
|
65
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @/shared/hooks — cross-cutting React hooks.
|
|
2
|
+
//
|
|
3
|
+
// Deliberately empty. A hook that belongs to one feature belongs *in* that
|
|
4
|
+
// feature; this is for the ones two features would otherwise each grow their own
|
|
5
|
+
// copy of — a media query, a debounce, a BroadcastChannel wrapper.
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @/shared/types
|
|
2
|
+
|
|
3
|
+
Generated TypeScript types + Zod schemas from the backend OpenAPI document.
|
|
4
|
+
Imported by the API layer and by feature code, so a stale copy here shows up as
|
|
5
|
+
a type error at build time rather than as a surprise at runtime.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import type { UserEntity, GetUsersResponse } from '@/shared/types';
|
|
11
|
+
import { zUserEntity } from '@/shared/types/api/zod.gen';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Regenerating
|
|
15
|
+
|
|
16
|
+
Requires the backend's docs credentials in `.env` (see `.env.example`).
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
yarn gen
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
That fetches `openapi.json` from the running backend and runs
|
|
23
|
+
`@hey-api/openapi-ts` over it, rewriting `src/shared/types/api/*`.
|
|
24
|
+
**Commit the regenerated files** — they are the contract the app compiles
|
|
25
|
+
against.
|
|
26
|
+
|
|
27
|
+
`api/*` ships as an empty placeholder so a freshly scaffolded app
|
|
28
|
+
typechecks before the backend exists. The first `gen` replaces it.
|