create-nexwire 4.2.5 → 4.4.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 +29 -12
- package/express/.env +1 -1
- package/express/package.json +1 -1
- package/express/src/config/database.ts +48 -29
- package/express/src/config/index.ts +83 -83
- package/express/src/config/openapi.ts +6 -24
- package/express/src/config/queue.ts +30 -30
- package/express/src/config/validate.ts +50 -40
- package/express/src/database/migrations/sqlite/0000_init.sql +47 -47
- package/express/src/database/migrations/sqlite/meta/0000_snapshot.json +1 -1
- package/express/src/database/migrations/sqlite/meta/_journal.json +1 -1
- package/express/src/framework/cache/cache.ts +40 -8
- package/express/src/framework/circuit-breaker/cb.ts +88 -60
- package/express/src/framework/database/connection.ts +52 -27
- package/express/src/framework/events/dispatcher.ts +61 -49
- package/express/src/framework/facade.ts +47 -3
- package/express/src/framework/http/app.ts +28 -22
- package/express/src/framework/http/logger.ts +37 -17
- package/express/src/framework/http/openapi.ts +9 -11
- package/express/src/framework/maker-cli/runtime/core.mjs +1 -2
- package/express/src/framework/modules/routes.ts +26 -21
- package/express/src/framework/notification/channels/broadcast.ts +15 -0
- package/express/src/framework/notification/channels/mail.ts +42 -0
- package/express/src/framework/notification/contracts.ts +29 -0
- package/express/src/framework/notification/index.ts +19 -94
- package/express/src/framework/notification/registry.ts +15 -0
- package/express/src/framework/providers/adapter.ts +27 -17
- package/express/src/framework/queue/queue.ts +43 -44
- package/express/src/framework/realtime/broadcast.ts +29 -5
- package/express/src/framework/realtime/socket.ts +149 -119
- package/express/src/framework/redis/client.ts +148 -151
- package/express/src/framework/runtime/server-adapter.ts +39 -34
- package/express/src/framework/scheduler/lock.ts +128 -116
- package/express/src/framework/server.ts +33 -49
- package/express/src/framework/session/session.ts +69 -14
- package/express/src/framework/storage/storage.ts +744 -785
- package/express/src/framework/support/mail.ts +15 -7
- package/express/src/middlewares/auth-middleware.ts +1 -2
- package/express/src/middlewares/role-middleware.ts +3 -13
- package/express/src/modules/auth/routes/index.ts +1 -2
- package/express/src/providers/notification.ts +4 -0
- package/express/src/resources/src/components/Switch.vue +60 -65
- package/express/src/resources/src/layouts/Layout/Header.vue +124 -105
- package/express/src/resources/src/pages/auth/forgetPassword.vue +23 -30
- package/express/src/resources/src/pages/auth/login.vue +25 -28
- package/express/src/resources/src/pages/auth/register.vue +35 -39
- package/express/src/resources/src/pages/auth/resetPassword.vue +29 -37
- package/express/src/resources/src/pages/auth/verifyEmail.vue +15 -19
- package/express/src/resources/src/plugins/gum.ts +519 -203
- package/express/src/resources/src/plugins/pulse.ts +157 -147
- package/express/src/resources/src/stores/auth.ts +9 -6
- package/express/src/resources/vite.config.ts +54 -43
- package/express/src/storage/database/nexwire.sqlite +0 -0
- package/express/src/storage/logs/app.log +0 -0
- package/express/src/storage/logs/fatal.log +0 -0
- package/express/src/types/global.d.ts +32 -26
- package/fastify/.dockerignore +14 -0
- package/fastify/.env +44 -0
- package/fastify/.env.example +42 -0
- package/fastify/.vscode/extensions.json +6 -0
- package/fastify/.vscode/settings.json +37 -0
- package/fastify/LICENSE +21 -0
- package/fastify/README.md +232 -0
- package/fastify/biome.json +99 -0
- package/fastify/drizzle.config.ts +25 -0
- package/fastify/gitignore-stub +31 -0
- package/fastify/package.json +130 -0
- package/fastify/public/.gitkeep +0 -0
- package/fastify/src/config/app.ts +41 -0
- package/fastify/src/config/auth.ts +12 -0
- package/fastify/src/config/cache.ts +16 -0
- package/fastify/src/config/cookie.ts +15 -0
- package/fastify/src/config/cors.ts +12 -0
- package/fastify/src/config/database.ts +48 -0
- package/fastify/src/config/index.ts +83 -0
- package/fastify/src/config/jwt.ts +19 -0
- package/fastify/src/config/logging.ts +13 -0
- package/fastify/src/config/mail.ts +24 -0
- package/fastify/src/config/openapi.ts +36 -0
- package/fastify/src/config/queue.ts +30 -0
- package/fastify/src/config/rateLimit.ts +17 -0
- package/fastify/src/config/realtime.ts +15 -0
- package/fastify/src/config/redis.ts +18 -0
- package/fastify/src/config/security.ts +44 -0
- package/fastify/src/config/session.ts +17 -0
- package/fastify/src/config/storage.ts +22 -0
- package/fastify/src/config/validate.ts +50 -0
- package/fastify/src/database/migrations/sqlite/0000_init.sql +48 -0
- package/fastify/src/database/migrations/sqlite/meta/0000_snapshot.json +324 -0
- package/fastify/src/database/migrations/sqlite/meta/_journal.json +13 -0
- package/fastify/src/database/schema.ts +2 -0
- package/fastify/src/env.ts +76 -0
- package/fastify/src/framework/cache/cache.ts +114 -0
- package/fastify/src/framework/circuit-breaker/cb.ts +88 -0
- package/fastify/src/framework/database/app-schema.ts +37 -0
- package/fastify/src/framework/database/connection.ts +223 -0
- package/fastify/src/framework/database/migrate-hooks.ts +87 -0
- package/fastify/src/framework/database/paginate.ts +226 -0
- package/fastify/src/framework/database/schema.ts +20 -0
- package/fastify/src/framework/database/seed.ts +152 -0
- package/fastify/src/framework/events/dispatcher.ts +61 -0
- package/fastify/src/framework/facade.ts +96 -0
- package/fastify/src/framework/http/app.ts +176 -0
- package/fastify/src/framework/http/cors.ts +13 -0
- package/fastify/src/framework/http/fastify.d.ts +13 -0
- package/fastify/src/framework/http/logger.ts +110 -0
- package/fastify/src/framework/http/metrics.ts +22 -0
- package/fastify/src/framework/http/openapi.ts +48 -0
- package/fastify/src/framework/http/ratelimiter.ts +47 -0
- package/fastify/src/framework/http/security.ts +25 -0
- package/fastify/src/framework/http/static.ts +83 -0
- package/fastify/src/framework/http/validation.ts +49 -0
- package/fastify/src/framework/kernel.ts +43 -0
- package/fastify/src/framework/maker-cli/db/core.mjs +291 -0
- package/fastify/src/framework/maker-cli/db/index.mjs +204 -0
- package/fastify/src/framework/maker-cli/deploy/core.mjs +1046 -0
- package/fastify/src/framework/maker-cli/deploy/index.mjs +91 -0
- package/fastify/src/framework/maker-cli/index.mjs +65 -0
- package/fastify/src/framework/maker-cli/middleware/core.mjs +41 -0
- package/fastify/src/framework/maker-cli/middleware/index.mjs +17 -0
- package/fastify/src/framework/maker-cli/module/core.mjs +1066 -0
- package/fastify/src/framework/maker-cli/module/index.mjs +211 -0
- package/fastify/src/framework/maker-cli/provider/core.mjs +49 -0
- package/fastify/src/framework/maker-cli/provider/index.mjs +12 -0
- package/fastify/src/framework/maker-cli/runtime/build-ui.mjs +16 -0
- package/fastify/src/framework/maker-cli/runtime/core.mjs +560 -0
- package/fastify/src/framework/maker-cli/runtime/index.mjs +120 -0
- package/fastify/src/framework/maker-cli/runtime/redis-commander-patch.cjs +20 -0
- package/fastify/src/framework/maker-cli/stubs/controller/openapi.ts.stub +74 -0
- package/fastify/src/framework/maker-cli/stubs/controller/plain.ts.stub +77 -0
- package/fastify/src/framework/maker-cli/stubs/controller/standalone.ts.stub +51 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/Dockerfile.bun.stub +52 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/Dockerfile.pnpm.stub +55 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/Dockerfile.stub +51 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/Dockerfile.yarn.stub +55 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/README.stub +59 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/compose/mysql.server.stub +45 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/compose/postgres.server.stub +45 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/compose/sqlite.stub +45 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/env/mysql.server.stub +68 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/env/postgres.server.stub +68 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/env/sqlite.stub +67 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/scripts/auto-migrate.sh.stub +41 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/server/README.stub +78 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/server/compose/noredis.stub +120 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/server/compose/redis.dev.stub +133 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/server/compose/redis.stub +131 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/server/env/local.example.stub +11 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/server/env/noredis.stub +25 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/server/env/redis.stub +25 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/README.stub +16 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/app.example.com.stub +13 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/server/pgadmin/servers.stub +14 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/server/redis/redis.conf.stub +7 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/supervisor/noredis.stub +54 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/supervisor/redis.stub +70 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/workflow/local.json.stub +25 -0
- package/fastify/src/framework/maker-cli/stubs/deploy/workflow/remote.json.stub +24 -0
- package/fastify/src/framework/maker-cli/stubs/facade/name.ts.stub +12 -0
- package/fastify/src/framework/maker-cli/stubs/helper/name.ts.stub +14 -0
- package/fastify/src/framework/maker-cli/stubs/job/name.ts.stub +25 -0
- package/fastify/src/framework/maker-cli/stubs/middleware/name.local.ts.stub +15 -0
- package/fastify/src/framework/maker-cli/stubs/middleware/name.ts.stub +15 -0
- package/fastify/src/framework/maker-cli/stubs/model/name.mysql.ts.stub +10 -0
- package/fastify/src/framework/maker-cli/stubs/model/name.postgresql.ts.stub +10 -0
- package/fastify/src/framework/maker-cli/stubs/model/name.sqlite.ts.stub +10 -0
- package/fastify/src/framework/maker-cli/stubs/notification/controller.ts.stub +79 -0
- package/fastify/src/framework/maker-cli/stubs/notification/job.ts.stub +11 -0
- package/fastify/src/framework/maker-cli/stubs/notification/model.ts.stub +29 -0
- package/fastify/src/framework/maker-cli/stubs/notification/provider.ts.stub +174 -0
- package/fastify/src/framework/maker-cli/stubs/notification/route.api.ts.stub +71 -0
- package/fastify/src/framework/maker-cli/stubs/notification/route.plain.ts.stub +15 -0
- package/fastify/src/framework/maker-cli/stubs/notification/schema.plain.ts.stub +26 -0
- package/fastify/src/framework/maker-cli/stubs/notification/schema.ts.stub +26 -0
- package/fastify/src/framework/maker-cli/stubs/provider/module-barrel.ts.stub +19 -0
- package/fastify/src/framework/maker-cli/stubs/provider/module.ts.stub +21 -0
- package/fastify/src/framework/maker-cli/stubs/provider/name.ts.stub +21 -0
- package/fastify/src/framework/maker-cli/stubs/route/api.ts.stub +101 -0
- package/fastify/src/framework/maker-cli/stubs/route/plain.ts.stub +23 -0
- package/fastify/src/framework/maker-cli/stubs/route/standalone.api.ts.stub +120 -0
- package/fastify/src/framework/maker-cli/stubs/route/standalone.plain.ts.stub +50 -0
- package/fastify/src/framework/maker-cli/stubs/schedule/name.ts.stub +36 -0
- package/fastify/src/framework/maker-cli/stubs/schema/name.plain.ts.stub +14 -0
- package/fastify/src/framework/maker-cli/stubs/schema/name.ts.stub +33 -0
- package/fastify/src/framework/maker-cli/stubs/seeder/name.ts.stub +18 -0
- package/fastify/src/framework/maker-cli/stubs/seeder/standalone.ts.stub +22 -0
- package/fastify/src/framework/maker-cli/stubs/service/name.plain.ts.stub +67 -0
- package/fastify/src/framework/maker-cli/stubs/service/name.ts.stub +65 -0
- package/fastify/src/framework/maker-cli/stubs/test/unit.ts.stub +22 -0
- package/fastify/src/framework/maker-cli/stubs/type/name.ts.stub +22 -0
- package/fastify/src/framework/maker-cli/utils/env-config.mjs +44 -0
- package/fastify/src/framework/maker-cli/utils/env-db.mjs +61 -0
- package/fastify/src/framework/maker-cli/utils/file-ops.mjs +30 -0
- package/fastify/src/framework/maker-cli/utils/flags.mjs +14 -0
- package/fastify/src/framework/maker-cli/utils/help.mjs +379 -0
- package/fastify/src/framework/maker-cli/utils/naming.mjs +119 -0
- package/fastify/src/framework/maker-cli/utils/process.mjs +52 -0
- package/fastify/src/framework/maker-cli/utils/project-commands.mjs +201 -0
- package/fastify/src/framework/modules/discover.ts +57 -0
- package/fastify/src/framework/modules/routes.ts +31 -0
- package/fastify/src/framework/notification/channels/broadcast.ts +15 -0
- package/fastify/src/framework/notification/channels/mail.ts +42 -0
- package/fastify/src/framework/notification/contracts.ts +29 -0
- package/fastify/src/framework/notification/index.ts +59 -0
- package/fastify/src/framework/notification/registry.ts +15 -0
- package/fastify/src/framework/providers/adapter.ts +149 -0
- package/fastify/src/framework/providers/contracts.ts +126 -0
- package/fastify/src/framework/providers/loader.ts +105 -0
- package/fastify/src/framework/providers/registry.ts +88 -0
- package/fastify/src/framework/queue/clear.ts +22 -0
- package/fastify/src/framework/queue/queue.ts +401 -0
- package/fastify/src/framework/queue/ui.ts +194 -0
- package/fastify/src/framework/queue/worker.ts +61 -0
- package/fastify/src/framework/realtime/broadcast.ts +70 -0
- package/fastify/src/framework/realtime/index.ts +2 -0
- package/fastify/src/framework/realtime/socket-cookie.ts +72 -0
- package/fastify/src/framework/realtime/socket.ts +149 -0
- package/fastify/src/framework/realtime/types.ts +6 -0
- package/fastify/src/framework/realtime/ui.ts +16 -0
- package/fastify/src/framework/redis/client.ts +148 -0
- package/fastify/src/framework/runtime/runtime.ts +23 -0
- package/fastify/src/framework/runtime/server-adapter.ts +33 -0
- package/fastify/src/framework/scheduler/lock.ts +128 -0
- package/fastify/src/framework/scheduler/run.ts +48 -0
- package/fastify/src/framework/scheduler/scheduler.ts +155 -0
- package/fastify/src/framework/server.ts +162 -0
- package/fastify/src/framework/session/session.ts +160 -0
- package/fastify/src/framework/storage/storage.ts +744 -0
- package/fastify/src/framework/support/cookie.ts +71 -0
- package/fastify/src/framework/support/jwt.ts +33 -0
- package/fastify/src/framework/support/lifecycle.ts +35 -0
- package/fastify/src/framework/support/logger.ts +148 -0
- package/fastify/src/framework/support/mail.ts +56 -0
- package/fastify/src/framework/support/password.ts +23 -0
- package/fastify/src/framework/support/status-codes.ts +75 -0
- package/fastify/src/framework/support/upload.ts +181 -0
- package/fastify/src/framework/support/url.ts +41 -0
- package/fastify/src/middlewares/auth-middleware.ts +134 -0
- package/fastify/src/middlewares/role-middleware.ts +19 -0
- package/fastify/src/modules/auth/__tests__/forgetpass.test.ts +200 -0
- package/fastify/src/modules/auth/__tests__/login.test.ts +171 -0
- package/fastify/src/modules/auth/__tests__/logout.test.ts +60 -0
- package/fastify/src/modules/auth/__tests__/logoutalldevices.test.ts +49 -0
- package/fastify/src/modules/auth/__tests__/me.test.ts +91 -0
- package/fastify/src/modules/auth/__tests__/refreshtoken.test.ts +305 -0
- package/fastify/src/modules/auth/__tests__/register.test.ts +291 -0
- package/fastify/src/modules/auth/__tests__/resetpass.test.ts +206 -0
- package/fastify/src/modules/auth/__tests__/verifyemail.test.ts +183 -0
- package/fastify/src/modules/auth/controllers/auth.ts +252 -0
- package/fastify/src/modules/auth/controllers/role.ts +35 -0
- package/fastify/src/modules/auth/database/models/role.ts +14 -0
- package/fastify/src/modules/auth/database/models/user.ts +46 -0
- package/fastify/src/modules/auth/database/seeders/role.ts +18 -0
- package/fastify/src/modules/auth/database/seeders/user.ts +35 -0
- package/fastify/src/modules/auth/facade.ts +12 -0
- package/fastify/src/modules/auth/helpers/auth.ts +115 -0
- package/fastify/src/modules/auth/jobs/forgetpass.ts +20 -0
- package/fastify/src/modules/auth/jobs/registeruser.ts +23 -0
- package/fastify/src/modules/auth/jobs/verifyemail.ts +18 -0
- package/fastify/src/modules/auth/routes/index.ts +185 -0
- package/fastify/src/modules/auth/routes/role.ts +56 -0
- package/fastify/src/modules/auth/schemas/auth.ts +116 -0
- package/fastify/src/modules/auth/services/forgetpassword.ts +66 -0
- package/fastify/src/modules/auth/services/login.ts +63 -0
- package/fastify/src/modules/auth/services/logout.ts +25 -0
- package/fastify/src/modules/auth/services/logoutalldevices.ts +19 -0
- package/fastify/src/modules/auth/services/me.ts +31 -0
- package/fastify/src/modules/auth/services/refreshtoken.ts +110 -0
- package/fastify/src/modules/auth/services/register.ts +141 -0
- package/fastify/src/modules/auth/services/resetpassword.ts +69 -0
- package/fastify/src/modules/auth/services/verifyemail.ts +77 -0
- package/fastify/src/modules/auth/types/auth.ts +31 -0
- package/fastify/src/providers/README.md +107 -0
- package/fastify/src/providers/notification.ts +4 -0
- package/fastify/src/resources/index.html +17 -0
- package/fastify/src/resources/src/App.vue +5 -0
- package/fastify/src/resources/src/assets/css/styles.css +14761 -0
- package/fastify/src/resources/src/assets/css/styles.css.map +1 -0
- package/fastify/src/resources/src/assets/fonts/public-sans/public-sans-latin-ext.woff2 +0 -0
- package/fastify/src/resources/src/assets/fonts/public-sans/public-sans-latin.woff2 +0 -0
- package/fastify/src/resources/src/assets/images/favicon/favicon.ico +0 -0
- package/fastify/src/resources/src/assets/images/logo.png +0 -0
- package/fastify/src/resources/src/assets/scss/custom.css +217 -0
- package/fastify/src/resources/src/assets/scss/custom.css.map +1 -0
- package/fastify/src/resources/src/assets/scss/custom.scss +1346 -0
- package/fastify/src/resources/src/components/Button.vue +32 -0
- package/fastify/src/resources/src/components/Checkbox.vue +32 -0
- package/fastify/src/resources/src/components/Datepicker.vue +106 -0
- package/fastify/src/resources/src/components/FeatureButton.vue +53 -0
- package/fastify/src/resources/src/components/FloatButton.vue +33 -0
- package/fastify/src/resources/src/components/Href.vue +32 -0
- package/fastify/src/resources/src/components/Input.vue +243 -0
- package/fastify/src/resources/src/components/InputGroup.vue +147 -0
- package/fastify/src/resources/src/components/InputPasswordToggle.vue +229 -0
- package/fastify/src/resources/src/components/Modal.vue +71 -0
- package/fastify/src/resources/src/components/Pagebar.vue +26 -0
- package/fastify/src/resources/src/components/Refresh.vue +19 -0
- package/fastify/src/resources/src/components/Select.vue +384 -0
- package/fastify/src/resources/src/components/Spinner.vue +42 -0
- package/fastify/src/resources/src/components/Switch.vue +60 -0
- package/fastify/src/resources/src/components/TextArea.vue +117 -0
- package/fastify/src/resources/src/components/Toast.vue +56 -0
- package/fastify/src/resources/src/components/datatable/DataTableSkeleton.vue +98 -0
- package/fastify/src/resources/src/components/datatable/Pagination.vue +147 -0
- package/fastify/src/resources/src/components/datatable/SelectOpption.vue +64 -0
- package/fastify/src/resources/src/components/datatable/index.vue +199 -0
- package/fastify/src/resources/src/composables/useAuth.ts +52 -0
- package/fastify/src/resources/src/helpers/assets.ts +51 -0
- package/fastify/src/resources/src/helpers/nformatter.ts +10 -0
- package/fastify/src/resources/src/helpers/utils.ts +75 -0
- package/fastify/src/resources/src/layouts/AuthLayout.vue +20 -0
- package/fastify/src/resources/src/layouts/Layout/Footer.vue +23 -0
- package/fastify/src/resources/src/layouts/Layout/Header.vue +124 -0
- package/fastify/src/resources/src/layouts/Layout/Sidebar.vue +137 -0
- package/fastify/src/resources/src/layouts/Layout/index.vue +87 -0
- package/fastify/src/resources/src/main.ts +28 -0
- package/fastify/src/resources/src/pages/auth/forgetPassword.vue +76 -0
- package/fastify/src/resources/src/pages/auth/login.vue +96 -0
- package/fastify/src/resources/src/pages/auth/register.vue +129 -0
- package/fastify/src/resources/src/pages/auth/resetPassword.vue +110 -0
- package/fastify/src/resources/src/pages/auth/verifyEmail.vue +64 -0
- package/fastify/src/resources/src/pages/dashboard/index.vue +66 -0
- package/fastify/src/resources/src/plugins/axios.ts +31 -0
- package/fastify/src/resources/src/plugins/browserDetect.ts +55 -0
- package/fastify/src/resources/src/plugins/dialog.ts +216 -0
- package/fastify/src/resources/src/plugins/gum.ts +683 -0
- package/fastify/src/resources/src/plugins/pulse.ts +157 -0
- package/fastify/src/resources/src/plugins/routeProgress.ts +87 -0
- package/fastify/src/resources/src/router/index.ts +85 -0
- package/fastify/src/resources/src/stores/admin-ui.ts +148 -0
- package/fastify/src/resources/src/stores/auth.ts +187 -0
- package/fastify/src/resources/tsconfig.json +19 -0
- package/fastify/src/resources/vite.config.ts +64 -0
- package/fastify/src/storage/app/private/.gitkeep +0 -0
- package/fastify/src/storage/app/public/.gitkeep +0 -0
- package/fastify/src/storage/app/tmp/generated/.gitkeep +0 -0
- package/fastify/src/storage/database/nexwire.sqlite +0 -0
- package/fastify/src/storage/logs/.gitkeep +0 -0
- package/fastify/src/storage/logs/app.log +0 -0
- package/fastify/src/storage/logs/fatal.log +0 -0
- package/fastify/src/storage/tmp/.gitkeep +0 -0
- package/fastify/src/storage/trash/modules/.gitkeep +0 -0
- package/fastify/src/types/global.d.ts +32 -0
- package/fastify/tsconfig.json +19 -0
- package/fastify/vitest.config.ts +38 -0
- package/hono/.env +1 -1
- package/hono/package.json +1 -1
- package/hono/src/config/database.ts +48 -29
- package/hono/src/config/index.ts +83 -83
- package/hono/src/config/openapi.ts +6 -24
- package/hono/src/config/queue.ts +30 -30
- package/hono/src/config/validate.ts +50 -40
- package/hono/src/database/migrations/sqlite/0000_init.sql +47 -47
- package/hono/src/database/migrations/sqlite/meta/0000_snapshot.json +1 -1
- package/hono/src/database/migrations/sqlite/meta/_journal.json +1 -1
- package/hono/src/framework/cache/cache.ts +40 -8
- package/hono/src/framework/circuit-breaker/cb.ts +88 -60
- package/hono/src/framework/database/connection.ts +52 -27
- package/hono/src/framework/events/dispatcher.ts +61 -49
- package/hono/src/framework/facade.ts +39 -1
- package/hono/src/framework/http/logger.ts +86 -81
- package/hono/src/framework/http/openapi.ts +7 -9
- package/hono/src/framework/maker-cli/runtime/core.mjs +1 -2
- package/hono/src/framework/notification/channels/broadcast.ts +15 -0
- package/hono/src/framework/notification/channels/mail.ts +42 -0
- package/hono/src/framework/notification/contracts.ts +29 -0
- package/hono/src/framework/notification/index.ts +19 -94
- package/hono/src/framework/notification/registry.ts +15 -0
- package/hono/src/framework/providers/adapter.ts +27 -17
- package/hono/src/framework/queue/queue.ts +43 -44
- package/hono/src/framework/realtime/broadcast.ts +29 -5
- package/hono/src/framework/realtime/socket.ts +217 -196
- package/hono/src/framework/redis/client.ts +148 -151
- package/hono/src/framework/scheduler/lock.ts +128 -116
- package/hono/src/framework/server.ts +27 -29
- package/hono/src/framework/session/session.ts +62 -14
- package/hono/src/framework/storage/storage.ts +744 -785
- package/hono/src/framework/support/mail.ts +56 -48
- package/hono/src/middlewares/auth-middleware.ts +1 -2
- package/hono/src/middlewares/role-middleware.ts +3 -13
- package/hono/src/modules/auth/routes/index.ts +1 -2
- package/hono/src/providers/notification.ts +4 -0
- package/hono/src/resources/src/components/Switch.vue +60 -65
- package/hono/src/resources/src/layouts/Layout/Header.vue +124 -105
- package/hono/src/resources/src/pages/auth/forgetPassword.vue +23 -29
- package/hono/src/resources/src/pages/auth/login.vue +26 -29
- package/hono/src/resources/src/pages/auth/register.vue +36 -40
- package/hono/src/resources/src/pages/auth/resetPassword.vue +29 -37
- package/hono/src/resources/src/pages/auth/verifyEmail.vue +15 -19
- package/hono/src/resources/src/plugins/gum.ts +519 -203
- package/hono/src/resources/src/plugins/pulse.ts +157 -147
- package/hono/src/resources/src/stores/auth.ts +9 -6
- package/hono/src/resources/vite.config.ts +54 -43
- package/hono/src/storage/database/nexwire.sqlite +0 -0
- package/hono/src/storage/logs/app.log +0 -0
- package/hono/src/storage/logs/fatal.log +0 -0
- package/hono/src/types/global.d.ts +32 -26
- package/package.json +4 -3
- package/src/index.js +143 -15
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# App deploy env template (shared for local + remote)
|
|
2
|
+
# Local: use this as deploy/.env
|
|
3
|
+
# Remote: use this as deploy/.env
|
|
4
|
+
# Runtime settings (mail, storage, cors, log level, toggles, expiries) live in
|
|
5
|
+
# src/config/*. Only app basics, secrets, and infra vars belong in this file.
|
|
6
|
+
# ── App ────────────────────────────────────────────
|
|
7
|
+
APP_ENV=production
|
|
8
|
+
APP_NAME=nexwire
|
|
9
|
+
APP_HOST=localhost
|
|
10
|
+
APP_PORT=3000
|
|
11
|
+
|
|
12
|
+
# Full public URL the app is served at (used for links, redirects, CORS)
|
|
13
|
+
# Local: http://localhost:3000 | Remote: https://your-domain.com
|
|
14
|
+
APP_URL=http://localhost:3000
|
|
15
|
+
|
|
16
|
+
# Run "db:migrate --seed" automatically on container start (true/false)
|
|
17
|
+
AUTO_MIGRATE=true
|
|
18
|
+
|
|
19
|
+
# UI origin (only needed when UI is on a different domain than API)
|
|
20
|
+
# Leave empty if UI is served from the same APP_URL or UI=false
|
|
21
|
+
FRONTEND_URL={{FRONTEND_URL}}
|
|
22
|
+
|
|
23
|
+
# ── Reverse Proxy (nginx-proxy) ────────────────────
|
|
24
|
+
# Remote only: nginx-proxy routes by VIRTUAL_HOST and auto-issues Let's Encrypt certs.
|
|
25
|
+
# Leave empty for local-only deploys.
|
|
26
|
+
VIRTUAL_HOST=
|
|
27
|
+
VIRTUAL_PORT=3000
|
|
28
|
+
LETSENCRYPT_HOST=
|
|
29
|
+
LETSENCRYPT_EMAIL=
|
|
30
|
+
|
|
31
|
+
# ── Database ───────────────────────────────────────
|
|
32
|
+
# Set the password and database name to match deploy/server/.env
|
|
33
|
+
DATABASE_URL=postgres://postgres:change-me-postgres@postgres-global:5432/postgres
|
|
34
|
+
|
|
35
|
+
# ── JWT Auth (expiries live in src/config/jwt.ts) ──
|
|
36
|
+
JWT_ACCESS_SECRET={{JWT_ACCESS_SECRET}}
|
|
37
|
+
JWT_REFRESH_SECRET={{JWT_REFRESH_SECRET}}
|
|
38
|
+
|
|
39
|
+
# ── Cookie (name lives in src/config/cookie.ts) ────
|
|
40
|
+
COOKIE_SECRET={{COOKIE_SECRET}}
|
|
41
|
+
|
|
42
|
+
# ── Storage credentials (driver/disk/bucket live in src/config/storage.ts) ──
|
|
43
|
+
STORAGE_ACCESS_KEY_ID={{STORAGE_ACCESS_KEY_ID}}
|
|
44
|
+
STORAGE_SECRET_ACCESS_KEY={{STORAGE_SECRET_ACCESS_KEY}}
|
|
45
|
+
|
|
46
|
+
# ── Mail credentials (host/port/encryption live in src/config/mail.ts) ──
|
|
47
|
+
MAIL_USERNAME=
|
|
48
|
+
MAIL_PASSWORD=
|
|
49
|
+
|
|
50
|
+
# ── Redis ──────────────────────────────────────────
|
|
51
|
+
# Enables/disables cache, session, queue, events, Queue Dashboard (all Redis-backed services)
|
|
52
|
+
REDIS={{REDIS_ENABLED}}
|
|
53
|
+
REDIS_URL=redis://redis-global:6379
|
|
54
|
+
REDIS_PREFIX={{REDIS_PREFIX}}
|
|
55
|
+
|
|
56
|
+
# ── Feature Toggle (build) ─────────────────────────
|
|
57
|
+
# Enable/disable UI build and serving. Set false for API-only mode
|
|
58
|
+
UI={{UI}}
|
|
59
|
+
|
|
60
|
+
# ── Feature Toggle ─────────────────────────────────
|
|
61
|
+
# OpenAPI / Scalar docs at /api-docs. Set true to enable.
|
|
62
|
+
OPEN_API={{OPEN_API}}
|
|
63
|
+
# Socket.IO realtime server. Set false to disable.
|
|
64
|
+
SOCKET={{SOCKET}}
|
|
65
|
+
# Security headers (CSP, HSTS, X-Frame). Set false to disable.
|
|
66
|
+
SECURITY_HEADERS={{SECURITY_HEADERS}}
|
|
67
|
+
|
|
68
|
+
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# App deploy env template (shared for local + remote)
|
|
2
|
+
# Local: use this as deploy/.env
|
|
3
|
+
# Remote: use this as deploy/.env
|
|
4
|
+
# Runtime settings (mail, storage, cors, log level, toggles, expiries) live in
|
|
5
|
+
# src/config/*. Only app basics, secrets, and infra vars belong in this file.
|
|
6
|
+
# ── App ────────────────────────────────────────────
|
|
7
|
+
APP_ENV=production
|
|
8
|
+
APP_NAME=nexwire
|
|
9
|
+
APP_HOST=localhost
|
|
10
|
+
APP_PORT=3000
|
|
11
|
+
|
|
12
|
+
# Full public URL the app is served at (used for links, redirects, CORS)
|
|
13
|
+
# Local: http://localhost:3000 | Remote: https://your-domain.com
|
|
14
|
+
APP_URL=http://localhost:3000
|
|
15
|
+
|
|
16
|
+
# Run "db:migrate --seed" automatically on container start (true/false)
|
|
17
|
+
AUTO_MIGRATE=true
|
|
18
|
+
|
|
19
|
+
# UI origin (only needed when UI is on a different domain than API)
|
|
20
|
+
# Leave empty if UI is served from the same APP_URL or UI=false
|
|
21
|
+
FRONTEND_URL={{FRONTEND_URL}}
|
|
22
|
+
|
|
23
|
+
# ── Reverse Proxy (nginx-proxy) ────────────────────
|
|
24
|
+
# Remote only: nginx-proxy routes by VIRTUAL_HOST and auto-issues Let's Encrypt certs.
|
|
25
|
+
# Leave empty for local-only deploys.
|
|
26
|
+
VIRTUAL_HOST=
|
|
27
|
+
VIRTUAL_PORT=3000
|
|
28
|
+
LETSENCRYPT_HOST=
|
|
29
|
+
LETSENCRYPT_EMAIL=
|
|
30
|
+
|
|
31
|
+
# ── Database ───────────────────────────────────────
|
|
32
|
+
DATABASE_URL=sqlite:./src/storage/database/nexwire.sqlite
|
|
33
|
+
|
|
34
|
+
# ── JWT Auth (expiries live in src/config/jwt.ts) ──
|
|
35
|
+
JWT_ACCESS_SECRET={{JWT_ACCESS_SECRET}}
|
|
36
|
+
JWT_REFRESH_SECRET={{JWT_REFRESH_SECRET}}
|
|
37
|
+
|
|
38
|
+
# ── Cookie (name lives in src/config/cookie.ts) ────
|
|
39
|
+
COOKIE_SECRET={{COOKIE_SECRET}}
|
|
40
|
+
|
|
41
|
+
# ── Storage credentials (driver/disk/bucket live in src/config/storage.ts) ──
|
|
42
|
+
STORAGE_ACCESS_KEY_ID={{STORAGE_ACCESS_KEY_ID}}
|
|
43
|
+
STORAGE_SECRET_ACCESS_KEY={{STORAGE_SECRET_ACCESS_KEY}}
|
|
44
|
+
|
|
45
|
+
# ── Mail credentials (host/port/encryption live in src/config/mail.ts) ──
|
|
46
|
+
MAIL_USERNAME=
|
|
47
|
+
MAIL_PASSWORD=
|
|
48
|
+
|
|
49
|
+
# ── Redis ──────────────────────────────────────────
|
|
50
|
+
# Enables/disables cache, session, queue, events, Queue Dashboard (all Redis-backed services)
|
|
51
|
+
REDIS={{REDIS_ENABLED}}
|
|
52
|
+
REDIS_URL=redis://redis-global:6379
|
|
53
|
+
REDIS_PREFIX={{REDIS_PREFIX}}
|
|
54
|
+
|
|
55
|
+
# ── Feature Toggle (build) ─────────────────────────
|
|
56
|
+
# Enable/disable UI build and serving. Set false for API-only mode
|
|
57
|
+
UI={{UI}}
|
|
58
|
+
|
|
59
|
+
# ── Feature Toggle ─────────────────────────────────
|
|
60
|
+
# OpenAPI / Scalar docs at /api-docs. Set true to enable.
|
|
61
|
+
OPEN_API={{OPEN_API}}
|
|
62
|
+
# Socket.IO realtime server. Set false to disable.
|
|
63
|
+
SOCKET={{SOCKET}}
|
|
64
|
+
# Security headers (CSP, HSTS, X-Frame). Set false to disable.
|
|
65
|
+
SECURITY_HEADERS={{SECURITY_HEADERS}}
|
|
66
|
+
|
|
67
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
#
|
|
3
|
+
# auto-migrate.sh - Runs database migrations + seeders when the container starts.
|
|
4
|
+
#
|
|
5
|
+
# How it works:
|
|
6
|
+
# supervisord launches this script on every container start:
|
|
7
|
+
# /bin/sh /app/deploy/scripts/auto-migrate.sh bun
|
|
8
|
+
# The 1st argument ("bun") is the runtime used to run the CLI command.
|
|
9
|
+
#
|
|
10
|
+
# The AUTO_MIGRATE environment variable (from .env) decides what happens:
|
|
11
|
+
# AUTO_MIGRATE=true -> run "db:migrate --seed" (apply pending migrations, then seed)
|
|
12
|
+
# AUTO_MIGRATE=false -> do nothing, leave the database untouched.
|
|
13
|
+
#
|
|
14
|
+
# "db:migrate --seed" is safe to run on every start:
|
|
15
|
+
# - it only applies migrations that have not run yet,
|
|
16
|
+
# - the seeders only insert rows that are missing, so no duplicates.
|
|
17
|
+
|
|
18
|
+
set -eu # (set -e: stop on any error; set -u: fail if a variable is unset)
|
|
19
|
+
|
|
20
|
+
# ---- 1. Read the settings ----
|
|
21
|
+
RUNTIME_EXEC="${1:-node}" # runtime to run the CLI: "bun" (falls back to "node")
|
|
22
|
+
AUTO_MIGRATE_RAW="${AUTO_MIGRATE:-false}" # raw value of AUTO_MIGRATE, "false" if not set
|
|
23
|
+
|
|
24
|
+
# Normalize the value so "TRUE", "True", "true ", "true" all mean the same thing:
|
|
25
|
+
# tr -d '\r' -> remove carriage returns (files edited on Windows)
|
|
26
|
+
# tr '[:upper:]' ... -> lowercase everything
|
|
27
|
+
# sed ... trim -> remove leading/trailing spaces
|
|
28
|
+
AUTO_MIGRATE_NORMALIZED=$(echo "$AUTO_MIGRATE_RAW" | tr -d '\r' | tr '[:upper:]' '[:lower:]' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
29
|
+
|
|
30
|
+
# ---- 2. Decide: migrate or skip ----
|
|
31
|
+
case "$AUTO_MIGRATE_NORMALIZED" in
|
|
32
|
+
true|1|yes)
|
|
33
|
+
# AUTO_MIGRATE is on -> run pending migrations, then seed the database.
|
|
34
|
+
exec "$RUNTIME_EXEC" src/framework/maker-cli/index.mjs db:migrate --seed
|
|
35
|
+
;;
|
|
36
|
+
*)
|
|
37
|
+
# AUTO_MIGRATE is off -> leave the database untouched.
|
|
38
|
+
echo "Skipping migrations (AUTO_MIGRATE=$AUTO_MIGRATE_RAW)"
|
|
39
|
+
;;
|
|
40
|
+
esac
|
|
41
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Server Deploy (Shared Infra)
|
|
2
|
+
|
|
3
|
+
This stack is shared by multiple apps on one server.
|
|
4
|
+
|
|
5
|
+
## Includes
|
|
6
|
+
|
|
7
|
+
- jwilder nginx-proxy
|
|
8
|
+
- letsencrypt companion
|
|
9
|
+
- mysql-global
|
|
10
|
+
- postgres-global
|
|
11
|
+
{{REDIS_INCLUDE_LINE}}
|
|
12
|
+
- phpmyadmin + pgadmin
|
|
13
|
+
|
|
14
|
+
{{REDIS_CONFIG_LINE}}
|
|
15
|
+
|
|
16
|
+
## Setup
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
cp deploy/server/.env.example deploy/server/.env
|
|
20
|
+
cp deploy/server/.env.local.example deploy/server/.env.local
|
|
21
|
+
docker network create nginx-proxy || true
|
|
22
|
+
docker network create infra || true
|
|
23
|
+
docker compose --env-file deploy/server/.env --env-file deploy/server/.env.local -f deploy/server/docker-compose.yml up -d
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Equivalent maker command:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
bun maker deploy:workflow --server-only
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Local Docker Desktop:
|
|
33
|
+
- Proxy: `http://localhost:8081`
|
|
34
|
+
- phpMyAdmin direct: `http://localhost:8082`
|
|
35
|
+
- pgAdmin direct: `http://localhost:8083`
|
|
36
|
+
|
|
37
|
+
Remote server deploy:
|
|
38
|
+
- Keep `PROXY_HTTP_PORT=80` and `PROXY_HTTPS_PORT=443`
|
|
39
|
+
- Keep `PHPMYADMIN_LOCAL_PORT=127.0.0.1:8082` and `PGADMIN_LOCAL_PORT=127.0.0.1:8083` to avoid exposing admin UIs publicly
|
|
40
|
+
- Optionally remove `.env.local`
|
|
41
|
+
|
|
42
|
+
## Env File Precedence (Important)
|
|
43
|
+
|
|
44
|
+
This stack intentionally uses two env files together:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
--env-file deploy/server/.env --env-file deploy/server/.env.local
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Rule:
|
|
51
|
+
- Values in `deploy/server/.env.local` override same keys from `deploy/server/.env`.
|
|
52
|
+
|
|
53
|
+
Why:
|
|
54
|
+
- `deploy/server/.env` is your shared base (works for remote/server defaults).
|
|
55
|
+
- `deploy/server/.env.local` is for Docker Desktop-only overrides.
|
|
56
|
+
|
|
57
|
+
Typical split:
|
|
58
|
+
- `deploy/server/.env`
|
|
59
|
+
- `PROXY_HTTP_PORT=80`
|
|
60
|
+
- `PROXY_HTTPS_PORT=443`
|
|
61
|
+
- production domains like `PHPMYADMIN_DOMAIN=pma.example.com`
|
|
62
|
+
- `deploy/server/.env.local`
|
|
63
|
+
- `PROXY_HTTP_PORT=8081`
|
|
64
|
+
- `PROXY_HTTPS_PORT=8443`
|
|
65
|
+
- local domains like `PHPMYADMIN_DOMAIN=pma.localhost`
|
|
66
|
+
|
|
67
|
+
Result on local Docker Desktop:
|
|
68
|
+
- Effective proxy ports become `8081/8443` (from `.env.local`).
|
|
69
|
+
- Effective local domains become `pma.localhost` / `pga.localhost` (from `.env.local`).
|
|
70
|
+
|
|
71
|
+
Result on remote server:
|
|
72
|
+
- Use only `deploy/server/.env` (or keep `.env.local` empty/unused).
|
|
73
|
+
- Effective proxy ports stay `80/443`.
|
|
74
|
+
|
|
75
|
+
Then each app deploy joins external networks `nginx-proxy` and `infra`.
|
|
76
|
+
|
|
77
|
+
Custom per-domain nginx overrides are in `deploy/server/nginx-vhost/`.
|
|
78
|
+
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
services:
|
|
2
|
+
nginx-proxy:
|
|
3
|
+
image: jwilder/nginx-proxy
|
|
4
|
+
container_name: nginx-proxy
|
|
5
|
+
restart: unless-stopped
|
|
6
|
+
ports:
|
|
7
|
+
- "${PROXY_HTTP_PORT:-80}:80"
|
|
8
|
+
- "${PROXY_HTTPS_PORT:-443}:443"
|
|
9
|
+
volumes:
|
|
10
|
+
- /var/run/docker.sock:/tmp/docker.sock:ro
|
|
11
|
+
- ./certs:/etc/nginx/certs
|
|
12
|
+
- ./nginx-vhost:/etc/nginx/vhost.d
|
|
13
|
+
- ./html:/usr/share/nginx/html
|
|
14
|
+
labels:
|
|
15
|
+
com.github.nginx-proxy.nginx: "true"
|
|
16
|
+
networks:
|
|
17
|
+
- nginx-proxy
|
|
18
|
+
|
|
19
|
+
letsencrypt:
|
|
20
|
+
image: jrcs/letsencrypt-nginx-proxy-companion
|
|
21
|
+
container_name: nginx-letsencrypt
|
|
22
|
+
restart: unless-stopped
|
|
23
|
+
depends_on:
|
|
24
|
+
- nginx-proxy
|
|
25
|
+
environment:
|
|
26
|
+
NGINX_PROXY_CONTAINER: nginx-proxy
|
|
27
|
+
DEFAULT_EMAIL: ${LETSENCRYPT_EMAIL}
|
|
28
|
+
volumes:
|
|
29
|
+
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
30
|
+
- ./certs:/etc/nginx/certs
|
|
31
|
+
- ./nginx-vhost:/etc/nginx/vhost.d
|
|
32
|
+
- ./html:/usr/share/nginx/html
|
|
33
|
+
- ./acme:/etc/acme.sh
|
|
34
|
+
networks:
|
|
35
|
+
- nginx-proxy
|
|
36
|
+
|
|
37
|
+
mysql:
|
|
38
|
+
image: mysql:8.4
|
|
39
|
+
container_name: mysql-global
|
|
40
|
+
restart: unless-stopped
|
|
41
|
+
environment:
|
|
42
|
+
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
|
43
|
+
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
|
44
|
+
volumes:
|
|
45
|
+
- mysql_global_data:/var/lib/mysql
|
|
46
|
+
ports:
|
|
47
|
+
- "${MYSQL_PORT:-4000}:3306"
|
|
48
|
+
networks:
|
|
49
|
+
- infra
|
|
50
|
+
|
|
51
|
+
postgres:
|
|
52
|
+
image: postgres:16-alpine
|
|
53
|
+
container_name: postgres-global
|
|
54
|
+
restart: unless-stopped
|
|
55
|
+
environment:
|
|
56
|
+
POSTGRES_USER: ${POSTGRES_USER}
|
|
57
|
+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
58
|
+
POSTGRES_DB: ${POSTGRES_DB}
|
|
59
|
+
volumes:
|
|
60
|
+
- postgres_global_data:/var/lib/postgresql/data
|
|
61
|
+
ports:
|
|
62
|
+
- "${POSTGRES_PORT:-4001}:5432"
|
|
63
|
+
networks:
|
|
64
|
+
- infra
|
|
65
|
+
|
|
66
|
+
phpmyadmin:
|
|
67
|
+
image: phpmyadmin:5-apache
|
|
68
|
+
container_name: phpmyadmin
|
|
69
|
+
restart: unless-stopped
|
|
70
|
+
environment:
|
|
71
|
+
PMA_HOST: mysql-global
|
|
72
|
+
PMA_PORT: 3306
|
|
73
|
+
PMA_ARBITRARY: 1
|
|
74
|
+
VIRTUAL_HOST: ${PHPMYADMIN_DOMAIN}
|
|
75
|
+
VIRTUAL_PORT: 80
|
|
76
|
+
LETSENCRYPT_HOST: ${PHPMYADMIN_DOMAIN}
|
|
77
|
+
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
|
78
|
+
ports:
|
|
79
|
+
- "${PHPMYADMIN_LOCAL_PORT:-127.0.0.1:8082}:80"
|
|
80
|
+
networks:
|
|
81
|
+
- infra
|
|
82
|
+
- nginx-proxy
|
|
83
|
+
|
|
84
|
+
pgadmin:
|
|
85
|
+
image: dpage/pgadmin4:latest
|
|
86
|
+
container_name: pgadmin
|
|
87
|
+
restart: unless-stopped
|
|
88
|
+
depends_on:
|
|
89
|
+
- postgres
|
|
90
|
+
environment:
|
|
91
|
+
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
|
|
92
|
+
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
|
|
93
|
+
PGADMIN_CONFIG_SERVER_MODE: "True"
|
|
94
|
+
PGADMIN_SERVER_JSON_FILE: /pgadmin4/servers.json
|
|
95
|
+
VIRTUAL_HOST: ${PGADMIN_DOMAIN}
|
|
96
|
+
VIRTUAL_PORT: 80
|
|
97
|
+
LETSENCRYPT_HOST: ${PGADMIN_DOMAIN}
|
|
98
|
+
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
|
99
|
+
volumes:
|
|
100
|
+
- pgadmin_data:/var/lib/pgadmin
|
|
101
|
+
- ./pgadmin/servers.json:/pgadmin4/servers.json:ro
|
|
102
|
+
ports:
|
|
103
|
+
- "${PGADMIN_LOCAL_PORT:-127.0.0.1:8083}:80"
|
|
104
|
+
networks:
|
|
105
|
+
- infra
|
|
106
|
+
- nginx-proxy
|
|
107
|
+
|
|
108
|
+
volumes:
|
|
109
|
+
mysql_global_data:
|
|
110
|
+
postgres_global_data:
|
|
111
|
+
pgadmin_data:
|
|
112
|
+
|
|
113
|
+
networks:
|
|
114
|
+
nginx-proxy:
|
|
115
|
+
external: true
|
|
116
|
+
name: nginx-proxy
|
|
117
|
+
infra:
|
|
118
|
+
external: true
|
|
119
|
+
name: infra
|
|
120
|
+
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
services:
|
|
2
|
+
nginx-proxy:
|
|
3
|
+
image: jwilder/nginx-proxy
|
|
4
|
+
container_name: nginx-proxy
|
|
5
|
+
restart: unless-stopped
|
|
6
|
+
ports:
|
|
7
|
+
- "${PROXY_HTTP_PORT:-80}:80"
|
|
8
|
+
- "${PROXY_HTTPS_PORT:-443}:443"
|
|
9
|
+
volumes:
|
|
10
|
+
- /var/run/docker.sock:/tmp/docker.sock:ro
|
|
11
|
+
- ./certs:/etc/nginx/certs
|
|
12
|
+
- ./nginx-vhost:/etc/nginx/vhost.d
|
|
13
|
+
- ./html:/usr/share/nginx/html
|
|
14
|
+
labels:
|
|
15
|
+
com.github.nginx-proxy.nginx: "true"
|
|
16
|
+
networks:
|
|
17
|
+
- nginx-proxy
|
|
18
|
+
|
|
19
|
+
letsencrypt:
|
|
20
|
+
image: jrcs/letsencrypt-nginx-proxy-companion
|
|
21
|
+
container_name: nginx-letsencrypt
|
|
22
|
+
restart: unless-stopped
|
|
23
|
+
depends_on:
|
|
24
|
+
- nginx-proxy
|
|
25
|
+
environment:
|
|
26
|
+
NGINX_PROXY_CONTAINER: nginx-proxy
|
|
27
|
+
DEFAULT_EMAIL: ${LETSENCRYPT_EMAIL}
|
|
28
|
+
volumes:
|
|
29
|
+
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
30
|
+
- ./certs:/etc/nginx/certs
|
|
31
|
+
- ./nginx-vhost:/etc/nginx/vhost.d
|
|
32
|
+
- ./html:/usr/share/nginx/html
|
|
33
|
+
- ./acme:/etc/acme.sh
|
|
34
|
+
networks:
|
|
35
|
+
- nginx-proxy
|
|
36
|
+
|
|
37
|
+
mysql:
|
|
38
|
+
image: mysql:8.4
|
|
39
|
+
container_name: mysql-global
|
|
40
|
+
restart: unless-stopped
|
|
41
|
+
environment:
|
|
42
|
+
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
|
43
|
+
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
|
44
|
+
volumes:
|
|
45
|
+
- mysql_global_data:/var/lib/mysql
|
|
46
|
+
ports:
|
|
47
|
+
- "${MYSQL_PORT:-4000}:3306"
|
|
48
|
+
networks:
|
|
49
|
+
- infra
|
|
50
|
+
|
|
51
|
+
postgres:
|
|
52
|
+
image: postgres:16-alpine
|
|
53
|
+
container_name: postgres-global
|
|
54
|
+
restart: unless-stopped
|
|
55
|
+
environment:
|
|
56
|
+
POSTGRES_USER: ${POSTGRES_USER}
|
|
57
|
+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
58
|
+
POSTGRES_DB: ${POSTGRES_DB}
|
|
59
|
+
volumes:
|
|
60
|
+
- postgres_global_data:/var/lib/postgresql/data
|
|
61
|
+
ports:
|
|
62
|
+
- "${POSTGRES_PORT:-4001}:5432"
|
|
63
|
+
networks:
|
|
64
|
+
- infra
|
|
65
|
+
|
|
66
|
+
redis:
|
|
67
|
+
image: redis:7-alpine
|
|
68
|
+
container_name: redis-global
|
|
69
|
+
restart: unless-stopped
|
|
70
|
+
ports:
|
|
71
|
+
- "6379:6379"
|
|
72
|
+
volumes:
|
|
73
|
+
- redis_global_data:/data
|
|
74
|
+
command: ["redis-server", "--appendonly", "yes", "--maxmemory", "512mb", "--maxmemory-policy", "noeviction"]
|
|
75
|
+
networks:
|
|
76
|
+
- infra
|
|
77
|
+
|
|
78
|
+
phpmyadmin:
|
|
79
|
+
image: phpmyadmin:5-apache
|
|
80
|
+
container_name: phpmyadmin
|
|
81
|
+
restart: unless-stopped
|
|
82
|
+
environment:
|
|
83
|
+
PMA_HOST: mysql-global
|
|
84
|
+
PMA_PORT: 3306
|
|
85
|
+
PMA_ARBITRARY: 1
|
|
86
|
+
VIRTUAL_HOST: ${PHPMYADMIN_DOMAIN}
|
|
87
|
+
VIRTUAL_PORT: 80
|
|
88
|
+
LETSENCRYPT_HOST: ${PHPMYADMIN_DOMAIN}
|
|
89
|
+
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
|
90
|
+
ports:
|
|
91
|
+
- "${PHPMYADMIN_LOCAL_PORT:-127.0.0.1:8082}:80"
|
|
92
|
+
networks:
|
|
93
|
+
- infra
|
|
94
|
+
- nginx-proxy
|
|
95
|
+
|
|
96
|
+
pgadmin:
|
|
97
|
+
image: dpage/pgadmin4:latest
|
|
98
|
+
container_name: pgadmin
|
|
99
|
+
restart: unless-stopped
|
|
100
|
+
depends_on:
|
|
101
|
+
- postgres
|
|
102
|
+
environment:
|
|
103
|
+
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
|
|
104
|
+
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
|
|
105
|
+
PGADMIN_CONFIG_SERVER_MODE: "True"
|
|
106
|
+
PGADMIN_SERVER_JSON_FILE: /pgadmin4/servers.json
|
|
107
|
+
VIRTUAL_HOST: ${PGADMIN_DOMAIN}
|
|
108
|
+
VIRTUAL_PORT: 80
|
|
109
|
+
LETSENCRYPT_HOST: ${PGADMIN_DOMAIN}
|
|
110
|
+
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
|
111
|
+
volumes:
|
|
112
|
+
- pgadmin_data:/var/lib/pgadmin
|
|
113
|
+
- ./pgadmin/servers.json:/pgadmin4/servers.json:ro
|
|
114
|
+
ports:
|
|
115
|
+
- "${PGADMIN_LOCAL_PORT:-127.0.0.1:8083}:80"
|
|
116
|
+
networks:
|
|
117
|
+
- infra
|
|
118
|
+
- nginx-proxy
|
|
119
|
+
|
|
120
|
+
volumes:
|
|
121
|
+
mysql_global_data:
|
|
122
|
+
postgres_global_data:
|
|
123
|
+
redis_global_data:
|
|
124
|
+
pgadmin_data:
|
|
125
|
+
|
|
126
|
+
networks:
|
|
127
|
+
nginx-proxy:
|
|
128
|
+
external: true
|
|
129
|
+
name: nginx-proxy
|
|
130
|
+
infra:
|
|
131
|
+
external: true
|
|
132
|
+
name: infra
|
|
133
|
+
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
services:
|
|
2
|
+
nginx-proxy:
|
|
3
|
+
image: jwilder/nginx-proxy
|
|
4
|
+
container_name: nginx-proxy
|
|
5
|
+
restart: unless-stopped
|
|
6
|
+
ports:
|
|
7
|
+
- "${PROXY_HTTP_PORT:-80}:80"
|
|
8
|
+
- "${PROXY_HTTPS_PORT:-443}:443"
|
|
9
|
+
volumes:
|
|
10
|
+
- /var/run/docker.sock:/tmp/docker.sock:ro
|
|
11
|
+
- ./certs:/etc/nginx/certs
|
|
12
|
+
- ./nginx-vhost:/etc/nginx/vhost.d
|
|
13
|
+
- ./html:/usr/share/nginx/html
|
|
14
|
+
labels:
|
|
15
|
+
com.github.nginx-proxy.nginx: "true"
|
|
16
|
+
networks:
|
|
17
|
+
- nginx-proxy
|
|
18
|
+
|
|
19
|
+
letsencrypt:
|
|
20
|
+
image: jrcs/letsencrypt-nginx-proxy-companion
|
|
21
|
+
container_name: nginx-letsencrypt
|
|
22
|
+
restart: unless-stopped
|
|
23
|
+
depends_on:
|
|
24
|
+
- nginx-proxy
|
|
25
|
+
environment:
|
|
26
|
+
NGINX_PROXY_CONTAINER: nginx-proxy
|
|
27
|
+
DEFAULT_EMAIL: ${LETSENCRYPT_EMAIL}
|
|
28
|
+
volumes:
|
|
29
|
+
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
30
|
+
- ./certs:/etc/nginx/certs
|
|
31
|
+
- ./nginx-vhost:/etc/nginx/vhost.d
|
|
32
|
+
- ./html:/usr/share/nginx/html
|
|
33
|
+
- ./acme:/etc/acme.sh
|
|
34
|
+
networks:
|
|
35
|
+
- nginx-proxy
|
|
36
|
+
|
|
37
|
+
mysql:
|
|
38
|
+
image: mysql:8.4
|
|
39
|
+
container_name: mysql-global
|
|
40
|
+
restart: unless-stopped
|
|
41
|
+
environment:
|
|
42
|
+
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
|
43
|
+
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
|
44
|
+
volumes:
|
|
45
|
+
- mysql_global_data:/var/lib/mysql
|
|
46
|
+
ports:
|
|
47
|
+
- "${MYSQL_PORT:-4000}:3306"
|
|
48
|
+
networks:
|
|
49
|
+
- infra
|
|
50
|
+
|
|
51
|
+
postgres:
|
|
52
|
+
image: postgres:16-alpine
|
|
53
|
+
container_name: postgres-global
|
|
54
|
+
restart: unless-stopped
|
|
55
|
+
environment:
|
|
56
|
+
POSTGRES_USER: ${POSTGRES_USER}
|
|
57
|
+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
58
|
+
POSTGRES_DB: ${POSTGRES_DB}
|
|
59
|
+
volumes:
|
|
60
|
+
- postgres_global_data:/var/lib/postgresql/data
|
|
61
|
+
ports:
|
|
62
|
+
- "${POSTGRES_PORT:-4001}:5432"
|
|
63
|
+
networks:
|
|
64
|
+
- infra
|
|
65
|
+
|
|
66
|
+
redis:
|
|
67
|
+
image: redis:7-alpine
|
|
68
|
+
container_name: redis-global
|
|
69
|
+
restart: unless-stopped
|
|
70
|
+
volumes:
|
|
71
|
+
- redis_global_data:/data
|
|
72
|
+
command: ["redis-server", "--appendonly", "yes", "--maxmemory", "512mb", "--maxmemory-policy", "noeviction"]
|
|
73
|
+
networks:
|
|
74
|
+
- infra
|
|
75
|
+
|
|
76
|
+
phpmyadmin:
|
|
77
|
+
image: phpmyadmin:5-apache
|
|
78
|
+
container_name: phpmyadmin
|
|
79
|
+
restart: unless-stopped
|
|
80
|
+
environment:
|
|
81
|
+
PMA_HOST: mysql-global
|
|
82
|
+
PMA_PORT: 3306
|
|
83
|
+
PMA_ARBITRARY: 1
|
|
84
|
+
VIRTUAL_HOST: ${PHPMYADMIN_DOMAIN}
|
|
85
|
+
VIRTUAL_PORT: 80
|
|
86
|
+
LETSENCRYPT_HOST: ${PHPMYADMIN_DOMAIN}
|
|
87
|
+
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
|
88
|
+
ports:
|
|
89
|
+
- "${PHPMYADMIN_LOCAL_PORT:-127.0.0.1:8082}:80"
|
|
90
|
+
networks:
|
|
91
|
+
- infra
|
|
92
|
+
- nginx-proxy
|
|
93
|
+
|
|
94
|
+
pgadmin:
|
|
95
|
+
image: dpage/pgadmin4:latest
|
|
96
|
+
container_name: pgadmin
|
|
97
|
+
restart: unless-stopped
|
|
98
|
+
depends_on:
|
|
99
|
+
- postgres
|
|
100
|
+
environment:
|
|
101
|
+
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
|
|
102
|
+
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
|
|
103
|
+
PGADMIN_CONFIG_SERVER_MODE: "True"
|
|
104
|
+
PGADMIN_SERVER_JSON_FILE: /pgadmin4/servers.json
|
|
105
|
+
VIRTUAL_HOST: ${PGADMIN_DOMAIN}
|
|
106
|
+
VIRTUAL_PORT: 80
|
|
107
|
+
LETSENCRYPT_HOST: ${PGADMIN_DOMAIN}
|
|
108
|
+
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
|
109
|
+
volumes:
|
|
110
|
+
- pgadmin_data:/var/lib/pgadmin
|
|
111
|
+
- ./pgadmin/servers.json:/pgadmin4/servers.json:ro
|
|
112
|
+
ports:
|
|
113
|
+
- "${PGADMIN_LOCAL_PORT:-127.0.0.1:8083}:80"
|
|
114
|
+
networks:
|
|
115
|
+
- infra
|
|
116
|
+
- nginx-proxy
|
|
117
|
+
|
|
118
|
+
volumes:
|
|
119
|
+
mysql_global_data:
|
|
120
|
+
postgres_global_data:
|
|
121
|
+
redis_global_data:
|
|
122
|
+
pgadmin_data:
|
|
123
|
+
|
|
124
|
+
networks:
|
|
125
|
+
nginx-proxy:
|
|
126
|
+
external: true
|
|
127
|
+
name: nginx-proxy
|
|
128
|
+
infra:
|
|
129
|
+
external: true
|
|
130
|
+
name: infra
|
|
131
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Local-only overrides for Docker Desktop
|
|
2
|
+
# This file is applied together with deploy/server/.env and should not be used on remote.
|
|
3
|
+
PROXY_HTTP_PORT=8081
|
|
4
|
+
PROXY_HTTPS_PORT=8443
|
|
5
|
+
PHPMYADMIN_DOMAIN=pma.localhost
|
|
6
|
+
PGADMIN_DOMAIN=pga.localhost
|
|
7
|
+
|
|
8
|
+
# Optional local DB name override (takes precedence over deploy/server/.env)
|
|
9
|
+
# MYSQL_DATABASE=nexwire
|
|
10
|
+
# POSTGRES_DB=nexwire
|
|
11
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Server infra env template (base values)
|
|
2
|
+
# Remote: copy to deploy/server/.env and use as-is
|
|
3
|
+
# Local: copy to deploy/server/.env then override in deploy/server/.env.local
|
|
4
|
+
LETSENCRYPT_EMAIL=ops@example.com
|
|
5
|
+
PROXY_HTTP_PORT=80
|
|
6
|
+
PROXY_HTTPS_PORT=443
|
|
7
|
+
|
|
8
|
+
MYSQL_ROOT_PASSWORD=change-me-root
|
|
9
|
+
MYSQL_DATABASE=nexwire
|
|
10
|
+
MYSQL_PORT=4000
|
|
11
|
+
|
|
12
|
+
POSTGRES_USER=postgres
|
|
13
|
+
POSTGRES_PASSWORD=change-me-postgres
|
|
14
|
+
POSTGRES_DB=postgres
|
|
15
|
+
POSTGRES_PORT=4001
|
|
16
|
+
|
|
17
|
+
REDIS=false
|
|
18
|
+
|
|
19
|
+
PHPMYADMIN_DOMAIN=pma.example.com
|
|
20
|
+
PGADMIN_DOMAIN=pga.example.com
|
|
21
|
+
PGADMIN_DEFAULT_EMAIL=admin@example.com
|
|
22
|
+
PGADMIN_DEFAULT_PASSWORD=admin123
|
|
23
|
+
PHPMYADMIN_LOCAL_PORT=127.0.0.1:8082
|
|
24
|
+
PGADMIN_LOCAL_PORT=127.0.0.1:8083
|
|
25
|
+
|