create-nexwire 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +233 -0
- package/express/.dockerignore +14 -0
- package/express/.env +44 -0
- package/express/.env.example +42 -0
- package/express/.vscode/settings.json +26 -0
- package/express/LICENSE +21 -0
- package/express/README.md +211 -0
- package/express/biome.json +66 -0
- package/express/drizzle.config.ts +25 -0
- package/express/gitignore-stub +24 -0
- package/express/package.json +108 -0
- package/express/public/.gitkeep +0 -0
- package/express/src/config/app.ts +41 -0
- package/express/src/config/auth.ts +12 -0
- package/express/src/config/cache.ts +16 -0
- package/express/src/config/cookie.ts +15 -0
- package/express/src/config/cors.ts +12 -0
- package/express/src/config/database.ts +29 -0
- package/express/src/config/index.ts +83 -0
- package/express/src/config/jwt.ts +19 -0
- package/express/src/config/logging.ts +13 -0
- package/express/src/config/mail.ts +24 -0
- package/express/src/config/openapi.ts +54 -0
- package/express/src/config/queue.ts +30 -0
- package/express/src/config/rateLimit.ts +17 -0
- package/express/src/config/realtime.ts +15 -0
- package/express/src/config/redis.ts +18 -0
- package/express/src/config/security.ts +44 -0
- package/express/src/config/session.ts +17 -0
- package/express/src/config/storage.ts +22 -0
- package/express/src/config/validate.ts +40 -0
- package/express/src/database/migrations/sqlite/0000_init.sql +61 -0
- package/express/src/database/migrations/sqlite/meta/0000_snapshot.json +412 -0
- package/express/src/database/migrations/sqlite/meta/_journal.json +13 -0
- package/express/src/database/schema.ts +3 -0
- package/express/src/env.ts +76 -0
- package/express/src/framework/cache/cache.ts +81 -0
- package/express/src/framework/circuit-breaker/cb.ts +60 -0
- package/express/src/framework/database/connection.ts +196 -0
- package/express/src/framework/database/migrate-hooks.ts +87 -0
- package/express/src/framework/database/paginate.ts +227 -0
- package/express/src/framework/database/schema.ts +20 -0
- package/express/src/framework/database/seed.ts +139 -0
- package/express/src/framework/events/dispatcher.ts +49 -0
- package/express/src/framework/facade.ts +48 -0
- package/express/src/framework/http/app.ts +107 -0
- package/express/src/framework/http/cors.ts +7 -0
- package/express/src/framework/http/logger.ts +69 -0
- package/express/src/framework/http/metrics.ts +22 -0
- package/express/src/framework/http/openapi.ts +54 -0
- package/express/src/framework/http/ratelimiter.ts +16 -0
- package/express/src/framework/http/router.ts +178 -0
- package/express/src/framework/http/security.ts +23 -0
- package/express/src/framework/http/static.ts +23 -0
- package/express/src/framework/http/validation.ts +18 -0
- package/express/src/framework/kernel.ts +52 -0
- package/express/src/framework/maker-cli/db/core.mjs +288 -0
- package/express/src/framework/maker-cli/db/index.mjs +204 -0
- package/express/src/framework/maker-cli/deploy/core.mjs +1047 -0
- package/express/src/framework/maker-cli/deploy/index.mjs +91 -0
- package/express/src/framework/maker-cli/index.mjs +53 -0
- package/express/src/framework/maker-cli/middleware/core.mjs +47 -0
- package/express/src/framework/maker-cli/middleware/index.mjs +17 -0
- package/express/src/framework/maker-cli/module/core.mjs +684 -0
- package/express/src/framework/maker-cli/module/index.mjs +140 -0
- package/express/src/framework/maker-cli/runtime/build-ui.mjs +16 -0
- package/express/src/framework/maker-cli/runtime/core.mjs +543 -0
- package/express/src/framework/maker-cli/runtime/index.mjs +104 -0
- package/express/src/framework/maker-cli/runtime/redis-commander-patch.cjs +20 -0
- package/express/src/framework/maker-cli/stubs/controller/openapi.ts.stub +47 -0
- package/express/src/framework/maker-cli/stubs/controller/openapi.with-model.ts.stub +48 -0
- package/express/src/framework/maker-cli/stubs/controller/plain.ts.stub +54 -0
- package/express/src/framework/maker-cli/stubs/controller/schema.plain.ts.stub +14 -0
- package/express/src/framework/maker-cli/stubs/controller/schema.ts.stub +33 -0
- package/express/src/framework/maker-cli/stubs/deploy/Dockerfile.bun.stub +52 -0
- package/express/src/framework/maker-cli/stubs/deploy/Dockerfile.pnpm.stub +55 -0
- package/express/src/framework/maker-cli/stubs/deploy/Dockerfile.stub +51 -0
- package/express/src/framework/maker-cli/stubs/deploy/Dockerfile.yarn.stub +55 -0
- package/express/src/framework/maker-cli/stubs/deploy/README.stub +59 -0
- package/express/src/framework/maker-cli/stubs/deploy/compose/mysql.server.stub +45 -0
- package/express/src/framework/maker-cli/stubs/deploy/compose/postgres.server.stub +45 -0
- package/express/src/framework/maker-cli/stubs/deploy/compose/sqlite.stub +45 -0
- package/express/src/framework/maker-cli/stubs/deploy/env/mysql.server.stub +68 -0
- package/express/src/framework/maker-cli/stubs/deploy/env/postgres.server.stub +68 -0
- package/express/src/framework/maker-cli/stubs/deploy/env/sqlite.stub +67 -0
- package/express/src/framework/maker-cli/stubs/deploy/scripts/auto-migrate.sh.stub +41 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/README.stub +78 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/compose/noredis.stub +120 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/compose/redis.dev.stub +133 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/compose/redis.stub +131 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/env/local.example.stub +11 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/env/noredis.stub +25 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/env/redis.stub +25 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/README.stub +16 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/app.example.com.stub +13 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/pgadmin/servers.stub +14 -0
- package/express/src/framework/maker-cli/stubs/deploy/server/redis/redis.conf.stub +7 -0
- package/express/src/framework/maker-cli/stubs/deploy/supervisor/noredis.stub +54 -0
- package/express/src/framework/maker-cli/stubs/deploy/supervisor/redis.stub +70 -0
- package/express/src/framework/maker-cli/stubs/deploy/workflow/local.json.stub +25 -0
- package/express/src/framework/maker-cli/stubs/deploy/workflow/remote.json.stub +24 -0
- package/express/src/framework/maker-cli/stubs/example/console.ts.stub +34 -0
- package/express/src/framework/maker-cli/stubs/example/controller.ts.stub +418 -0
- package/express/src/framework/maker-cli/stubs/example/job.ts.stub +75 -0
- package/express/src/framework/maker-cli/stubs/example/route.api.ts.stub +207 -0
- package/express/src/framework/maker-cli/stubs/example/route.plain.ts.stub +18 -0
- package/express/src/framework/maker-cli/stubs/example/schema.plain.ts.stub +42 -0
- package/express/src/framework/maker-cli/stubs/example/schema.ts.stub +42 -0
- package/express/src/framework/maker-cli/stubs/job/name.ts.stub +25 -0
- package/express/src/framework/maker-cli/stubs/middleware/name.ts.stub +14 -0
- package/express/src/framework/maker-cli/stubs/model/name.mysql.ts.stub +9 -0
- package/express/src/framework/maker-cli/stubs/model/name.postgresql.ts.stub +9 -0
- package/express/src/framework/maker-cli/stubs/model/name.sqlite.ts.stub +9 -0
- package/express/src/framework/maker-cli/stubs/notification/controller.ts.stub +77 -0
- package/express/src/framework/maker-cli/stubs/notification/job.ts.stub +13 -0
- package/express/src/framework/maker-cli/stubs/notification/route.api.ts.stub +50 -0
- package/express/src/framework/maker-cli/stubs/notification/route.plain.ts.stub +12 -0
- package/express/src/framework/maker-cli/stubs/notification/schema.plain.ts.stub +26 -0
- package/express/src/framework/maker-cli/stubs/notification/schema.ts.stub +26 -0
- package/express/src/framework/maker-cli/stubs/route/api.ts.stub +80 -0
- package/express/src/framework/maker-cli/stubs/route/plain.ts.stub +11 -0
- package/express/src/framework/maker-cli/stubs/schedule/name.ts.stub +36 -0
- package/express/src/framework/maker-cli/stubs/seeder/name.ts.stub +20 -0
- package/express/src/framework/maker-cli/stubs/test/unit.ts.stub +22 -0
- package/express/src/framework/maker-cli/utils/env-config.mjs +44 -0
- package/express/src/framework/maker-cli/utils/env-db.mjs +61 -0
- package/express/src/framework/maker-cli/utils/file-ops.mjs +30 -0
- package/express/src/framework/maker-cli/utils/flags.mjs +14 -0
- package/express/src/framework/maker-cli/utils/help.mjs +50 -0
- package/express/src/framework/maker-cli/utils/naming.mjs +13 -0
- package/express/src/framework/maker-cli/utils/process.mjs +52 -0
- package/express/src/framework/modules/discover.ts +54 -0
- package/express/src/framework/modules/routes.ts +21 -0
- package/express/src/framework/notification/index.ts +116 -0
- package/express/src/framework/queue/clear.ts +22 -0
- package/express/src/framework/queue/queue.ts +342 -0
- package/express/src/framework/queue/ui.ts +187 -0
- package/express/src/framework/queue/worker.ts +61 -0
- package/express/src/framework/realtime/broadcast.ts +46 -0
- package/express/src/framework/realtime/index.ts +2 -0
- package/express/src/framework/realtime/socket-cookie.ts +71 -0
- package/express/src/framework/realtime/socket.ts +119 -0
- package/express/src/framework/realtime/types.ts +6 -0
- package/express/src/framework/realtime/ui.ts +16 -0
- package/express/src/framework/redis/client.ts +151 -0
- package/express/src/framework/runtime/runtime.ts +23 -0
- package/express/src/framework/runtime/server-adapter.ts +34 -0
- package/express/src/framework/scheduler/lock.ts +116 -0
- package/express/src/framework/scheduler/run.ts +48 -0
- package/express/src/framework/scheduler/scheduler.ts +155 -0
- package/express/src/framework/server.ts +177 -0
- package/express/src/framework/session/session.ts +98 -0
- package/express/src/framework/storage/storage.ts +785 -0
- package/express/src/framework/support/cookie.ts +62 -0
- package/express/src/framework/support/jwt.ts +33 -0
- package/express/src/framework/support/lifecycle.ts +35 -0
- package/express/src/framework/support/logger.ts +148 -0
- package/express/src/framework/support/mail.ts +48 -0
- package/express/src/framework/support/password.ts +23 -0
- package/express/src/framework/support/upload.ts +160 -0
- package/express/src/framework/support/url.ts +41 -0
- package/express/src/middlewares/auth-middleware.ts +98 -0
- package/express/src/middlewares/role-middleware.ts +25 -0
- package/express/src/modules/auth/controllers/auth.controller.ts +358 -0
- package/express/src/modules/auth/controllers/auth.helpers.ts +104 -0
- package/express/src/modules/auth/controllers/auth.schema.ts +102 -0
- package/express/src/modules/auth/controllers/role.controller.ts +15 -0
- package/express/src/modules/auth/database/models/notifications.ts +24 -0
- package/express/src/modules/auth/database/models/role.ts +14 -0
- package/express/src/modules/auth/database/models/user.ts +46 -0
- package/express/src/modules/auth/database/seeders/role.ts +18 -0
- package/express/src/modules/auth/database/seeders/user.ts +35 -0
- package/express/src/modules/auth/jobs/forgetpass.ts +20 -0
- package/express/src/modules/auth/jobs/registeruser.ts +23 -0
- package/express/src/modules/auth/jobs/verifyemail.ts +18 -0
- package/express/src/modules/auth/routes/api.ts +150 -0
- package/express/src/modules/auth/routes/role.ts +33 -0
- package/express/src/resources/index.html +17 -0
- package/express/src/resources/src/App.vue +5 -0
- package/express/src/resources/src/assets/css/styles.css +14761 -0
- package/express/src/resources/src/assets/css/styles.css.map +1 -0
- package/express/src/resources/src/assets/fonts/public-sans/public-sans-latin-ext.woff2 +0 -0
- package/express/src/resources/src/assets/fonts/public-sans/public-sans-latin.woff2 +0 -0
- package/express/src/resources/src/assets/images/favicon/favicon.ico +0 -0
- package/express/src/resources/src/assets/images/logo.png +0 -0
- package/express/src/resources/src/assets/scss/custom.css +217 -0
- package/express/src/resources/src/assets/scss/custom.css.map +1 -0
- package/express/src/resources/src/assets/scss/custom.scss +1346 -0
- package/express/src/resources/src/components/Button.vue +32 -0
- package/express/src/resources/src/components/Checkbox.vue +29 -0
- package/express/src/resources/src/components/Datepicker.vue +106 -0
- package/express/src/resources/src/components/FeatureButton.vue +53 -0
- package/express/src/resources/src/components/FloatButton.vue +33 -0
- package/express/src/resources/src/components/Href.vue +32 -0
- package/express/src/resources/src/components/Input.vue +223 -0
- package/express/src/resources/src/components/InputGroup.vue +145 -0
- package/express/src/resources/src/components/InputPasswordToggle.vue +213 -0
- package/express/src/resources/src/components/Modal.vue +55 -0
- package/express/src/resources/src/components/Pagebar.vue +26 -0
- package/express/src/resources/src/components/Select.vue +384 -0
- package/express/src/resources/src/components/Spinner.vue +42 -0
- package/express/src/resources/src/components/Switch.vue +65 -0
- package/express/src/resources/src/components/TextArea.vue +117 -0
- package/express/src/resources/src/components/Toast.vue +56 -0
- package/express/src/resources/src/components/datatable/DataTableSkeleton.vue +98 -0
- package/express/src/resources/src/components/datatable/Pagination.vue +147 -0
- package/express/src/resources/src/components/datatable/SelectOpption.vue +64 -0
- package/express/src/resources/src/components/datatable/index.vue +199 -0
- package/express/src/resources/src/composables/useAuth.ts +52 -0
- package/express/src/resources/src/helpers/nformatter.ts +10 -0
- package/express/src/resources/src/helpers/utils.ts +75 -0
- package/express/src/resources/src/layouts/AuthLayout.vue +20 -0
- package/express/src/resources/src/layouts/Layout/Footer.vue +23 -0
- package/express/src/resources/src/layouts/Layout/Header.vue +105 -0
- package/express/src/resources/src/layouts/Layout/Sidebar.vue +137 -0
- package/express/src/resources/src/layouts/Layout/index.vue +87 -0
- package/express/src/resources/src/main.ts +26 -0
- package/express/src/resources/src/pages/auth/forgetPassword.vue +82 -0
- package/express/src/resources/src/pages/auth/login.vue +99 -0
- package/express/src/resources/src/pages/auth/register.vue +133 -0
- package/express/src/resources/src/pages/auth/resetPassword.vue +118 -0
- package/express/src/resources/src/pages/auth/verifyEmail.vue +68 -0
- package/express/src/resources/src/pages/dashboard/index.vue +66 -0
- package/express/src/resources/src/plugins/axios.ts +31 -0
- package/express/src/resources/src/plugins/browserDetect.ts +55 -0
- package/express/src/resources/src/plugins/dialog.ts +216 -0
- package/express/src/resources/src/plugins/gum.ts +367 -0
- package/express/src/resources/src/plugins/pulse.ts +147 -0
- package/express/src/resources/src/plugins/routeProgress.ts +87 -0
- package/express/src/resources/src/router/index.ts +85 -0
- package/express/src/resources/src/stores/admin-ui.ts +148 -0
- package/express/src/resources/src/stores/auth.ts +164 -0
- package/express/src/resources/tsconfig.json +19 -0
- package/express/src/resources/vite.config.ts +46 -0
- package/express/src/storage/app/private/.gitkeep +0 -0
- package/express/src/storage/app/public/.gitkeep +0 -0
- package/express/src/storage/app/tmp/generated/.gitkeep +0 -0
- package/express/src/storage/database/nexwire.sqlite +0 -0
- package/express/src/storage/logs/.gitkeep +0 -0
- package/express/src/storage/tmp/.gitkeep +0 -0
- package/express/src/storage/trash/modules/.gitkeep +0 -0
- package/express/src/types/global.d.ts +26 -0
- package/express/tsconfig.json +19 -0
- package/express/vitest.config.ts +23 -0
- package/hono/.dockerignore +14 -0
- package/hono/.env +44 -0
- package/hono/.env.example +42 -0
- package/hono/.vscode/settings.json +26 -0
- package/hono/LICENSE +21 -0
- package/hono/README.md +211 -0
- package/hono/biome.json +76 -0
- package/hono/drizzle.config.ts +25 -0
- package/hono/gitignore-stub +24 -0
- package/hono/package.json +99 -0
- package/hono/public/.gitkeep +0 -0
- package/hono/src/config/app.ts +41 -0
- package/hono/src/config/auth.ts +12 -0
- package/hono/src/config/cache.ts +16 -0
- package/hono/src/config/cookie.ts +15 -0
- package/hono/src/config/cors.ts +12 -0
- package/hono/src/config/database.ts +29 -0
- package/hono/src/config/index.ts +83 -0
- package/hono/src/config/jwt.ts +19 -0
- package/hono/src/config/logging.ts +13 -0
- package/hono/src/config/mail.ts +24 -0
- package/hono/src/config/openapi.ts +54 -0
- package/hono/src/config/queue.ts +30 -0
- package/hono/src/config/rateLimit.ts +17 -0
- package/hono/src/config/realtime.ts +15 -0
- package/hono/src/config/redis.ts +18 -0
- package/hono/src/config/security.ts +44 -0
- package/hono/src/config/session.ts +17 -0
- package/hono/src/config/storage.ts +22 -0
- package/hono/src/config/validate.ts +40 -0
- package/hono/src/database/migrations/sqlite/0000_init.sql +61 -0
- package/hono/src/database/migrations/sqlite/meta/0000_snapshot.json +412 -0
- package/hono/src/database/migrations/sqlite/meta/_journal.json +13 -0
- package/hono/src/database/schema.ts +3 -0
- package/hono/src/env.ts +76 -0
- package/hono/src/framework/cache/cache.ts +81 -0
- package/hono/src/framework/circuit-breaker/cb.ts +60 -0
- package/hono/src/framework/database/connection.ts +196 -0
- package/hono/src/framework/database/migrate-hooks.ts +87 -0
- package/hono/src/framework/database/paginate.ts +253 -0
- package/hono/src/framework/database/schema.ts +20 -0
- package/hono/src/framework/database/seed.ts +139 -0
- package/hono/src/framework/events/dispatcher.ts +49 -0
- package/hono/src/framework/facade.ts +29 -0
- package/hono/src/framework/http/app.ts +109 -0
- package/hono/src/framework/http/cors.ts +19 -0
- package/hono/src/framework/http/logger.ts +81 -0
- package/hono/src/framework/http/metrics.ts +22 -0
- package/hono/src/framework/http/openapi.ts +42 -0
- package/hono/src/framework/http/ratelimiter.ts +172 -0
- package/hono/src/framework/http/router.ts +76 -0
- package/hono/src/framework/http/security.ts +23 -0
- package/hono/src/framework/http/static.ts +70 -0
- package/hono/src/framework/http/validation.ts +21 -0
- package/hono/src/framework/kernel.ts +48 -0
- package/hono/src/framework/maker-cli/db/core.mjs +288 -0
- package/hono/src/framework/maker-cli/db/index.mjs +204 -0
- package/hono/src/framework/maker-cli/deploy/core.mjs +1038 -0
- package/hono/src/framework/maker-cli/deploy/index.mjs +91 -0
- package/hono/src/framework/maker-cli/index.mjs +53 -0
- package/hono/src/framework/maker-cli/middleware/core.mjs +47 -0
- package/hono/src/framework/maker-cli/middleware/index.mjs +12 -0
- package/hono/src/framework/maker-cli/module/core.mjs +684 -0
- package/hono/src/framework/maker-cli/module/index.mjs +140 -0
- package/hono/src/framework/maker-cli/runtime/build-ui.mjs +17 -0
- package/hono/src/framework/maker-cli/runtime/core.mjs +543 -0
- package/hono/src/framework/maker-cli/runtime/index.mjs +104 -0
- package/hono/src/framework/maker-cli/runtime/redis-commander-patch.cjs +20 -0
- package/hono/src/framework/maker-cli/stubs/controller/openapi.ts.stub +57 -0
- package/hono/src/framework/maker-cli/stubs/controller/openapi.with-model.ts.stub +58 -0
- package/hono/src/framework/maker-cli/stubs/controller/plain.ts.stub +59 -0
- package/hono/src/framework/maker-cli/stubs/controller/schema.plain.ts.stub +14 -0
- package/hono/src/framework/maker-cli/stubs/controller/schema.ts.stub +33 -0
- package/hono/src/framework/maker-cli/stubs/deploy/Dockerfile.bun.stub +52 -0
- package/hono/src/framework/maker-cli/stubs/deploy/Dockerfile.pnpm.stub +55 -0
- package/hono/src/framework/maker-cli/stubs/deploy/Dockerfile.stub +51 -0
- package/hono/src/framework/maker-cli/stubs/deploy/Dockerfile.yarn.stub +55 -0
- package/hono/src/framework/maker-cli/stubs/deploy/README.stub +59 -0
- package/hono/src/framework/maker-cli/stubs/deploy/compose/mysql.server.stub +45 -0
- package/hono/src/framework/maker-cli/stubs/deploy/compose/postgres.server.stub +45 -0
- package/hono/src/framework/maker-cli/stubs/deploy/compose/sqlite.stub +45 -0
- package/hono/src/framework/maker-cli/stubs/deploy/env/mysql.server.stub +68 -0
- package/hono/src/framework/maker-cli/stubs/deploy/env/postgres.server.stub +68 -0
- package/hono/src/framework/maker-cli/stubs/deploy/env/sqlite.stub +67 -0
- package/hono/src/framework/maker-cli/stubs/deploy/scripts/auto-migrate.sh.stub +41 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/README.stub +78 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/compose/noredis.stub +120 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/compose/redis.dev.stub +133 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/compose/redis.stub +131 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/env/local.example.stub +11 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/env/noredis.stub +25 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/env/redis.stub +25 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/README.stub +16 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/app.example.com.stub +13 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/pgadmin/servers.stub +14 -0
- package/hono/src/framework/maker-cli/stubs/deploy/server/redis/redis.conf.stub +7 -0
- package/hono/src/framework/maker-cli/stubs/deploy/supervisor/noredis.stub +54 -0
- package/hono/src/framework/maker-cli/stubs/deploy/supervisor/redis.stub +70 -0
- package/hono/src/framework/maker-cli/stubs/deploy/workflow/local.json.stub +25 -0
- package/hono/src/framework/maker-cli/stubs/deploy/workflow/remote.json.stub +24 -0
- package/hono/src/framework/maker-cli/stubs/example/console.ts.stub +34 -0
- package/hono/src/framework/maker-cli/stubs/example/controller.ts.stub +505 -0
- package/hono/src/framework/maker-cli/stubs/example/job.ts.stub +75 -0
- package/hono/src/framework/maker-cli/stubs/example/route.api.ts.stub +207 -0
- package/hono/src/framework/maker-cli/stubs/example/route.plain.ts.stub +18 -0
- package/hono/src/framework/maker-cli/stubs/example/schema.plain.ts.stub +42 -0
- package/hono/src/framework/maker-cli/stubs/example/schema.ts.stub +42 -0
- package/hono/src/framework/maker-cli/stubs/job/name.ts.stub +25 -0
- package/hono/src/framework/maker-cli/stubs/middleware/name.ts.stub +14 -0
- package/hono/src/framework/maker-cli/stubs/model/name.mysql.ts.stub +9 -0
- package/hono/src/framework/maker-cli/stubs/model/name.postgresql.ts.stub +9 -0
- package/hono/src/framework/maker-cli/stubs/model/name.sqlite.ts.stub +9 -0
- package/hono/src/framework/maker-cli/stubs/notification/controller.ts.stub +86 -0
- package/hono/src/framework/maker-cli/stubs/notification/job.ts.stub +13 -0
- package/hono/src/framework/maker-cli/stubs/notification/route.api.ts.stub +50 -0
- package/hono/src/framework/maker-cli/stubs/notification/route.plain.ts.stub +12 -0
- package/hono/src/framework/maker-cli/stubs/notification/schema.plain.ts.stub +26 -0
- package/hono/src/framework/maker-cli/stubs/notification/schema.ts.stub +26 -0
- package/hono/src/framework/maker-cli/stubs/route/api.ts.stub +80 -0
- package/hono/src/framework/maker-cli/stubs/route/plain.ts.stub +11 -0
- package/hono/src/framework/maker-cli/stubs/schedule/name.ts.stub +36 -0
- package/hono/src/framework/maker-cli/stubs/seeder/name.ts.stub +20 -0
- package/hono/src/framework/maker-cli/stubs/test/unit.ts.stub +22 -0
- package/hono/src/framework/maker-cli/utils/env-config.mjs +44 -0
- package/hono/src/framework/maker-cli/utils/env-db.mjs +61 -0
- package/hono/src/framework/maker-cli/utils/file-ops.mjs +30 -0
- package/hono/src/framework/maker-cli/utils/flags.mjs +14 -0
- package/hono/src/framework/maker-cli/utils/help.mjs +50 -0
- package/hono/src/framework/maker-cli/utils/naming.mjs +13 -0
- package/hono/src/framework/maker-cli/utils/process.mjs +52 -0
- package/hono/src/framework/modules/discover.ts +54 -0
- package/hono/src/framework/modules/routes.ts +24 -0
- package/hono/src/framework/notification/index.ts +116 -0
- package/hono/src/framework/queue/clear.ts +22 -0
- package/hono/src/framework/queue/queue.ts +342 -0
- package/hono/src/framework/queue/ui.ts +214 -0
- package/hono/src/framework/queue/worker.ts +61 -0
- package/hono/src/framework/realtime/broadcast.ts +46 -0
- package/hono/src/framework/realtime/index.ts +2 -0
- package/hono/src/framework/realtime/socket-cookie.ts +68 -0
- package/hono/src/framework/realtime/socket.ts +196 -0
- package/hono/src/framework/realtime/types.ts +6 -0
- package/hono/src/framework/realtime/ui.ts +16 -0
- package/hono/src/framework/redis/client.ts +151 -0
- package/hono/src/framework/runtime/runtime.ts +23 -0
- package/hono/src/framework/runtime/server-adapter.ts +94 -0
- package/hono/src/framework/scheduler/lock.ts +116 -0
- package/hono/src/framework/scheduler/run.ts +48 -0
- package/hono/src/framework/scheduler/scheduler.ts +155 -0
- package/hono/src/framework/server.ts +183 -0
- package/hono/src/framework/session/session.ts +116 -0
- package/hono/src/framework/storage/storage.ts +785 -0
- package/hono/src/framework/support/cookie.ts +99 -0
- package/hono/src/framework/support/jwt.ts +45 -0
- package/hono/src/framework/support/lifecycle.ts +35 -0
- package/hono/src/framework/support/logger.ts +148 -0
- package/hono/src/framework/support/mail.ts +48 -0
- package/hono/src/framework/support/password.ts +23 -0
- package/hono/src/framework/support/url.ts +41 -0
- package/hono/src/middlewares/auth-middleware.ts +98 -0
- package/hono/src/middlewares/role-middleware.ts +25 -0
- package/hono/src/modules/auth/controllers/auth.controller.ts +413 -0
- package/hono/src/modules/auth/controllers/auth.helpers.ts +128 -0
- package/hono/src/modules/auth/controllers/auth.schema.ts +102 -0
- package/hono/src/modules/auth/controllers/role.controller.ts +25 -0
- package/hono/src/modules/auth/database/models/notifications.ts +24 -0
- package/hono/src/modules/auth/database/models/role.ts +14 -0
- package/hono/src/modules/auth/database/models/user.ts +46 -0
- package/hono/src/modules/auth/database/seeders/role.ts +18 -0
- package/hono/src/modules/auth/database/seeders/user.ts +35 -0
- package/hono/src/modules/auth/jobs/forgetpass.ts +20 -0
- package/hono/src/modules/auth/jobs/registeruser.ts +23 -0
- package/hono/src/modules/auth/jobs/verifyemail.ts +18 -0
- package/hono/src/modules/auth/routes/api.ts +150 -0
- package/hono/src/modules/auth/routes/role.ts +33 -0
- package/hono/src/resources/index.html +17 -0
- package/hono/src/resources/src/App.vue +5 -0
- package/hono/src/resources/src/assets/css/styles.css +14913 -0
- package/hono/src/resources/src/assets/css/styles.css.map +1 -0
- package/hono/src/resources/src/assets/fonts/public-sans/public-sans-latin-ext.woff2 +0 -0
- package/hono/src/resources/src/assets/fonts/public-sans/public-sans-latin.woff2 +0 -0
- package/hono/src/resources/src/assets/images/favicon/favicon.ico +0 -0
- package/hono/src/resources/src/assets/images/logo.png +0 -0
- package/hono/src/resources/src/assets/scss/custom.css +217 -0
- package/hono/src/resources/src/assets/scss/custom.css.map +1 -0
- package/hono/src/resources/src/assets/scss/custom.scss +1346 -0
- package/hono/src/resources/src/components/Button.vue +32 -0
- package/hono/src/resources/src/components/Checkbox.vue +29 -0
- package/hono/src/resources/src/components/Datepicker.vue +106 -0
- package/hono/src/resources/src/components/FeatureButton.vue +53 -0
- package/hono/src/resources/src/components/FloatButton.vue +33 -0
- package/hono/src/resources/src/components/Href.vue +32 -0
- package/hono/src/resources/src/components/Input.vue +234 -0
- package/hono/src/resources/src/components/InputGroup.vue +149 -0
- package/hono/src/resources/src/components/InputPasswordToggle.vue +222 -0
- package/hono/src/resources/src/components/Modal.vue +55 -0
- package/hono/src/resources/src/components/Pagebar.vue +26 -0
- package/hono/src/resources/src/components/Select.vue +415 -0
- package/hono/src/resources/src/components/Spinner.vue +42 -0
- package/hono/src/resources/src/components/Switch.vue +65 -0
- package/hono/src/resources/src/components/TextArea.vue +121 -0
- package/hono/src/resources/src/components/Toast.vue +56 -0
- package/hono/src/resources/src/components/datatable/DataTableSkeleton.vue +98 -0
- package/hono/src/resources/src/components/datatable/Pagination.vue +147 -0
- package/hono/src/resources/src/components/datatable/SelectOpption.vue +64 -0
- package/hono/src/resources/src/components/datatable/index.vue +199 -0
- package/hono/src/resources/src/composables/useAuth.ts +52 -0
- package/hono/src/resources/src/helpers/nformatter.ts +10 -0
- package/hono/src/resources/src/helpers/utils.ts +75 -0
- package/hono/src/resources/src/layouts/AuthLayout.vue +20 -0
- package/hono/src/resources/src/layouts/Layout/Footer.vue +23 -0
- package/hono/src/resources/src/layouts/Layout/Header.vue +105 -0
- package/hono/src/resources/src/layouts/Layout/Sidebar.vue +137 -0
- package/hono/src/resources/src/layouts/Layout/index.vue +87 -0
- package/hono/src/resources/src/main.ts +26 -0
- package/hono/src/resources/src/pages/auth/forgetPassword.vue +82 -0
- package/hono/src/resources/src/pages/auth/login.vue +99 -0
- package/hono/src/resources/src/pages/auth/register.vue +133 -0
- package/hono/src/resources/src/pages/auth/resetPassword.vue +118 -0
- package/hono/src/resources/src/pages/auth/verifyEmail.vue +68 -0
- package/hono/src/resources/src/pages/dashboard/index.vue +66 -0
- package/hono/src/resources/src/plugins/axios.ts +31 -0
- package/hono/src/resources/src/plugins/browserDetect.ts +55 -0
- package/hono/src/resources/src/plugins/dialog.ts +216 -0
- package/hono/src/resources/src/plugins/gum.ts +367 -0
- package/hono/src/resources/src/plugins/pulse.ts +147 -0
- package/hono/src/resources/src/plugins/routeProgress.ts +87 -0
- package/hono/src/resources/src/router/index.ts +85 -0
- package/hono/src/resources/src/stores/admin-ui.ts +148 -0
- package/hono/src/resources/src/stores/auth.ts +164 -0
- package/hono/src/resources/tsconfig.json +19 -0
- package/hono/src/resources/vite.config.ts +46 -0
- package/hono/src/storage/app/private/.gitkeep +0 -0
- package/hono/src/storage/app/public/.gitkeep +0 -0
- package/hono/src/storage/app/tmp/generated/.gitkeep +0 -0
- package/hono/src/storage/database/nexwire.sqlite +0 -0
- package/hono/src/storage/logs/.gitkeep +0 -0
- package/hono/src/storage/tmp/.gitkeep +0 -0
- package/hono/src/storage/trash/modules/.gitkeep +0 -0
- package/hono/src/types/global.d.ts +26 -0
- package/hono/tsconfig.json +20 -0
- package/hono/vitest.config.ts +23 -0
- package/package.json +238 -0
- package/src/index.js +204 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header :class="{ scrolled: isScrolled }">
|
|
3
|
+
<nav class="navbar bg-transparent p-0">
|
|
4
|
+
<div class="container-fluid p-0 row-gap-2 column-gap-1">
|
|
5
|
+
<button
|
|
6
|
+
id="off-canvas"
|
|
7
|
+
type="button"
|
|
8
|
+
class="nav-btn order-0"
|
|
9
|
+
title="Toggle Button"
|
|
10
|
+
@click="props.onToggleSidebar">
|
|
11
|
+
<i class="bi bi-layout-text-sidebar-reverse"></i>
|
|
12
|
+
</button>
|
|
13
|
+
<div id="pagebar" class="card card-body nav-card order-5 order-sm-2"></div>
|
|
14
|
+
<template v-for="btn in featureButtons" :key="btn.id">
|
|
15
|
+
<button v-if="!btn.render" type="button" class="nav-btn order-3 order-sm-3" :class="btn.class" :title="btn.title || undefined" :aria-label="btn.label || 'button'" v-bind="btn.attrs" @click="btn.onClick">
|
|
16
|
+
<i v-if="btn.icon" :class="btn.icon"></i>
|
|
17
|
+
<span v-if="btn.label" class="ms-1">{{ btn.label }}</span>
|
|
18
|
+
</button>
|
|
19
|
+
<template v-else>
|
|
20
|
+
<component :is="featureComponent(btn)" />
|
|
21
|
+
</template>
|
|
22
|
+
</template>
|
|
23
|
+
<div class="btn-group order-4 order-sm-4">
|
|
24
|
+
<button type="button" class="nav-btn w-100" title="user" data-bs-toggle="dropdown" data-bs-display="static" aria-expanded="false" aria-label="button">
|
|
25
|
+
<i class="bi bi-person-circle"></i>
|
|
26
|
+
</button>
|
|
27
|
+
<ul class="dropdown-menu dropdown-menu-end">
|
|
28
|
+
<li>
|
|
29
|
+
<a class="dropdown-item" href="#">
|
|
30
|
+
<div class="d-flex align-items-center">
|
|
31
|
+
<div class="flex-shrink-0 me-3">
|
|
32
|
+
<i class="bi bi-person-circle fs-1"></i>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="flex-grow-1 text-capitalize">
|
|
35
|
+
<h6 class="mb-0">{{ authUser?.name }}</h6>
|
|
36
|
+
<small class="text-muted">{{ authUser.role?.name }}</small>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</a>
|
|
40
|
+
</li>
|
|
41
|
+
<li>
|
|
42
|
+
<div class="dropdown-divider my-1"></div>
|
|
43
|
+
</li>
|
|
44
|
+
<li>
|
|
45
|
+
<router-link class="dropdown-item" to="/profile">
|
|
46
|
+
<i class="bi bi-person-check me-3"></i><span>My Profile</span>
|
|
47
|
+
</router-link>
|
|
48
|
+
</li>
|
|
49
|
+
<li>
|
|
50
|
+
<button type="button" class="dropdown-item" @click="props.onLogout">
|
|
51
|
+
<i class="bi bi-power me-3"></i><span>Log Out</span>
|
|
52
|
+
</button>
|
|
53
|
+
</li>
|
|
54
|
+
</ul>
|
|
55
|
+
</div>
|
|
56
|
+
<button id="theme-switch" type="button" title="theme" class="nav-btn order-1 order-sm-5" aria-label="button" @click="props.onToggleTheme">
|
|
57
|
+
<i :class="themeIconClass"></i>
|
|
58
|
+
</button>
|
|
59
|
+
</div>
|
|
60
|
+
</nav>
|
|
61
|
+
</header>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<script setup lang="ts">
|
|
65
|
+
import { computed, h, inject } from "vue";
|
|
66
|
+
import { authUser } from "@/composables/useAuth";
|
|
67
|
+
|
|
68
|
+
interface ButtonEntry {
|
|
69
|
+
id: symbol;
|
|
70
|
+
icon?: string;
|
|
71
|
+
label: string;
|
|
72
|
+
title: string;
|
|
73
|
+
attrs?: Record<string, string>;
|
|
74
|
+
class?: any;
|
|
75
|
+
onClick: () => void;
|
|
76
|
+
render?: () => any[];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const featureButtons = inject<ButtonEntry[]>("featureButtons")!;
|
|
80
|
+
|
|
81
|
+
function featureComponent(btn: ButtonEntry) {
|
|
82
|
+
return {
|
|
83
|
+
name: "FeatureSlot",
|
|
84
|
+
render: () => h("div", { class: ["order-3 order-sm-4", btn.class] }, btn.render!())
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface HeaderProps {
|
|
89
|
+
isScrolled: boolean;
|
|
90
|
+
themeMode: "light" | "dark" | "auto";
|
|
91
|
+
onLogout: () => void | Promise<void>;
|
|
92
|
+
onToggleSidebar: () => void;
|
|
93
|
+
onToggleTheme: () => void;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const props = defineProps<HeaderProps>();
|
|
97
|
+
|
|
98
|
+
const themeIconClass = computed(() => {
|
|
99
|
+
if (props.themeMode === "light") return "bi bi-brightness-high-fill";
|
|
100
|
+
if (props.themeMode === "dark") return "bi bi-moon-stars";
|
|
101
|
+
return "bi bi-circle-half";
|
|
102
|
+
});
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- sidebar start -->
|
|
3
|
+
<div class="sidebar">
|
|
4
|
+
<a
|
|
5
|
+
href="#"
|
|
6
|
+
role="button"
|
|
7
|
+
class="sidebar-toggle card card-body rounded-circle position-absolute top-0 end-0 d-xl-none"
|
|
8
|
+
title="sidebar-toggle"
|
|
9
|
+
@click.prevent="props.onToggleSidebar">
|
|
10
|
+
<i class="bi bi-chevron-left fw-bold"></i>
|
|
11
|
+
</a>
|
|
12
|
+
|
|
13
|
+
<div class="app-brand">
|
|
14
|
+
<a href="#" aria-label="logo">
|
|
15
|
+
<img src="@/assets/images/logo.png" alt="nexwire" />
|
|
16
|
+
</a>
|
|
17
|
+
</div>
|
|
18
|
+
<div id="accordion-sidebar" class="accordion accordion-flush">
|
|
19
|
+
<ul class="list-group px-3">
|
|
20
|
+
<li class="list-group-item" :class="{ active: isActive('/') }">
|
|
21
|
+
<router-link to="/">
|
|
22
|
+
<div class="menu-icon">
|
|
23
|
+
<i class="bi bi-house"></i>
|
|
24
|
+
</div>
|
|
25
|
+
<span>Dashboard</span>
|
|
26
|
+
</router-link>
|
|
27
|
+
</li>
|
|
28
|
+
<li class="split-label">
|
|
29
|
+
<span class="text-uppercase">setup</span>
|
|
30
|
+
</li>
|
|
31
|
+
<li class="list-group-item accordion-item">
|
|
32
|
+
<a
|
|
33
|
+
href="#"
|
|
34
|
+
class="accordion-button collapsed"
|
|
35
|
+
type="button"
|
|
36
|
+
data-bs-toggle="collapse"
|
|
37
|
+
data-bs-target="#flush-collapseOne"
|
|
38
|
+
aria-expanded="false"
|
|
39
|
+
aria-controls="flush-collapseOne">
|
|
40
|
+
<div class="menu-icon">
|
|
41
|
+
<i class="bi bi-shield-check"></i>
|
|
42
|
+
</div>
|
|
43
|
+
<span>Content</span>
|
|
44
|
+
</a>
|
|
45
|
+
<ul
|
|
46
|
+
id="flush-collapseOne"
|
|
47
|
+
class="list-group accordion-collapse collapse"
|
|
48
|
+
data-bs-parent="#accordion-sidebar">
|
|
49
|
+
<li class="list-group-item">
|
|
50
|
+
<a href="#">Posts</a>
|
|
51
|
+
</li>
|
|
52
|
+
<li class="list-group-item">
|
|
53
|
+
<a href="#">Pages</a>
|
|
54
|
+
</li>
|
|
55
|
+
<li class="list-group-item accordion-item">
|
|
56
|
+
<a
|
|
57
|
+
href="#"
|
|
58
|
+
class="accordion-button collapsed"
|
|
59
|
+
type="button"
|
|
60
|
+
data-bs-toggle="collapse"
|
|
61
|
+
data-bs-target="#flush-collapseTwo"
|
|
62
|
+
aria-expanded="false"
|
|
63
|
+
aria-controls="flush-collapseTwo">
|
|
64
|
+
<span>Media</span>
|
|
65
|
+
</a>
|
|
66
|
+
<ul id="flush-collapseTwo" class="list-group accordion-collapse collapse">
|
|
67
|
+
<li class="list-group-item">
|
|
68
|
+
<a href="#">Image</a>
|
|
69
|
+
</li>
|
|
70
|
+
<li class="list-group-item active">
|
|
71
|
+
<a href="#">Audio</a>
|
|
72
|
+
</li>
|
|
73
|
+
<li class="list-group-item accordion-item">
|
|
74
|
+
<a
|
|
75
|
+
href="#"
|
|
76
|
+
class="accordion-button collapsed"
|
|
77
|
+
type="button"
|
|
78
|
+
data-bs-toggle="collapse"
|
|
79
|
+
data-bs-target="#flush-collapseThree"
|
|
80
|
+
aria-expanded="false"
|
|
81
|
+
aria-controls="flush-collapseThree">
|
|
82
|
+
<span>Settings</span>
|
|
83
|
+
</a>
|
|
84
|
+
<ul id="flush-collapseThree" class="list-group accordion-collapse collapse">
|
|
85
|
+
<li class="list-group-item">
|
|
86
|
+
<a href="#">Users</a>
|
|
87
|
+
</li>
|
|
88
|
+
<li class="list-group-item">
|
|
89
|
+
<a href="#">Roles</a>
|
|
90
|
+
</li>
|
|
91
|
+
</ul>
|
|
92
|
+
</li>
|
|
93
|
+
</ul>
|
|
94
|
+
</li>
|
|
95
|
+
</ul>
|
|
96
|
+
</li>
|
|
97
|
+
<li class="list-group-item">
|
|
98
|
+
<a href="#">
|
|
99
|
+
<div class="menu-icon">
|
|
100
|
+
<i class="bi bi-chat"></i>
|
|
101
|
+
</div>
|
|
102
|
+
<span>Comments</span>
|
|
103
|
+
</a>
|
|
104
|
+
</li>
|
|
105
|
+
<li class="list-group-item">
|
|
106
|
+
<a href="#">
|
|
107
|
+
<div class="menu-icon">
|
|
108
|
+
<i class="bi bi-gear"></i>
|
|
109
|
+
</div>
|
|
110
|
+
<span>Tools</span>
|
|
111
|
+
</a>
|
|
112
|
+
</li>
|
|
113
|
+
</ul>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
<!-- sidebar end -->
|
|
117
|
+
</template>
|
|
118
|
+
|
|
119
|
+
<script setup lang="ts">
|
|
120
|
+
import { onBeforeUnmount, onMounted } from "vue";
|
|
121
|
+
import { useRoute } from "vue-router";
|
|
122
|
+
import { useAdminUiStore } from "@/stores/admin-ui";
|
|
123
|
+
|
|
124
|
+
const props = defineProps<{ onToggleSidebar: () => void; }>();
|
|
125
|
+
|
|
126
|
+
const ui = useAdminUiStore();
|
|
127
|
+
const route = useRoute();
|
|
128
|
+
|
|
129
|
+
function isActive(path: string) {
|
|
130
|
+
return route.path === path;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
onMounted(() => ui.initSidebarCollapsePersistence());
|
|
134
|
+
onBeforeUnmount(() => ui.cleanupSidebarCollapsePersistence());
|
|
135
|
+
</script>
|
|
136
|
+
|
|
137
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Sidebar :class="{ tgl: sidebarOpen }" :on-toggle-sidebar="ui.toggleSidebar" />
|
|
3
|
+
<!-- main start -->
|
|
4
|
+
<div class="main" :class="{ tgl: sidebarOpen, 'no-transition': disableTransition }">
|
|
5
|
+
<div class="content-wrapper container-xxl px-0">
|
|
6
|
+
<Header
|
|
7
|
+
:is-scrolled="headerScrolled"
|
|
8
|
+
:theme-mode="themeMode"
|
|
9
|
+
:on-logout="logout"
|
|
10
|
+
:on-toggle-sidebar="ui.toggleSidebar"
|
|
11
|
+
:on-toggle-theme="ui.cycleTheme" />
|
|
12
|
+
<!-- content start -->
|
|
13
|
+
<div class="content">
|
|
14
|
+
<router-view />
|
|
15
|
+
</div>
|
|
16
|
+
<!-- content end -->
|
|
17
|
+
<Footer />
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<!-- main end -->
|
|
21
|
+
<div class="backdrop" :class="{ 'off-canvas': sidebarOpen }" @click="ui.toggleSidebar"></div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script setup lang="ts">
|
|
25
|
+
import { storeToRefs } from "pinia";
|
|
26
|
+
import { onBeforeUnmount, onMounted, provide, reactive, ref } from "vue";
|
|
27
|
+
import { useRouter } from "vue-router";
|
|
28
|
+
import Footer from "@/layouts/Layout/Footer.vue";
|
|
29
|
+
import Header from "@/layouts/Layout/Header.vue";
|
|
30
|
+
import Sidebar from "@/layouts/Layout/Sidebar.vue";
|
|
31
|
+
import { useAdminUiStore } from "@/stores/admin-ui";
|
|
32
|
+
import { useAuthStore } from "@/stores/auth";
|
|
33
|
+
|
|
34
|
+
const ui = useAdminUiStore();
|
|
35
|
+
const auth = useAuthStore();
|
|
36
|
+
const router = useRouter();
|
|
37
|
+
const { themeMode, sidebarOpen } = storeToRefs(ui);
|
|
38
|
+
const headerScrolled = ref(false);
|
|
39
|
+
const disableTransition = ref(true);
|
|
40
|
+
const featureButtons = reactive<
|
|
41
|
+
Array<{
|
|
42
|
+
id: symbol;
|
|
43
|
+
icon?: string;
|
|
44
|
+
label: string;
|
|
45
|
+
title: string;
|
|
46
|
+
attrs?: Record<string, string>;
|
|
47
|
+
onClick: () => void;
|
|
48
|
+
}>
|
|
49
|
+
>([]);
|
|
50
|
+
provide("featureButtons", featureButtons);
|
|
51
|
+
|
|
52
|
+
async function logout() {
|
|
53
|
+
await auth.logout();
|
|
54
|
+
await router.push("/login");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function onScroll() {
|
|
58
|
+
const y = window.scrollY;
|
|
59
|
+
if (y > 20) {
|
|
60
|
+
headerScrolled.value = true;
|
|
61
|
+
} else if (y < 5) {
|
|
62
|
+
headerScrolled.value = false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
onMounted(() => {
|
|
67
|
+
ui.initTheme();
|
|
68
|
+
|
|
69
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
70
|
+
onScroll();
|
|
71
|
+
|
|
72
|
+
// Force reflow then enable transitions on next frame
|
|
73
|
+
void document.body.offsetHeight;
|
|
74
|
+
requestAnimationFrame(() => {
|
|
75
|
+
requestAnimationFrame(() => {
|
|
76
|
+
disableTransition.value = false;
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
onBeforeUnmount(() => {
|
|
82
|
+
window.removeEventListener("scroll", onScroll);
|
|
83
|
+
ui.cleanupTheme();
|
|
84
|
+
});
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style scoped></style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "@/plugins/axios";
|
|
2
|
+
import { createHead } from "@vueuse/head";
|
|
3
|
+
import { createPinia } from "pinia";
|
|
4
|
+
import { createApp } from "vue";
|
|
5
|
+
import { DialogPlugin } from "@/plugins/dialog";
|
|
6
|
+
import { GumPlugin } from "@/plugins/gum";
|
|
7
|
+
import { PulsePlugin } from "@/plugins/pulse";
|
|
8
|
+
import App from "./App.vue";
|
|
9
|
+
import router from "./router";
|
|
10
|
+
|
|
11
|
+
import "bootstrap/dist/css/bootstrap.min.css";
|
|
12
|
+
import "bootstrap-icons/font/bootstrap-icons.css";
|
|
13
|
+
import "@/assets/scss/custom.scss";
|
|
14
|
+
import "bootstrap/dist/js/bootstrap.bundle.min.js";
|
|
15
|
+
|
|
16
|
+
const app = createApp(App);
|
|
17
|
+
const pinia = createPinia();
|
|
18
|
+
const head = createHead({ titleTemplate: (title) => (title ? `${title} | nexwire` : "nexwire") });
|
|
19
|
+
|
|
20
|
+
app.use(pinia);
|
|
21
|
+
app.use(router);
|
|
22
|
+
app.use(head);
|
|
23
|
+
app.use(DialogPlugin);
|
|
24
|
+
app.use(GumPlugin);
|
|
25
|
+
app.use(PulsePlugin);
|
|
26
|
+
app.mount("#app");
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container position-absolute start-50 top-50 translate-middle">
|
|
3
|
+
<div class="auth col-12 col-sm-9 col-md-7 col-lg-5 col-xl-4 mx-auto py-5">
|
|
4
|
+
<div class="card card-body border-0">
|
|
5
|
+
<div class="d-block mb-2 text-center">
|
|
6
|
+
<img src="@/assets/images/logo.png" alt="nexwire" style="max-height: 60px;" />
|
|
7
|
+
</div>
|
|
8
|
+
<h4 class="text-center">Forget Password</h4>
|
|
9
|
+
<p
|
|
10
|
+
v-if="message"
|
|
11
|
+
class="text-center alert py-1 mt-2"
|
|
12
|
+
:class="isError ? 'alert-danger text-danger' : 'alert-success text-success'">
|
|
13
|
+
{{ message }}
|
|
14
|
+
</p>
|
|
15
|
+
<form id="formAuthentication" @submit.prevent="onSubmit">
|
|
16
|
+
<div class="mb-4">
|
|
17
|
+
<Input
|
|
18
|
+
id="email"
|
|
19
|
+
v-model="form.data.email"
|
|
20
|
+
type="email"
|
|
21
|
+
label="email"
|
|
22
|
+
placeholder="Enter your email..."
|
|
23
|
+
:err="form.errors.email"
|
|
24
|
+
focus
|
|
25
|
+
must />
|
|
26
|
+
</div>
|
|
27
|
+
<Button
|
|
28
|
+
type="submit"
|
|
29
|
+
label="Send Reset Link"
|
|
30
|
+
class="btn btn-primary w-100"
|
|
31
|
+
icon="bi bi-send ms-2"
|
|
32
|
+
:disabled="processing" />
|
|
33
|
+
</form>
|
|
34
|
+
<div class="text-center mt-2">
|
|
35
|
+
<router-link to="/login">
|
|
36
|
+
<i class="bx bx-chevron-left scaleX-n1-rtl me-1"></i>
|
|
37
|
+
<span>Back to login</span>
|
|
38
|
+
</router-link>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script setup lang="ts">
|
|
46
|
+
import { useHead } from "@vueuse/head";
|
|
47
|
+
import { ref } from "vue";
|
|
48
|
+
import Button from "@/components/Button.vue";
|
|
49
|
+
import Input from "@/components/Input.vue";
|
|
50
|
+
import { useGumForm } from "@/plugins/gum";
|
|
51
|
+
|
|
52
|
+
useHead({ title: "Forget Password" });
|
|
53
|
+
|
|
54
|
+
const form = useGumForm({ email: "" });
|
|
55
|
+
const processing = form.processing;
|
|
56
|
+
const message = ref("");
|
|
57
|
+
const isError = ref(false);
|
|
58
|
+
|
|
59
|
+
const onSubmit = async () => {
|
|
60
|
+
message.value = "";
|
|
61
|
+
isError.value = false;
|
|
62
|
+
await form.post(
|
|
63
|
+
"/api/auth/forgot-password",
|
|
64
|
+
{
|
|
65
|
+
email: String(form.data.email || "").trim()
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
onSuccess: (res) => {
|
|
69
|
+
isError.value = false;
|
|
70
|
+
message.value = res.data.message;
|
|
71
|
+
form.reset();
|
|
72
|
+
},
|
|
73
|
+
onError: (_errors, error) => {
|
|
74
|
+
isError.value = true;
|
|
75
|
+
message.value = error instanceof Error ? error.message : "Failed to process request";
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container position-absolute start-50 top-50 translate-middle">
|
|
3
|
+
<div class="auth col-12 col-sm-9 col-md-7 col-lg-5 col-xl-4 mx-auto py-5">
|
|
4
|
+
<div class="card card-body border-0">
|
|
5
|
+
<div class="d-block mb-2 text-center">
|
|
6
|
+
<img src="@/assets/images/logo.png" alt="nexwire" style="max-height: 60px;" />
|
|
7
|
+
</div>
|
|
8
|
+
<p v-if="errorMessage" class="text-center alert alert-danger text-danger py-1 mt-2">
|
|
9
|
+
{{ errorMessage }}
|
|
10
|
+
</p>
|
|
11
|
+
<form @submit.prevent="onSubmit">
|
|
12
|
+
<div class="mb-4">
|
|
13
|
+
<Input
|
|
14
|
+
id="email"
|
|
15
|
+
v-model="form.data.email"
|
|
16
|
+
type="email"
|
|
17
|
+
label="email"
|
|
18
|
+
placeholder="Enter your email..."
|
|
19
|
+
:err="form.errors.email"
|
|
20
|
+
focus
|
|
21
|
+
must />
|
|
22
|
+
</div>
|
|
23
|
+
<div class="mb-4">
|
|
24
|
+
<input-password-toggle
|
|
25
|
+
id="password"
|
|
26
|
+
v-model="form.data.password"
|
|
27
|
+
label="password"
|
|
28
|
+
placeholder="Enter your password..."
|
|
29
|
+
:err="form.errors.password"
|
|
30
|
+
must />
|
|
31
|
+
</div>
|
|
32
|
+
<div class="mb-4 d-flex align-items-center justify-content-between">
|
|
33
|
+
<Checkbox id="remember-me" v-model="form.data.remember" label="Remember me" />
|
|
34
|
+
<router-link to="/forget-password" class="text-decoration-none mb-1">Forget
|
|
35
|
+
Password?</router-link>
|
|
36
|
+
</div>
|
|
37
|
+
<Button type="submit" class="btn btn-primary w-100" label="Login"
|
|
38
|
+
icon="bi bi-box-arrow-in-right" :disabled="processing" />
|
|
39
|
+
<div class="text-center mt-3">
|
|
40
|
+
<span class="text-muted">Don't have an account?</span>
|
|
41
|
+
<router-link to="/register" class="ms-1 text-decoration-none">Register</router-link>
|
|
42
|
+
</div>
|
|
43
|
+
</form>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script setup lang="ts">
|
|
50
|
+
import { useHead } from "@vueuse/head";
|
|
51
|
+
import { ref } from "vue";
|
|
52
|
+
import { useRouter } from "vue-router";
|
|
53
|
+
import Checkbox from "@/components/Checkbox.vue";
|
|
54
|
+
import Input from "@/components/Input.vue";
|
|
55
|
+
import InputPasswordToggle from "@/components/InputPasswordToggle.vue";
|
|
56
|
+
import Button from "@/components/Button.vue";
|
|
57
|
+
import { useGumForm } from "@/plugins/gum";
|
|
58
|
+
import { useAuthStore } from "@/stores/auth";
|
|
59
|
+
|
|
60
|
+
useHead({ title: "Login" });
|
|
61
|
+
|
|
62
|
+
const router = useRouter();
|
|
63
|
+
const auth = useAuthStore();
|
|
64
|
+
const errorMessage = ref("");
|
|
65
|
+
|
|
66
|
+
const form = useGumForm({
|
|
67
|
+
email: "",
|
|
68
|
+
password: "",
|
|
69
|
+
remember: false
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const processing = form.processing;
|
|
73
|
+
|
|
74
|
+
const onSubmit = async () => {
|
|
75
|
+
errorMessage.value = "";
|
|
76
|
+
await form.post(
|
|
77
|
+
"/api/auth/login",
|
|
78
|
+
{
|
|
79
|
+
email: String(form.data.email || "").trim(),
|
|
80
|
+
password: form.data.password,
|
|
81
|
+
remember: !!form.data.remember
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
onSuccess: async () => {
|
|
85
|
+
auth.initialized = false;
|
|
86
|
+
await auth.bootstrap();
|
|
87
|
+
form.reset("password");
|
|
88
|
+
await router.push("/");
|
|
89
|
+
},
|
|
90
|
+
onError: (_errors, error) => {
|
|
91
|
+
errorMessage.value = error instanceof Error ? error.message : "Unable to login right now";
|
|
92
|
+
form.reset("password");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container position-absolute start-50 top-50 translate-middle">
|
|
3
|
+
<div class="auth col-12 col-sm-9 col-md-7 col-lg-5 col-xl-4 mx-auto py-5">
|
|
4
|
+
<div class="card card-body border-0">
|
|
5
|
+
<div class="d-block mb-2 text-center">
|
|
6
|
+
<img src="@/assets/images/logo.png" alt="nexwire" style="max-height: 60px;" />
|
|
7
|
+
</div>
|
|
8
|
+
<h4 class="text-center">Create Account</h4>
|
|
9
|
+
<p
|
|
10
|
+
v-if="message"
|
|
11
|
+
class="text-center alert py-1 mt-2"
|
|
12
|
+
:class="isError ? 'alert-danger text-danger' : 'alert-success text-success'">
|
|
13
|
+
{{ message }}
|
|
14
|
+
</p>
|
|
15
|
+
<form @submit.prevent="onSubmit">
|
|
16
|
+
<div class="mb-4">
|
|
17
|
+
<Input
|
|
18
|
+
id="name"
|
|
19
|
+
v-model="form.data.name"
|
|
20
|
+
type="text"
|
|
21
|
+
label="name"
|
|
22
|
+
placeholder="Enter your name..."
|
|
23
|
+
:err="form.errors.name"
|
|
24
|
+
focus
|
|
25
|
+
must />
|
|
26
|
+
</div>
|
|
27
|
+
<div class="mb-4">
|
|
28
|
+
<Input
|
|
29
|
+
id="email"
|
|
30
|
+
v-model="form.data.email"
|
|
31
|
+
type="email"
|
|
32
|
+
label="email"
|
|
33
|
+
placeholder="Enter your email..."
|
|
34
|
+
:err="form.errors.email"
|
|
35
|
+
must />
|
|
36
|
+
</div>
|
|
37
|
+
<div class="mb-4">
|
|
38
|
+
<InputPasswordToggle
|
|
39
|
+
id="password"
|
|
40
|
+
v-model="form.data.password"
|
|
41
|
+
label="password"
|
|
42
|
+
placeholder="Create a password..."
|
|
43
|
+
:err="form.errors.password"
|
|
44
|
+
must />
|
|
45
|
+
</div>
|
|
46
|
+
<div class="mb-4">
|
|
47
|
+
<InputPasswordToggle
|
|
48
|
+
id="password_confirmation"
|
|
49
|
+
v-model="form.data.password_confirmation"
|
|
50
|
+
label="confirm password"
|
|
51
|
+
placeholder="Confirm your password..."
|
|
52
|
+
:err="form.errors.password_confirmation"
|
|
53
|
+
must />
|
|
54
|
+
</div>
|
|
55
|
+
<Button type="submit" class="btn btn-primary w-100" label="Create Account"
|
|
56
|
+
icon="bi bi-person-plus" :disabled="processing" />
|
|
57
|
+
</form>
|
|
58
|
+
<div class="text-center mt-3">
|
|
59
|
+
<span class="text-muted">Already have an account?</span>
|
|
60
|
+
<router-link to="/login" class="ms-1 text-decoration-none">Login</router-link>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script setup lang="ts">
|
|
68
|
+
import { useHead } from "@vueuse/head";
|
|
69
|
+
import { ref } from "vue";
|
|
70
|
+
import { useRouter } from "vue-router";
|
|
71
|
+
import Input from "@/components/Input.vue";
|
|
72
|
+
import InputPasswordToggle from "@/components/InputPasswordToggle.vue";
|
|
73
|
+
import Button from "@/components/Button.vue";
|
|
74
|
+
import { useGumForm } from "@/plugins/gum";
|
|
75
|
+
import { useAuthStore } from "@/stores/auth";
|
|
76
|
+
|
|
77
|
+
useHead({ title: "Register" });
|
|
78
|
+
|
|
79
|
+
const router = useRouter();
|
|
80
|
+
const auth = useAuthStore();
|
|
81
|
+
|
|
82
|
+
const form = useGumForm({
|
|
83
|
+
name: "",
|
|
84
|
+
email: "",
|
|
85
|
+
password: "",
|
|
86
|
+
password_confirmation: ""
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const processing = form.processing;
|
|
90
|
+
const message = ref("");
|
|
91
|
+
const isError = ref(false);
|
|
92
|
+
|
|
93
|
+
const onSubmit = async () => {
|
|
94
|
+
message.value = "";
|
|
95
|
+
isError.value = false;
|
|
96
|
+
|
|
97
|
+
if (form.data.password !== form.data.password_confirmation) {
|
|
98
|
+
isError.value = true;
|
|
99
|
+
message.value = "Password confirmation does not match";
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
await form.post(
|
|
104
|
+
"/api/auth/register",
|
|
105
|
+
{
|
|
106
|
+
name: String(form.data.name || "").trim(),
|
|
107
|
+
email: String(form.data.email || "").trim(),
|
|
108
|
+
password: form.data.password,
|
|
109
|
+
password_confirmation: form.data.password_confirmation
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
onSuccess: async () => {
|
|
113
|
+
auth.initialized = false;
|
|
114
|
+
await auth.bootstrap();
|
|
115
|
+
|
|
116
|
+
if (auth.isAuthenticated) {
|
|
117
|
+
await router.push("/");
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
message.value = "Registration successful. Please verify your email.";
|
|
122
|
+
form.reset();
|
|
123
|
+
},
|
|
124
|
+
onError: (_errors, error) => {
|
|
125
|
+
isError.value = true;
|
|
126
|
+
message.value = error instanceof Error ? error.message : "Unable to register right now";
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
</script>
|
|
132
|
+
|
|
133
|
+
<style lang="scss" scoped></style>
|