create-nexgen 1.0.4
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/package.json +26 -0
- package/src/index.js +108 -0
- package/template/.dockerignore +14 -0
- package/template/.env +58 -0
- package/template/.env.example +59 -0
- package/template/.prettierignore +5 -0
- package/template/.prettierrc +8 -0
- package/template/README.md +447 -0
- package/template/drizzle.config.ts +29 -0
- package/template/eslint.config.js +52 -0
- package/template/gitignore-stub +24 -0
- package/template/package.json +96 -0
- package/template/public/assets/AuthLayout-CbswhpjJ.js +1 -0
- package/template/public/assets/Button-_7aQ7gHL.js +1 -0
- package/template/public/assets/Input-CLNJXmKc.css +1 -0
- package/template/public/assets/Input-z8GI8Aqo.js +1 -0
- package/template/public/assets/InputPasswordToggle-BxlzVGp3.js +1 -0
- package/template/public/assets/InputPasswordToggle-C77FI9Eg.css +1 -0
- package/template/public/assets/Layout-DotR1sQC.js +1 -0
- package/template/public/assets/Refresh-BdqsPPBC.js +1 -0
- package/template/public/assets/admin-ui-CU34rLdN.js +1 -0
- package/template/public/assets/bootstrap-icons-BeopsB42.woff +0 -0
- package/template/public/assets/bootstrap-icons-mSm7cUeB.woff2 +0 -0
- package/template/public/assets/dashboard-CwybEyLc.js +1 -0
- package/template/public/assets/dashboard-Dc4d-Pi7.css +1 -0
- package/template/public/assets/forgetPassword-CKEJaXsq.js +1 -0
- package/template/public/assets/index-Bleyx5dm.js +64 -0
- package/template/public/assets/index-DUw8E6Yg.css +1 -0
- package/template/public/assets/login-DC7PTlQF.js +1 -0
- package/template/public/assets/realtime-test-BPQdrFym.css +1 -0
- package/template/public/assets/realtime-test-tQZ0rBEJ.js +1 -0
- package/template/public/assets/register-3O7Qs28C.js +1 -0
- package/template/public/assets/resetPassword-A5AzMWKs.js +1 -0
- package/template/public/assets/verifyEmail-DDBEQHOv.js +1 -0
- package/template/public/index.html +17 -0
- package/template/src/database/migrations/mysql/0000_init.sql +73 -0
- package/template/src/database/migrations/mysql/meta/0000_snapshot.json +484 -0
- package/template/src/database/migrations/mysql/meta/_journal.json +13 -0
- package/template/src/database/schema.ts +4 -0
- package/template/src/env.ts +107 -0
- package/template/src/framework/cache/cache.ts +81 -0
- package/template/src/framework/database/connection.ts +168 -0
- package/template/src/framework/database/optional-db-drivers.d.ts +9 -0
- package/template/src/framework/database/paginate.ts +200 -0
- package/template/src/framework/database/schema.ts +26 -0
- package/template/src/framework/database/seed.ts +33 -0
- package/template/src/framework/events/dispatcher.ts +57 -0
- package/template/src/framework/facade.ts +27 -0
- package/template/src/framework/http/app.ts +61 -0
- package/template/src/framework/http/cors.ts +19 -0
- package/template/src/framework/http/logger.ts +85 -0
- package/template/src/framework/http/openapi.ts +34 -0
- package/template/src/framework/http/ratelimiter.ts +13 -0
- package/template/src/framework/http/router.ts +76 -0
- package/template/src/framework/http/static.ts +33 -0
- package/template/src/framework/http/validation.ts +24 -0
- package/template/src/framework/kernel.ts +40 -0
- package/template/src/framework/maker-cli/src/index.mjs +51 -0
- package/template/src/framework/maker-cli/src/levels/level-1/env-db.mjs +57 -0
- package/template/src/framework/maker-cli/src/levels/level-1/file-ops.mjs +30 -0
- package/template/src/framework/maker-cli/src/levels/level-1/flags.mjs +16 -0
- package/template/src/framework/maker-cli/src/levels/level-1/help.mjs +24 -0
- package/template/src/framework/maker-cli/src/levels/level-1/naming.mjs +13 -0
- package/template/src/framework/maker-cli/src/levels/level-1/process.mjs +47 -0
- package/template/src/framework/maker-cli/src/levels/level-2/db/core.mjs +299 -0
- package/template/src/framework/maker-cli/src/levels/level-2/db/index.mjs +177 -0
- package/template/src/framework/maker-cli/src/levels/level-2/deploy/core.mjs +635 -0
- package/template/src/framework/maker-cli/src/levels/level-2/deploy/index.mjs +145 -0
- package/template/src/framework/maker-cli/src/levels/level-2/module/core.mjs +707 -0
- package/template/src/framework/maker-cli/src/levels/level-2/module/index.mjs +116 -0
- package/template/src/framework/maker-cli/src/levels/level-2/runtime/build-frontend.mjs +16 -0
- package/template/src/framework/maker-cli/src/levels/level-2/runtime/core.mjs +311 -0
- package/template/src/framework/maker-cli/src/levels/level-2/runtime/index.mjs +71 -0
- package/template/src/framework/maker-cli/stubs/controller/openapi.ts.stub +55 -0
- package/template/src/framework/maker-cli/stubs/controller/openapi.with-model.ts.stub +56 -0
- package/template/src/framework/maker-cli/stubs/controller/plain.ts.stub +57 -0
- package/template/src/framework/maker-cli/stubs/controller/schema.plain.ts.stub +13 -0
- package/template/src/framework/maker-cli/stubs/controller/schema.ts.stub +32 -0
- package/template/src/framework/maker-cli/stubs/deploy/Dockerfile.bun.stub +49 -0
- package/template/src/framework/maker-cli/stubs/deploy/Dockerfile.pnpm.stub +53 -0
- package/template/src/framework/maker-cli/stubs/deploy/Dockerfile.stub +49 -0
- package/template/src/framework/maker-cli/stubs/deploy/Dockerfile.yarn.stub +53 -0
- package/template/src/framework/maker-cli/stubs/deploy/README.stub +55 -0
- package/template/src/framework/maker-cli/stubs/deploy/compose/mysql.server.stub +29 -0
- package/template/src/framework/maker-cli/stubs/deploy/compose/postgres.server.stub +29 -0
- package/template/src/framework/maker-cli/stubs/deploy/compose/sqlite.stub +29 -0
- package/template/src/framework/maker-cli/stubs/deploy/env/mysql.server.stub +73 -0
- package/template/src/framework/maker-cli/stubs/deploy/env/postgres.server.stub +73 -0
- package/template/src/framework/maker-cli/stubs/deploy/env/sqlite.stub +72 -0
- package/template/src/framework/maker-cli/stubs/deploy/scripts/auto-migrate.sh.stub +15 -0
- package/template/src/framework/maker-cli/stubs/deploy/server/README.stub +77 -0
- package/template/src/framework/maker-cli/stubs/deploy/server/compose/noredis.stub +118 -0
- package/template/src/framework/maker-cli/stubs/deploy/server/compose/redis.dev.stub +131 -0
- package/template/src/framework/maker-cli/stubs/deploy/server/compose/redis.stub +129 -0
- package/template/src/framework/maker-cli/stubs/deploy/server/env/local.example.stub +10 -0
- package/template/src/framework/maker-cli/stubs/deploy/server/env/noredis.stub +24 -0
- package/template/src/framework/maker-cli/stubs/deploy/server/env/redis.stub +24 -0
- package/template/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/README.stub +15 -0
- package/template/src/framework/maker-cli/stubs/deploy/server/nginx-vhost/app.example.com.stub +12 -0
- package/template/src/framework/maker-cli/stubs/deploy/server/pgadmin/servers.stub +13 -0
- package/template/src/framework/maker-cli/stubs/deploy/server/redis/redis.conf.stub +6 -0
- package/template/src/framework/maker-cli/stubs/deploy/supervisor/noredis.stub +53 -0
- package/template/src/framework/maker-cli/stubs/deploy/supervisor/redis.stub +69 -0
- package/template/src/framework/maker-cli/stubs/deploy/workflow/local.json.stub +24 -0
- package/template/src/framework/maker-cli/stubs/deploy/workflow/remote.json.stub +20 -0
- package/template/src/framework/maker-cli/stubs/example/console.ts.stub +33 -0
- package/template/src/framework/maker-cli/stubs/example/controller.ts.stub +503 -0
- package/template/src/framework/maker-cli/stubs/example/job.ts.stub +74 -0
- package/template/src/framework/maker-cli/stubs/example/route.api.ts.stub +206 -0
- package/template/src/framework/maker-cli/stubs/example/schema.ts.stub +41 -0
- package/template/src/framework/maker-cli/stubs/job/name.ts.stub +24 -0
- package/template/src/framework/maker-cli/stubs/model/name.mysql.ts.stub +8 -0
- package/template/src/framework/maker-cli/stubs/model/name.postgresql.ts.stub +8 -0
- package/template/src/framework/maker-cli/stubs/model/name.sqlite.ts.stub +8 -0
- package/template/src/framework/maker-cli/stubs/notification/NotificationBell.vue.stub +218 -0
- package/template/src/framework/maker-cli/stubs/notification/controller.ts.stub +85 -0
- package/template/src/framework/maker-cli/stubs/notification/index.vue.stub +211 -0
- package/template/src/framework/maker-cli/stubs/notification/job.ts.stub +12 -0
- package/template/src/framework/maker-cli/stubs/notification/route.api.ts.stub +49 -0
- package/template/src/framework/maker-cli/stubs/notification/schema.ts.stub +25 -0
- package/template/src/framework/maker-cli/stubs/route/api.ts.stub +79 -0
- package/template/src/framework/maker-cli/stubs/route/plain.ts.stub +10 -0
- package/template/src/framework/maker-cli/stubs/schedule/name.ts.stub +35 -0
- package/template/src/framework/maker-cli/stubs/seeder/name.ts.stub +17 -0
- package/template/src/framework/modules/discover.ts +54 -0
- package/template/src/framework/modules/routes.ts +26 -0
- package/template/src/framework/notification/index.ts +109 -0
- package/template/src/framework/queue/clear.ts +20 -0
- package/template/src/framework/queue/queue.ts +213 -0
- package/template/src/framework/queue/ui.ts +104 -0
- package/template/src/framework/queue/worker.ts +33 -0
- package/template/src/framework/realtime/broadcast.ts +27 -0
- package/template/src/framework/realtime/index.ts +1 -0
- package/template/src/framework/realtime/socket-cookie.ts +65 -0
- package/template/src/framework/realtime/socket.ts +132 -0
- package/template/src/framework/realtime/types.ts +6 -0
- package/template/src/framework/realtime/ui.ts +16 -0
- package/template/src/framework/redis/client.ts +126 -0
- package/template/src/framework/scheduler/lock.ts +124 -0
- package/template/src/framework/scheduler/run.ts +26 -0
- package/template/src/framework/scheduler/scheduler.ts +82 -0
- package/template/src/framework/server.ts +147 -0
- package/template/src/framework/session/session.ts +116 -0
- package/template/src/framework/storage/storage.ts +743 -0
- package/template/src/framework/support/cookie.ts +78 -0
- package/template/src/framework/support/jwt.ts +45 -0
- package/template/src/framework/support/lifecycle.ts +35 -0
- package/template/src/framework/support/logger.ts +102 -0
- package/template/src/framework/support/mail.ts +43 -0
- package/template/src/framework/support/password.ts +23 -0
- package/template/src/framework/support/url.ts +25 -0
- package/template/src/middlewares/auth-middleware.ts +98 -0
- package/template/src/middlewares/role-middleware.ts +24 -0
- package/template/src/modules/auth/controllers/auth.controller.ts +445 -0
- package/template/src/modules/auth/controllers/auth.helpers.ts +110 -0
- package/template/src/modules/auth/controllers/auth.schema.ts +102 -0
- package/template/src/modules/auth/controllers/role.controller.ts +25 -0
- package/template/src/modules/auth/database/models/notifications.ts +22 -0
- package/template/src/modules/auth/database/models/role.ts +14 -0
- package/template/src/modules/auth/database/models/user.ts +46 -0
- package/template/src/modules/auth/database/seeders/role.ts +19 -0
- package/template/src/modules/auth/database/seeders/user.ts +33 -0
- package/template/src/modules/auth/jobs/forgetpass.ts +18 -0
- package/template/src/modules/auth/jobs/registeruser.ts +31 -0
- package/template/src/modules/auth/jobs/verifyemail.ts +18 -0
- package/template/src/modules/auth/routes/api.ts +151 -0
- package/template/src/modules/auth/routes/role.ts +39 -0
- package/template/src/modules/welcome/controllers/welcome.controller.ts +14 -0
- package/template/src/modules/welcome/controllers/welcome.schema.ts +6 -0
- package/template/src/modules/welcome/database/models/welcome.ts +6 -0
- package/template/src/modules/welcome/routes/api.ts +20 -0
- package/template/src/resources/index.html +16 -0
- package/template/src/resources/src/App.vue +5 -0
- package/template/src/resources/src/assets/css/styles.css +14934 -0
- package/template/src/resources/src/assets/css/styles.css.map +1 -0
- package/template/src/resources/src/assets/images/favicon/favicon.ico +0 -0
- package/template/src/resources/src/assets/images/favicon/favicon1.ico +0 -0
- package/template/src/resources/src/assets/images/logo-1.png +0 -0
- package/template/src/resources/src/assets/images/logo-dark-sm.png +0 -0
- package/template/src/resources/src/assets/images/logo-dark.png +0 -0
- package/template/src/resources/src/assets/images/logo-dark1.png +0 -0
- package/template/src/resources/src/assets/images/logo-sm.png +0 -0
- package/template/src/resources/src/assets/images/logo1.png +0 -0
- package/template/src/resources/src/assets/images/logo2.png +0 -0
- package/template/src/resources/src/assets/scss/custom.css +217 -0
- package/template/src/resources/src/assets/scss/custom.css.map +1 -0
- package/template/src/resources/src/assets/scss/custom.scss +1100 -0
- package/template/src/resources/src/components/Button.vue +35 -0
- package/template/src/resources/src/components/Checkbox.vue +29 -0
- package/template/src/resources/src/components/FloatButton.vue +36 -0
- package/template/src/resources/src/components/Href.vue +32 -0
- package/template/src/resources/src/components/Input.vue +227 -0
- package/template/src/resources/src/components/InputGroup.vue +153 -0
- package/template/src/resources/src/components/InputPasswordToggle.vue +226 -0
- package/template/src/resources/src/components/Modal.vue +102 -0
- package/template/src/resources/src/components/Pagebar.vue +28 -0
- package/template/src/resources/src/components/Refresh.vue +26 -0
- package/template/src/resources/src/components/Select.vue +390 -0
- package/template/src/resources/src/components/Spinner.vue +42 -0
- package/template/src/resources/src/components/Switch.vue +65 -0
- package/template/src/resources/src/components/TextArea.vue +121 -0
- package/template/src/resources/src/components/Toast.vue +56 -0
- package/template/src/resources/src/components/datatable/DataTableSkeleton.vue +99 -0
- package/template/src/resources/src/components/datatable/Pagination.vue +161 -0
- package/template/src/resources/src/components/datatable/SelectOpption.vue +54 -0
- package/template/src/resources/src/components/datatable/index.vue +237 -0
- package/template/src/resources/src/composables/useAuth.ts +52 -0
- package/template/src/resources/src/composables/useBrowserDetect.ts +5 -0
- package/template/src/resources/src/composables/useDialog.ts +5 -0
- package/template/src/resources/src/composables/useGum.ts +3 -0
- package/template/src/resources/src/composables/usePulse.ts +5 -0
- package/template/src/resources/src/env.d.ts +20 -0
- package/template/src/resources/src/helpers/nformatter.ts +10 -0
- package/template/src/resources/src/helpers/utils.ts +68 -0
- package/template/src/resources/src/layouts/AuthLayout.vue +20 -0
- package/template/src/resources/src/layouts/Layout/Footer.vue +23 -0
- package/template/src/resources/src/layouts/Layout/Header.vue +90 -0
- package/template/src/resources/src/layouts/Layout/Sidebar.vue +137 -0
- package/template/src/resources/src/layouts/Layout/index.vue +76 -0
- package/template/src/resources/src/main.ts +27 -0
- package/template/src/resources/src/pages/auth/forgetPassword.vue +76 -0
- package/template/src/resources/src/pages/auth/login.vue +93 -0
- package/template/src/resources/src/pages/auth/register.vue +130 -0
- package/template/src/resources/src/pages/auth/resetPassword.vue +119 -0
- package/template/src/resources/src/pages/auth/verifyEmail.vue +60 -0
- package/template/src/resources/src/pages/dashboard/index.vue +76 -0
- package/template/src/resources/src/plugins/axios.ts +33 -0
- package/template/src/resources/src/plugins/browserDetect.ts +55 -0
- package/template/src/resources/src/plugins/dialog.ts +167 -0
- package/template/src/resources/src/plugins/gum.ts +343 -0
- package/template/src/resources/src/plugins/pulse.ts +141 -0
- package/template/src/resources/src/plugins/routeProgress.ts +87 -0
- package/template/src/resources/src/router/index.ts +85 -0
- package/template/src/resources/src/stores/admin-ui.ts +148 -0
- package/template/src/resources/src/stores/auth.ts +151 -0
- package/template/src/resources/tsconfig.json +19 -0
- package/template/src/resources/vite.config.ts +43 -0
- package/template/src/storage/logs/app.log +20179 -0
- package/template/src/storage/logs/fatal.log +727 -0
- package/template/tsconfig.json +20 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "@/framework/facade.js";
|
|
2
|
+
|
|
3
|
+
export const Create{{ClassName}}Schema = z.object({
|
|
4
|
+
name: z.string().min(1)
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export const Update{{ClassName}}Schema = z.object({
|
|
8
|
+
name: z.string().min(1)
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const {{ClassName}}IdParamsSchema = z.object({
|
|
12
|
+
id: z.coerce.number().int().positive()
|
|
13
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "@/framework/facade.js";
|
|
2
|
+
|
|
3
|
+
export const {{ClassName}}ItemSchema = z.object({
|
|
4
|
+
id: z.number(),
|
|
5
|
+
name: z.string()
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const Create{{ClassName}}Schema = z.object({
|
|
9
|
+
name: z.string().min(1)
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const Update{{ClassName}}Schema = z.object({
|
|
13
|
+
name: z.string().min(1)
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const {{ClassName}}IdParamsSchema = z.object({
|
|
17
|
+
id: z.coerce.number().int().positive()
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const {{ClassName}}ListResponseSchema = z.object({
|
|
21
|
+
message: z.string(),
|
|
22
|
+
data: z.array({{ClassName}}ItemSchema)
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const {{ClassName}}ResponseSchema = z.object({
|
|
26
|
+
message: z.string(),
|
|
27
|
+
data: {{ClassName}}ItemSchema
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const {{ClassName}}MessageSchema = z.object({
|
|
31
|
+
message: z.string()
|
|
32
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
ARG BUN_VERSION=1.3.4
|
|
2
|
+
FROM oven/bun:${BUN_VERSION}-slim AS builder
|
|
3
|
+
|
|
4
|
+
WORKDIR /app
|
|
5
|
+
|
|
6
|
+
ENV APP_URL=http://localhost:3000
|
|
7
|
+
ARG FRONTEND=true
|
|
8
|
+
ENV FRONTEND=${FRONTEND}
|
|
9
|
+
|
|
10
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
11
|
+
ca-certificates \
|
|
12
|
+
python3 \
|
|
13
|
+
make \
|
|
14
|
+
g++ \
|
|
15
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
16
|
+
|
|
17
|
+
COPY package.json bun.lockb* bun.lock* package-lock.json* ./
|
|
18
|
+
RUN bun install --frozen-lockfile
|
|
19
|
+
|
|
20
|
+
COPY . .
|
|
21
|
+
RUN bun src/framework/maker-cli/src/index.mjs db:schema
|
|
22
|
+
RUN bun run build
|
|
23
|
+
|
|
24
|
+
FROM oven/bun:${BUN_VERSION}-slim AS runner
|
|
25
|
+
|
|
26
|
+
WORKDIR /app
|
|
27
|
+
|
|
28
|
+
ENV NODE_ENV=production
|
|
29
|
+
ENV APP_URL=http://localhost:3000
|
|
30
|
+
|
|
31
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
32
|
+
supervisor \
|
|
33
|
+
ca-certificates \
|
|
34
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
35
|
+
|
|
36
|
+
COPY --from=builder /app/node_modules ./node_modules
|
|
37
|
+
COPY --from=builder /app/package.json ./package.json
|
|
38
|
+
COPY --from=builder /app/drizzle.config.ts ./drizzle.config.ts
|
|
39
|
+
COPY --from=builder /app/tsconfig.json ./tsconfig.json
|
|
40
|
+
COPY --from=builder /app/dist ./dist
|
|
41
|
+
COPY --from=builder /app/public ./public
|
|
42
|
+
COPY --from=builder /app/src ./src
|
|
43
|
+
COPY --from=builder /app/deploy/scripts ./deploy/scripts
|
|
44
|
+
|
|
45
|
+
COPY deploy/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
46
|
+
|
|
47
|
+
EXPOSE 3000
|
|
48
|
+
|
|
49
|
+
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
ARG NODE_VERSION=24
|
|
2
|
+
FROM node:${NODE_VERSION}-bookworm-slim AS builder
|
|
3
|
+
|
|
4
|
+
ARG PNPM_VERSION=10.33.2
|
|
5
|
+
ARG FRONTEND=true
|
|
6
|
+
ENV FRONTEND=${FRONTEND}
|
|
7
|
+
|
|
8
|
+
WORKDIR /app
|
|
9
|
+
|
|
10
|
+
ENV APP_URL=http://localhost:3000
|
|
11
|
+
|
|
12
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
13
|
+
ca-certificates \
|
|
14
|
+
python3 \
|
|
15
|
+
make \
|
|
16
|
+
g++ \
|
|
17
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
18
|
+
|
|
19
|
+
RUN corepack enable && corepack prepare pnpm@${PNPM_VERSION} --activate
|
|
20
|
+
|
|
21
|
+
COPY package.json pnpm-lock.yaml* ./
|
|
22
|
+
RUN if [ -f pnpm-lock.yaml ]; then pnpm install --frozen-lockfile; else pnpm install --no-frozen-lockfile; fi
|
|
23
|
+
|
|
24
|
+
COPY . .
|
|
25
|
+
RUN node src/framework/maker-cli/src/index.mjs db:schema
|
|
26
|
+
RUN pnpm run build
|
|
27
|
+
|
|
28
|
+
FROM node:${NODE_VERSION}-bookworm-slim AS runner
|
|
29
|
+
|
|
30
|
+
WORKDIR /app
|
|
31
|
+
|
|
32
|
+
ENV NODE_ENV=production
|
|
33
|
+
ENV APP_URL=http://localhost:3000
|
|
34
|
+
|
|
35
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
36
|
+
supervisor \
|
|
37
|
+
ca-certificates \
|
|
38
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
39
|
+
|
|
40
|
+
COPY --from=builder /app/node_modules ./node_modules
|
|
41
|
+
COPY --from=builder /app/package.json ./package.json
|
|
42
|
+
COPY --from=builder /app/drizzle.config.ts ./drizzle.config.ts
|
|
43
|
+
COPY --from=builder /app/tsconfig.json ./tsconfig.json
|
|
44
|
+
COPY --from=builder /app/dist ./dist
|
|
45
|
+
COPY --from=builder /app/public ./public
|
|
46
|
+
COPY --from=builder /app/src ./src
|
|
47
|
+
COPY --from=builder /app/deploy/scripts ./deploy/scripts
|
|
48
|
+
|
|
49
|
+
COPY deploy/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
50
|
+
|
|
51
|
+
EXPOSE 3000
|
|
52
|
+
|
|
53
|
+
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
ARG NODE_VERSION=24
|
|
2
|
+
FROM node:${NODE_VERSION}-bookworm-slim AS builder
|
|
3
|
+
|
|
4
|
+
WORKDIR /app
|
|
5
|
+
|
|
6
|
+
ENV APP_URL=http://localhost:3000
|
|
7
|
+
ARG FRONTEND=true
|
|
8
|
+
ENV FRONTEND=${FRONTEND}
|
|
9
|
+
|
|
10
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
11
|
+
ca-certificates \
|
|
12
|
+
python3 \
|
|
13
|
+
make \
|
|
14
|
+
g++ \
|
|
15
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
16
|
+
|
|
17
|
+
COPY package.json package-lock.json* ./
|
|
18
|
+
RUN if [ -f package-lock.json ]; then npm ci --legacy-peer-deps || npm install --legacy-peer-deps; else npm install --legacy-peer-deps; fi
|
|
19
|
+
|
|
20
|
+
COPY . .
|
|
21
|
+
RUN node src/framework/maker-cli/src/index.mjs db:schema
|
|
22
|
+
RUN npm run build
|
|
23
|
+
|
|
24
|
+
FROM node:${NODE_VERSION}-bookworm-slim AS runner
|
|
25
|
+
|
|
26
|
+
WORKDIR /app
|
|
27
|
+
|
|
28
|
+
ENV NODE_ENV=production
|
|
29
|
+
ENV APP_URL=http://localhost:3000
|
|
30
|
+
|
|
31
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
32
|
+
supervisor \
|
|
33
|
+
ca-certificates \
|
|
34
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
35
|
+
|
|
36
|
+
COPY --from=builder /app/node_modules ./node_modules
|
|
37
|
+
COPY --from=builder /app/package.json ./package.json
|
|
38
|
+
COPY --from=builder /app/drizzle.config.ts ./drizzle.config.ts
|
|
39
|
+
COPY --from=builder /app/tsconfig.json ./tsconfig.json
|
|
40
|
+
COPY --from=builder /app/dist ./dist
|
|
41
|
+
COPY --from=builder /app/public ./public
|
|
42
|
+
COPY --from=builder /app/src ./src
|
|
43
|
+
COPY --from=builder /app/deploy/scripts ./deploy/scripts
|
|
44
|
+
|
|
45
|
+
COPY deploy/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
46
|
+
|
|
47
|
+
EXPOSE 3000
|
|
48
|
+
|
|
49
|
+
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
ARG NODE_VERSION=24
|
|
2
|
+
FROM node:${NODE_VERSION}-bookworm-slim AS builder
|
|
3
|
+
|
|
4
|
+
ARG YARN_VERSION=1.22.22
|
|
5
|
+
ARG FRONTEND=true
|
|
6
|
+
ENV FRONTEND=${FRONTEND}
|
|
7
|
+
|
|
8
|
+
WORKDIR /app
|
|
9
|
+
|
|
10
|
+
ENV APP_URL=http://localhost:3000
|
|
11
|
+
|
|
12
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
13
|
+
ca-certificates \
|
|
14
|
+
python3 \
|
|
15
|
+
make \
|
|
16
|
+
g++ \
|
|
17
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
18
|
+
|
|
19
|
+
RUN corepack enable && corepack prepare yarn@${YARN_VERSION} --activate
|
|
20
|
+
|
|
21
|
+
COPY package.json yarn.lock* ./
|
|
22
|
+
RUN yarn install --immutable
|
|
23
|
+
|
|
24
|
+
COPY . .
|
|
25
|
+
RUN node src/framework/maker-cli/src/index.mjs db:schema
|
|
26
|
+
RUN yarn build
|
|
27
|
+
|
|
28
|
+
FROM node:${NODE_VERSION}-bookworm-slim AS runner
|
|
29
|
+
|
|
30
|
+
WORKDIR /app
|
|
31
|
+
|
|
32
|
+
ENV NODE_ENV=production
|
|
33
|
+
ENV APP_URL=http://localhost:3000
|
|
34
|
+
|
|
35
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
36
|
+
supervisor \
|
|
37
|
+
ca-certificates \
|
|
38
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
39
|
+
|
|
40
|
+
COPY --from=builder /app/node_modules ./node_modules
|
|
41
|
+
COPY --from=builder /app/package.json ./package.json
|
|
42
|
+
COPY --from=builder /app/drizzle.config.ts ./drizzle.config.ts
|
|
43
|
+
COPY --from=builder /app/tsconfig.json ./tsconfig.json
|
|
44
|
+
COPY --from=builder /app/dist ./dist
|
|
45
|
+
COPY --from=builder /app/public ./public
|
|
46
|
+
COPY --from=builder /app/src ./src
|
|
47
|
+
COPY --from=builder /app/deploy/scripts ./deploy/scripts
|
|
48
|
+
|
|
49
|
+
COPY deploy/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
50
|
+
|
|
51
|
+
EXPOSE 3000
|
|
52
|
+
|
|
53
|
+
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Deploy
|
|
2
|
+
|
|
3
|
+
Generated from current project .env.
|
|
4
|
+
|
|
5
|
+
- Database mode: {{DATABASE_MODE}}
|
|
6
|
+
- Redis enabled: {{REDIS_STATUS}}
|
|
7
|
+
- Runtime: {{RUNTIME_NAME}}
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
- External docker networks exist:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
docker network create nginx-proxy || true
|
|
15
|
+
docker network create infra || true
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- Proxy stack from `server-setup` is running (jwilder + letsencrypt companion).
|
|
19
|
+
|
|
20
|
+
## Start app stack
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
docker compose --env-file deploy/server/.env --env-file deploy/.env -f deploy/docker-compose.yml up -d --build
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Equivalent maker command:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
bun maker deploy:app
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## DB Import
|
|
33
|
+
|
|
34
|
+
Import SQL dump into local Docker MySQL:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
bun maker deploy:db:import --file=deploy/nexgen.sql --database=nexgen
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Import SQL dump into remote Docker MySQL:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
bun maker deploy:db:import:remote --config=deploy/workflow.remote.json --file=deploy/nexgen.sql --database=nexgen
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Runtime
|
|
47
|
+
|
|
48
|
+
Supervisor starts:
|
|
49
|
+
|
|
50
|
+
- API: `maker serve --prod --runtime={{RUNTIME_NAME}}`
|
|
51
|
+
{{QUEUE_LINE}}- Scheduler: `maker schedule:work --prod --runtime={{RUNTIME_NAME}}`
|
|
52
|
+
|
|
53
|
+
{{REDIS_NOTE}}
|
|
54
|
+
|
|
55
|
+
This deploy style follows `server-setup` and `statistic_postgre` patterns (external `nginx-proxy` + `infra` networks).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: ${COMPOSE_PROJECT_NAME:-nexgen}
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
app:
|
|
5
|
+
build:
|
|
6
|
+
context: ..
|
|
7
|
+
dockerfile: deploy/Dockerfile
|
|
8
|
+
args:
|
|
9
|
+
FRONTEND: ${FRONTEND}
|
|
10
|
+
container_name: ${APP_NAME:-nexgen}-app
|
|
11
|
+
restart: unless-stopped
|
|
12
|
+
working_dir: /app
|
|
13
|
+
ports:
|
|
14
|
+
- "${APP_PORT:-3000}:3000"
|
|
15
|
+
env_file:
|
|
16
|
+
- .env
|
|
17
|
+
environment:
|
|
18
|
+
APP_ENV: production
|
|
19
|
+
APP_PORT: 3000
|
|
20
|
+
APP_URL: http://${APP_HOST:-localhost}:${APP_PORT:-3000}
|
|
21
|
+
DATABASE_URL: ${DATABASE_URL}
|
|
22
|
+
{{REDIS_ENV_LINE}} APP_HOST: ${APP_HOST:-localhost}
|
|
23
|
+
networks:
|
|
24
|
+
- infra
|
|
25
|
+
|
|
26
|
+
networks:
|
|
27
|
+
infra:
|
|
28
|
+
external: true
|
|
29
|
+
name: infra
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: ${COMPOSE_PROJECT_NAME:-nexgen}
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
app:
|
|
5
|
+
build:
|
|
6
|
+
context: ..
|
|
7
|
+
dockerfile: deploy/Dockerfile
|
|
8
|
+
args:
|
|
9
|
+
FRONTEND: ${FRONTEND}
|
|
10
|
+
container_name: ${APP_NAME:-nexgen}-app
|
|
11
|
+
restart: unless-stopped
|
|
12
|
+
working_dir: /app
|
|
13
|
+
ports:
|
|
14
|
+
- "${APP_PORT:-3000}:3000"
|
|
15
|
+
env_file:
|
|
16
|
+
- .env
|
|
17
|
+
environment:
|
|
18
|
+
APP_ENV: production
|
|
19
|
+
APP_PORT: 3000
|
|
20
|
+
APP_URL: http://${APP_HOST:-localhost}:${APP_PORT:-3000}
|
|
21
|
+
DATABASE_URL: ${DATABASE_URL}
|
|
22
|
+
{{REDIS_ENV_LINE}} APP_HOST: ${APP_HOST:-localhost}
|
|
23
|
+
networks:
|
|
24
|
+
- infra
|
|
25
|
+
|
|
26
|
+
networks:
|
|
27
|
+
infra:
|
|
28
|
+
external: true
|
|
29
|
+
name: infra
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: ${COMPOSE_PROJECT_NAME:-nexgen}
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
app:
|
|
5
|
+
build:
|
|
6
|
+
context: ..
|
|
7
|
+
dockerfile: deploy/Dockerfile
|
|
8
|
+
args:
|
|
9
|
+
FRONTEND: ${FRONTEND}
|
|
10
|
+
container_name: ${APP_NAME:-nexgen}-app
|
|
11
|
+
restart: unless-stopped
|
|
12
|
+
working_dir: /app
|
|
13
|
+
ports:
|
|
14
|
+
- "${APP_PORT:-3000}:3000"
|
|
15
|
+
env_file:
|
|
16
|
+
- .env
|
|
17
|
+
environment:
|
|
18
|
+
APP_ENV: production
|
|
19
|
+
APP_PORT: 3000
|
|
20
|
+
APP_URL: http://${APP_HOST:-localhost}:${APP_PORT:-3000}
|
|
21
|
+
DATABASE_URL: ${DATABASE_URL}
|
|
22
|
+
{{REDIS_ENV_LINE}} APP_HOST: ${APP_HOST:-localhost}
|
|
23
|
+
networks:
|
|
24
|
+
- infra
|
|
25
|
+
|
|
26
|
+
networks:
|
|
27
|
+
infra:
|
|
28
|
+
external: true
|
|
29
|
+
name: infra
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# App deploy env template (shared for local + remote)
|
|
2
|
+
# Local: use this as deploy/.env
|
|
3
|
+
# Remote: use this as deploy/.env
|
|
4
|
+
# ── App ────────────────────────────────────────────
|
|
5
|
+
APP_HOST=localhost
|
|
6
|
+
APP_PORT=3000
|
|
7
|
+
APP_NAME=nexgen
|
|
8
|
+
APP_ENV=production
|
|
9
|
+
AUTO_MIGRATE=true
|
|
10
|
+
OPEN_API={{OPEN_API}}
|
|
11
|
+
LOG_LEVEL={{LOG_LEVEL}}
|
|
12
|
+
# Frontend origin (only needed when frontend is on a different domain than API)
|
|
13
|
+
# Leave empty if frontend is served from the same APP_URL or FRONTEND=false
|
|
14
|
+
FRONTEND_URL=
|
|
15
|
+
# Allowed CORS origins. Use * for any, or comma-separated for specific origins
|
|
16
|
+
CORS_ORIGIN={{CORS_ORIGIN}}
|
|
17
|
+
|
|
18
|
+
# ── Database ───────────────────────────────────────
|
|
19
|
+
# Set the password and database name to match deploy/server/.env
|
|
20
|
+
DATABASE_URL=mysql://root:change-me-root@mysql-global:3306/nexgen
|
|
21
|
+
|
|
22
|
+
# ── Storage (File Uploads) ─────────────────────────
|
|
23
|
+
STORAGE_DRIVER={{STORAGE_DRIVER}}
|
|
24
|
+
STORAGE_DISK={{STORAGE_DISK}}
|
|
25
|
+
STORAGE_BUCKET=
|
|
26
|
+
STORAGE_REGION=us-east-1
|
|
27
|
+
STORAGE_ENDPOINT=
|
|
28
|
+
STORAGE_ACCESS_KEY_ID=
|
|
29
|
+
STORAGE_SECRET_ACCESS_KEY=
|
|
30
|
+
STORAGE_FORCE_PATH_STYLE=false
|
|
31
|
+
STORAGE_SIGNED_URL_TTL_SECONDS=900
|
|
32
|
+
|
|
33
|
+
# ── JWT Auth ───────────────────────────────────────
|
|
34
|
+
JWT_ACCESS_SECRET={{JWT_ACCESS_SECRET}}
|
|
35
|
+
JWT_REFRESH_SECRET={{JWT_REFRESH_SECRET}}
|
|
36
|
+
JWT_ACCESS_EXPIRY=900
|
|
37
|
+
JWT_REFRESH_EXPIRY=2592000
|
|
38
|
+
JWT_REFRESH_REMEMBER_EXPIRY=604800
|
|
39
|
+
|
|
40
|
+
# ── Session / Cookie ───────────────────────────────
|
|
41
|
+
COOKIE_NAME={{COOKIE_NAME}}
|
|
42
|
+
COOKIE_SECRET={{COOKIE_SECRET}}
|
|
43
|
+
|
|
44
|
+
# ── Redis ──────────────────────────────────────────
|
|
45
|
+
# Enables/disables cache, session, queue, events, BullBoard (all Redis-backed services)
|
|
46
|
+
REDIS={{REDIS_ENABLED}}
|
|
47
|
+
REDIS_URL=redis://redis-global:6379
|
|
48
|
+
REDIS_PREFIX={{REDIS_PREFIX}}
|
|
49
|
+
# Comma-separated emails allowed to open /bullmq (empty = no email restriction)
|
|
50
|
+
BULLMQ_UI_ALLOWED_EMAILS=admin@example.com
|
|
51
|
+
|
|
52
|
+
# ── Session / Cache TTL ────────────────────────────
|
|
53
|
+
SESSION_COOKIE={{SESSION_COOKIE}}
|
|
54
|
+
SESSION_TTL_SECONDS={{SESSION_TTL_SECONDS}}
|
|
55
|
+
CACHE_TTL_SECONDS={{CACHE_TTL_SECONDS}}
|
|
56
|
+
|
|
57
|
+
# ── Feature Toggles ────────────────────────────────
|
|
58
|
+
# Enable/disable frontend build and serving. Set false for API-only mode
|
|
59
|
+
FRONTEND={{FRONTEND}}
|
|
60
|
+
# Enable/disable Socket.IO realtime server
|
|
61
|
+
SOCKET={{SOCKET}}
|
|
62
|
+
|
|
63
|
+
# ── Auth ───────────────────────────────────────────
|
|
64
|
+
AUTH_REQUIRE_EMAIL_VERIFICATION={{AUTH_REQUIRE_EMAIL_VERIFICATION}}
|
|
65
|
+
|
|
66
|
+
# ── Mail ───────────────────────────────────────────
|
|
67
|
+
# When true, mail errors won't crash the request. Useful in dev without SMTP
|
|
68
|
+
MAIL_FAIL_SILENT={{MAIL_FAIL_SILENT}}
|
|
69
|
+
MAIL_HOST=127.0.0.1
|
|
70
|
+
MAIL_PORT=1089
|
|
71
|
+
MAIL_USERNAME=
|
|
72
|
+
MAIL_PASSWORD=
|
|
73
|
+
MAIL_FROM_ADDRESS=no-reply@example.com
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# App deploy env template (shared for local + remote)
|
|
2
|
+
# Local: use this as deploy/.env
|
|
3
|
+
# Remote: use this as deploy/.env
|
|
4
|
+
# ── App ────────────────────────────────────────────
|
|
5
|
+
APP_HOST=localhost
|
|
6
|
+
APP_PORT=3000
|
|
7
|
+
APP_NAME=nexgen
|
|
8
|
+
APP_ENV=production
|
|
9
|
+
AUTO_MIGRATE=true
|
|
10
|
+
OPEN_API={{OPEN_API}}
|
|
11
|
+
LOG_LEVEL={{LOG_LEVEL}}
|
|
12
|
+
# Frontend origin (only needed when frontend is on a different domain than API)
|
|
13
|
+
# Leave empty if frontend is served from the same APP_URL or FRONTEND=false
|
|
14
|
+
FRONTEND_URL=
|
|
15
|
+
# Allowed CORS origins. Use * for any, or comma-separated for specific origins
|
|
16
|
+
CORS_ORIGIN={{CORS_ORIGIN}}
|
|
17
|
+
|
|
18
|
+
# ── Database ───────────────────────────────────────
|
|
19
|
+
# Set the password and database name to match deploy/server/.env
|
|
20
|
+
DATABASE_URL=postgres://postgres:change-me-postgres@postgres-global:5432/postgres
|
|
21
|
+
|
|
22
|
+
# ── Storage (File Uploads) ─────────────────────────
|
|
23
|
+
STORAGE_DRIVER={{STORAGE_DRIVER}}
|
|
24
|
+
STORAGE_DISK={{STORAGE_DISK}}
|
|
25
|
+
STORAGE_BUCKET=
|
|
26
|
+
STORAGE_REGION=us-east-1
|
|
27
|
+
STORAGE_ENDPOINT=
|
|
28
|
+
STORAGE_ACCESS_KEY_ID=
|
|
29
|
+
STORAGE_SECRET_ACCESS_KEY=
|
|
30
|
+
STORAGE_FORCE_PATH_STYLE=false
|
|
31
|
+
STORAGE_SIGNED_URL_TTL_SECONDS=900
|
|
32
|
+
|
|
33
|
+
# ── JWT Auth ───────────────────────────────────────
|
|
34
|
+
JWT_ACCESS_SECRET={{JWT_ACCESS_SECRET}}
|
|
35
|
+
JWT_REFRESH_SECRET={{JWT_REFRESH_SECRET}}
|
|
36
|
+
JWT_ACCESS_EXPIRY=900
|
|
37
|
+
JWT_REFRESH_EXPIRY=2592000
|
|
38
|
+
JWT_REFRESH_REMEMBER_EXPIRY=604800
|
|
39
|
+
|
|
40
|
+
# ── Session / Cookie ───────────────────────────────
|
|
41
|
+
COOKIE_NAME={{COOKIE_NAME}}
|
|
42
|
+
COOKIE_SECRET={{COOKIE_SECRET}}
|
|
43
|
+
|
|
44
|
+
# ── Redis ──────────────────────────────────────────
|
|
45
|
+
# Enables/disables cache, session, queue, events, BullBoard (all Redis-backed services)
|
|
46
|
+
REDIS={{REDIS_ENABLED}}
|
|
47
|
+
REDIS_URL=redis://redis-global:6379
|
|
48
|
+
REDIS_PREFIX={{REDIS_PREFIX}}
|
|
49
|
+
# Comma-separated emails allowed to open /bullmq (empty = no email restriction)
|
|
50
|
+
BULLMQ_UI_ALLOWED_EMAILS=admin@example.com
|
|
51
|
+
|
|
52
|
+
# ── Session / Cache TTL ────────────────────────────
|
|
53
|
+
SESSION_COOKIE={{SESSION_COOKIE}}
|
|
54
|
+
SESSION_TTL_SECONDS={{SESSION_TTL_SECONDS}}
|
|
55
|
+
CACHE_TTL_SECONDS={{CACHE_TTL_SECONDS}}
|
|
56
|
+
|
|
57
|
+
# ── Feature Toggles ────────────────────────────────
|
|
58
|
+
# Enable/disable frontend build and serving. Set false for API-only mode
|
|
59
|
+
FRONTEND={{FRONTEND}}
|
|
60
|
+
# Enable/disable Socket.IO realtime server
|
|
61
|
+
SOCKET={{SOCKET}}
|
|
62
|
+
|
|
63
|
+
# ── Auth ───────────────────────────────────────────
|
|
64
|
+
AUTH_REQUIRE_EMAIL_VERIFICATION={{AUTH_REQUIRE_EMAIL_VERIFICATION}}
|
|
65
|
+
|
|
66
|
+
# ── Mail ───────────────────────────────────────────
|
|
67
|
+
# When true, mail errors won't crash the request. Useful in dev without SMTP
|
|
68
|
+
MAIL_FAIL_SILENT={{MAIL_FAIL_SILENT}}
|
|
69
|
+
MAIL_HOST=127.0.0.1
|
|
70
|
+
MAIL_PORT=1089
|
|
71
|
+
MAIL_USERNAME=
|
|
72
|
+
MAIL_PASSWORD=
|
|
73
|
+
MAIL_FROM_ADDRESS=no-reply@example.com
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# App deploy env template (shared for local + remote)
|
|
2
|
+
# Local: use this as deploy/.env
|
|
3
|
+
# Remote: use this as deploy/.env
|
|
4
|
+
# ── App ────────────────────────────────────────────
|
|
5
|
+
APP_HOST=localhost
|
|
6
|
+
APP_PORT=3000
|
|
7
|
+
APP_NAME=nexgen
|
|
8
|
+
APP_ENV=production
|
|
9
|
+
AUTO_MIGRATE=true
|
|
10
|
+
OPEN_API={{OPEN_API}}
|
|
11
|
+
LOG_LEVEL={{LOG_LEVEL}}
|
|
12
|
+
# Frontend origin (only needed when frontend is on a different domain than API)
|
|
13
|
+
# Leave empty if frontend is served from the same APP_URL or FRONTEND=false
|
|
14
|
+
FRONTEND_URL=
|
|
15
|
+
# Allowed CORS origins. Use * for any, or comma-separated for specific origins
|
|
16
|
+
CORS_ORIGIN={{CORS_ORIGIN}}
|
|
17
|
+
|
|
18
|
+
# ── Database ───────────────────────────────────────
|
|
19
|
+
DATABASE_URL=sqlite:./src/storage/database/nexgen.sqlite
|
|
20
|
+
|
|
21
|
+
# ── Storage (File Uploads) ─────────────────────────
|
|
22
|
+
STORAGE_DRIVER={{STORAGE_DRIVER}}
|
|
23
|
+
STORAGE_DISK={{STORAGE_DISK}}
|
|
24
|
+
STORAGE_BUCKET=
|
|
25
|
+
STORAGE_REGION=us-east-1
|
|
26
|
+
STORAGE_ENDPOINT=
|
|
27
|
+
STORAGE_ACCESS_KEY_ID=
|
|
28
|
+
STORAGE_SECRET_ACCESS_KEY=
|
|
29
|
+
STORAGE_FORCE_PATH_STYLE=false
|
|
30
|
+
STORAGE_SIGNED_URL_TTL_SECONDS=900
|
|
31
|
+
|
|
32
|
+
# ── JWT Auth ───────────────────────────────────────
|
|
33
|
+
JWT_ACCESS_SECRET={{JWT_ACCESS_SECRET}}
|
|
34
|
+
JWT_REFRESH_SECRET={{JWT_REFRESH_SECRET}}
|
|
35
|
+
JWT_ACCESS_EXPIRY=900
|
|
36
|
+
JWT_REFRESH_EXPIRY=2592000
|
|
37
|
+
JWT_REFRESH_REMEMBER_EXPIRY=604800
|
|
38
|
+
|
|
39
|
+
# ── Session / Cookie ───────────────────────────────
|
|
40
|
+
COOKIE_NAME={{COOKIE_NAME}}
|
|
41
|
+
COOKIE_SECRET={{COOKIE_SECRET}}
|
|
42
|
+
|
|
43
|
+
# ── Redis ──────────────────────────────────────────
|
|
44
|
+
# Enables/disables cache, session, queue, events, BullBoard (all Redis-backed services)
|
|
45
|
+
REDIS={{REDIS_ENABLED}}
|
|
46
|
+
REDIS_URL=redis://redis-global:6379
|
|
47
|
+
REDIS_PREFIX={{REDIS_PREFIX}}
|
|
48
|
+
# Comma-separated emails allowed to open /bullmq (empty = no email restriction)
|
|
49
|
+
BULLMQ_UI_ALLOWED_EMAILS=admin@example.com
|
|
50
|
+
|
|
51
|
+
# ── Session / Cache TTL ────────────────────────────
|
|
52
|
+
SESSION_COOKIE={{SESSION_COOKIE}}
|
|
53
|
+
SESSION_TTL_SECONDS={{SESSION_TTL_SECONDS}}
|
|
54
|
+
CACHE_TTL_SECONDS={{CACHE_TTL_SECONDS}}
|
|
55
|
+
|
|
56
|
+
# ── Feature Toggles ────────────────────────────────
|
|
57
|
+
# Enable/disable frontend build and serving. Set false for API-only mode
|
|
58
|
+
FRONTEND={{FRONTEND}}
|
|
59
|
+
# Enable/disable Socket.IO realtime server
|
|
60
|
+
SOCKET={{SOCKET}}
|
|
61
|
+
|
|
62
|
+
# ── Auth ───────────────────────────────────────────
|
|
63
|
+
AUTH_REQUIRE_EMAIL_VERIFICATION={{AUTH_REQUIRE_EMAIL_VERIFICATION}}
|
|
64
|
+
|
|
65
|
+
# ── Mail ───────────────────────────────────────────
|
|
66
|
+
# When true, mail errors won't crash the request. Useful in dev without SMTP
|
|
67
|
+
MAIL_FAIL_SILENT={{MAIL_FAIL_SILENT}}
|
|
68
|
+
MAIL_HOST=127.0.0.1
|
|
69
|
+
MAIL_PORT=1089
|
|
70
|
+
MAIL_USERNAME=
|
|
71
|
+
MAIL_PASSWORD=
|
|
72
|
+
MAIL_FROM_ADDRESS=no-reply@example.com
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
RUNTIME_EXEC="${1:-node}"
|
|
5
|
+
AUTO_MIGRATE_RAW="${AUTO_MIGRATE:-false}"
|
|
6
|
+
AUTO_MIGRATE_NORMALIZED=$(echo "$AUTO_MIGRATE_RAW" | tr -d '\r' | tr '[:upper:]' '[:lower:]' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
7
|
+
|
|
8
|
+
case "$AUTO_MIGRATE_NORMALIZED" in
|
|
9
|
+
true|1|yes)
|
|
10
|
+
exec "$RUNTIME_EXEC" src/framework/maker-cli/src/index.mjs db:migrate --seed
|
|
11
|
+
;;
|
|
12
|
+
*)
|
|
13
|
+
echo "Skipping migrations (AUTO_MIGRATE=$AUTO_MIGRATE_RAW)"
|
|
14
|
+
;;
|
|
15
|
+
esac
|