create-carlonicora-app 1.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/LICENSE +675 -0
- package/README.md +104 -0
- package/bin/cli.js +3 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +92 -0
- package/dist/cli.js.map +1 -0
- package/dist/git.d.ts +7 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +80 -0
- package/dist/git.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts.d.ts +5 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +30 -0
- package/dist/prompts.js.map +1 -0
- package/dist/replacer.d.ts +9 -0
- package/dist/replacer.d.ts.map +1 -0
- package/dist/replacer.js +11 -0
- package/dist/replacer.js.map +1 -0
- package/dist/scaffold.d.ts +3 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +79 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/files.d.ts +6 -0
- package/dist/utils/files.d.ts.map +1 -0
- package/dist/utils/files.js +103 -0
- package/dist/utils/files.js.map +1 -0
- package/dist/utils/logger.d.ts +12 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +35 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/validation.d.ts +6 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +63 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +52 -0
- package/template/.env.example +159 -0
- package/template/.github/workflows/check-library-updates.yml +71 -0
- package/template/.github/workflows/dev.yml +63 -0
- package/template/.github/workflows/pull-request.yml +55 -0
- package/template/.gitmodules +6 -0
- package/template/.husky/pre-commit +1 -0
- package/template/.husky/pre-push +1 -0
- package/template/.prettierignore +1 -0
- package/template/.prettierrc +13 -0
- package/template/.releaserc +134 -0
- package/template/.vscode/settings.json +16 -0
- package/template/CHANGELOG.md +0 -0
- package/template/CLAUDE.md +34 -0
- package/template/DOCKER.md +1591 -0
- package/template/Dockerfile +228 -0
- package/template/README.md +1 -0
- package/template/apps/api/.prettierrc +12 -0
- package/template/apps/api/eslint.config.mjs +54 -0
- package/template/apps/api/jest.config.js +29 -0
- package/template/apps/api/nest-cli.json +15 -0
- package/template/apps/api/package.json +155 -0
- package/template/apps/api/src/config/config.ts +17 -0
- package/template/apps/api/src/config/enums/job.name.ts +6 -0
- package/template/apps/api/src/config/enums/queue.id.ts +3 -0
- package/template/apps/api/src/config/interfaces/config.interface.ts +3 -0
- package/template/apps/api/src/features/features.modules.ts +6 -0
- package/template/apps/api/src/i18n/en/notifications.json +3 -0
- package/template/apps/api/src/main.ts +23 -0
- package/template/apps/api/src/neo4j.migrations/20250901_001.ts +33 -0
- package/template/apps/api/src/neo4j.migrations/20250901_002.ts +90 -0
- package/template/apps/api/src/neo4j.migrations/20250901_003.ts +57 -0
- package/template/apps/api/src/neo4j.migrations/20250901_004.ts +32 -0
- package/template/apps/api/src/neo4j.migrations/queries/migration.queries.ts +49 -0
- package/template/apps/api/src/types/langchain.d.ts +56 -0
- package/template/apps/api/tsconfig.build.json +4 -0
- package/template/apps/api/tsconfig.json +38 -0
- package/template/apps/web/.swcrc +26 -0
- package/template/apps/web/components.json +21 -0
- package/template/apps/web/eslint.config.mjs +33 -0
- package/template/apps/web/global.d.ts +7 -0
- package/template/apps/web/messages/en.json +249 -0
- package/template/apps/web/next.config.js +50 -0
- package/template/apps/web/package.json +146 -0
- package/template/apps/web/playwright.config.ts +86 -0
- package/template/apps/web/postcss.config.mjs +5 -0
- package/template/apps/web/public/sw.js +32 -0
- package/template/apps/web/src/app/[locale]/(admin)/administration/companies/[id]/page.tsx +46 -0
- package/template/apps/web/src/app/[locale]/(admin)/administration/companies/page.tsx +23 -0
- package/template/apps/web/src/app/[locale]/(admin)/layout.tsx +49 -0
- package/template/apps/web/src/app/[locale]/(auth)/activation/[code]/page.tsx +13 -0
- package/template/apps/web/src/app/[locale]/(auth)/auth/page.tsx +11 -0
- package/template/apps/web/src/app/[locale]/(auth)/invitation/[code]/page.tsx +7 -0
- package/template/apps/web/src/app/[locale]/(auth)/layout.tsx +9 -0
- package/template/apps/web/src/app/[locale]/(auth)/login/page.tsx +6 -0
- package/template/apps/web/src/app/[locale]/(auth)/logout/page.tsx +5 -0
- package/template/apps/web/src/app/[locale]/(auth)/register/page.tsx +6 -0
- package/template/apps/web/src/app/[locale]/(auth)/reset/[code]/page.tsx +7 -0
- package/template/apps/web/src/app/[locale]/(main)/(foundations)/notifications/page.tsx +9 -0
- package/template/apps/web/src/app/[locale]/(main)/(foundations)/roles/[id]/page.tsx +23 -0
- package/template/apps/web/src/app/[locale]/(main)/(foundations)/roles/page.tsx +12 -0
- package/template/apps/web/src/app/[locale]/(main)/(foundations)/users/[id]/error.tsx +14 -0
- package/template/apps/web/src/app/[locale]/(main)/(foundations)/users/[id]/loading.tsx +21 -0
- package/template/apps/web/src/app/[locale]/(main)/(foundations)/users/[id]/page.tsx +46 -0
- package/template/apps/web/src/app/[locale]/(main)/(foundations)/users/page.tsx +17 -0
- package/template/apps/web/src/app/[locale]/(main)/error.tsx +62 -0
- package/template/apps/web/src/app/[locale]/(main)/layout.tsx +40 -0
- package/template/apps/web/src/app/[locale]/(main)/page.tsx +41 -0
- package/template/apps/web/src/app/[locale]/layout.tsx +54 -0
- package/template/apps/web/src/app/globals.css +256 -0
- package/template/apps/web/src/config/BootstrapProvider.tsx +13 -0
- package/template/apps/web/src/config/Bootstrapper.ts +77 -0
- package/template/apps/web/src/config/env.ts +51 -0
- package/template/apps/web/src/config/middleware-env.ts +14 -0
- package/template/apps/web/src/enums/feature.ids.ts +3 -0
- package/template/apps/web/src/features/common/components/containers/IndexContainer.tsx +11 -0
- package/template/apps/web/src/features/common/components/details/LayoutDetails.tsx +33 -0
- package/template/apps/web/src/features/common/components/navigations/CommonSidebar.tsx +233 -0
- package/template/apps/web/src/features/common/components/navigations/CreationDropDown.tsx +117 -0
- package/template/apps/web/src/features/common/components/navigations/UserSidebarFooter.tsx +115 -0
- package/template/apps/web/src/features/common/components/navigations/VersionDisplay.tsx +18 -0
- package/template/apps/web/src/features/common/contexts/ErrorContext.tsx +62 -0
- package/template/apps/web/src/i18n/request.ts +13 -0
- package/template/apps/web/src/i18n/routing.ts +9 -0
- package/template/apps/web/src/i18n/useDateFnsLocale.ts +15 -0
- package/template/apps/web/src/proxy.ts +107 -0
- package/template/apps/web/src/server-actions/auth-cookies.ts +134 -0
- package/template/apps/web/src/types/modules.d.ts +10 -0
- package/template/apps/web/src/utils/metadata.ts +50 -0
- package/template/apps/web/src/utils/revalidation.ts +7 -0
- package/template/apps/web/tsconfig.json +51 -0
- package/template/docker-compose.yml +211 -0
- package/template/package.json +72 -0
- package/template/packages/nestjs-neo4jsonapi/.gitkeep +0 -0
- package/template/packages/nextjs-jsonapi/.gitkeep +0 -0
- package/template/packages/shared/package.json +23 -0
- package/template/packages/shared/src/const/roles.id.ts +5 -0
- package/template/packages/shared/src/const/system.roles.id.ts +4 -0
- package/template/packages/shared/src/index.ts +1 -0
- package/template/packages/shared/tsconfig.json +10 -0
- package/template/packages/shared/tsup.config.ts +16 -0
- package/template/pnpm-workspace.yaml +3 -0
- package/template/tsconfig.base.json +62 -0
- package/template/tsconfig.json +12 -0
- package/template/turbo.json +88 -0
- package/template/versions.production.json +4 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# Unified Dockerfile for {{name}} Monorepo
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# This Dockerfile builds all services (API, Worker, Web) from a single file,
|
|
5
|
+
# eliminating duplicate builds of the shared package by reusing build stages.
|
|
6
|
+
#
|
|
7
|
+
# Build targets:
|
|
8
|
+
# - api-development: API with hot-reload for development (uses local submodules)
|
|
9
|
+
# - api-production: Optimized API production build (uses npm packages)
|
|
10
|
+
# - web-development: Web with hot-reload for development (uses local submodules)
|
|
11
|
+
# - web-production: Optimized Web production build (uses npm packages)
|
|
12
|
+
#
|
|
13
|
+
# Usage:
|
|
14
|
+
# docker build --target api-production -t api:prod .
|
|
15
|
+
# docker build --target web-production -t web:prod .
|
|
16
|
+
# docker build --target api-development -t api:dev .
|
|
17
|
+
# docker build --target web-development -t web:dev .
|
|
18
|
+
#
|
|
19
|
+
# Benefits:
|
|
20
|
+
# - Shared package (@{{name}}/shared) built ONCE and reused
|
|
21
|
+
# - Faster builds when building multiple services
|
|
22
|
+
# - Better layer caching across services
|
|
23
|
+
# - Consistent base dependencies
|
|
24
|
+
# - Production uses pinned npm versions (versions.production.json)
|
|
25
|
+
# - Development uses local submodules for live editing
|
|
26
|
+
# =============================================================================
|
|
27
|
+
|
|
28
|
+
# =============================================================================
|
|
29
|
+
# BASE STAGE - Common foundation for all services
|
|
30
|
+
# =============================================================================
|
|
31
|
+
FROM node:22-alpine AS base
|
|
32
|
+
|
|
33
|
+
# Install pnpm
|
|
34
|
+
RUN corepack enable && corepack prepare pnpm@10.18.2 --activate
|
|
35
|
+
|
|
36
|
+
# Install build dependencies for native modules (required for sharp + webp)
|
|
37
|
+
RUN apk add --no-cache python3 py3-pip make g++ cairo-dev jpeg-dev pango-dev giflib-dev libwebp-dev \
|
|
38
|
+
tesseract-ocr tesseract-ocr-data-ita graphicsmagick ghostscript
|
|
39
|
+
|
|
40
|
+
WORKDIR /app
|
|
41
|
+
|
|
42
|
+
# =============================================================================
|
|
43
|
+
# WORKSPACE DEPENDENCIES (DEVELOPMENT) - Uses local submodules
|
|
44
|
+
# =============================================================================
|
|
45
|
+
FROM base AS workspace-deps
|
|
46
|
+
|
|
47
|
+
# Copy workspace manifests (minimal set for faster caching)
|
|
48
|
+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
49
|
+
COPY tsconfig.base.json tsconfig.json ./
|
|
50
|
+
COPY packages/shared ./packages/shared/
|
|
51
|
+
COPY packages/nestjs-neo4jsonapi ./packages/nestjs-neo4jsonapi/
|
|
52
|
+
COPY packages/nextjs-jsonapi ./packages/nextjs-jsonapi/
|
|
53
|
+
COPY apps/api ./apps/api/
|
|
54
|
+
COPY apps/web ./apps/web/
|
|
55
|
+
|
|
56
|
+
# Install all dependencies once (including dev deps for build targets)
|
|
57
|
+
RUN pnpm install --frozen-lockfile
|
|
58
|
+
|
|
59
|
+
# =============================================================================
|
|
60
|
+
# SHARED PACKAGE BUILD (DEVELOPMENT) - Built ONCE and reused by dev services
|
|
61
|
+
# =============================================================================
|
|
62
|
+
FROM workspace-deps AS shared-builder
|
|
63
|
+
|
|
64
|
+
WORKDIR /app/packages/shared
|
|
65
|
+
RUN pnpm build
|
|
66
|
+
|
|
67
|
+
# Build nestjs-neo4jsonapi package
|
|
68
|
+
WORKDIR /app/packages/nestjs-neo4jsonapi
|
|
69
|
+
RUN pnpm build
|
|
70
|
+
|
|
71
|
+
# Build nextjs-jsonapi package
|
|
72
|
+
WORKDIR /app/packages/nextjs-jsonapi
|
|
73
|
+
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
|
74
|
+
RUN pnpm build
|
|
75
|
+
|
|
76
|
+
# Return to workspace root for subsequent stages
|
|
77
|
+
WORKDIR /app
|
|
78
|
+
|
|
79
|
+
# =============================================================================
|
|
80
|
+
# API DEVELOPMENT TARGET
|
|
81
|
+
# =============================================================================
|
|
82
|
+
FROM shared-builder AS api-development
|
|
83
|
+
|
|
84
|
+
# Expose port (set via build arg; defaults to 3400 for local compose)
|
|
85
|
+
ARG API_PORT=3400
|
|
86
|
+
EXPOSE ${API_PORT}
|
|
87
|
+
|
|
88
|
+
# Development command (hot reload) - stay in /app to access tsconfig.json
|
|
89
|
+
CMD ["pnpm", "--filter", "{{name}}-api", "run", "dev"]
|
|
90
|
+
|
|
91
|
+
# =============================================================================
|
|
92
|
+
# WEB DEVELOPMENT TARGET
|
|
93
|
+
# =============================================================================
|
|
94
|
+
FROM shared-builder AS web-development
|
|
95
|
+
|
|
96
|
+
# Expose port (set via build arg; defaults to 3401 for local compose)
|
|
97
|
+
ARG PORT=3401
|
|
98
|
+
EXPOSE ${PORT}
|
|
99
|
+
|
|
100
|
+
# Development command (hot reload with Turbopack) - stay in /app to access node_modules
|
|
101
|
+
CMD ["pnpm", "--filter", "{{name}}-web", "run", "dev"]
|
|
102
|
+
|
|
103
|
+
# =============================================================================
|
|
104
|
+
# WORKSPACE DEPENDENCIES (PRODUCTION) - Uses npm packages, not submodules
|
|
105
|
+
# =============================================================================
|
|
106
|
+
FROM base AS workspace-deps-prod
|
|
107
|
+
|
|
108
|
+
# Copy workspace manifests
|
|
109
|
+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
110
|
+
COPY tsconfig.base.json tsconfig.json ./
|
|
111
|
+
COPY versions.production.json ./
|
|
112
|
+
COPY scripts/apply-production-versions.js ./scripts/
|
|
113
|
+
|
|
114
|
+
# Copy only the shared package (still local)
|
|
115
|
+
COPY packages/shared ./packages/shared/
|
|
116
|
+
|
|
117
|
+
# Copy app source
|
|
118
|
+
COPY apps/api ./apps/api/
|
|
119
|
+
COPY apps/web ./apps/web/
|
|
120
|
+
|
|
121
|
+
# Apply production versions (replaces workspace:* with npm versions)
|
|
122
|
+
RUN node scripts/apply-production-versions.js
|
|
123
|
+
|
|
124
|
+
# Remove submodule entries from pnpm-workspace.yaml for production
|
|
125
|
+
RUN sed -i '/nestjs-neo4jsonapi/d; /nextjs-jsonapi/d' pnpm-workspace.yaml
|
|
126
|
+
|
|
127
|
+
# Install dependencies (fetches libraries from npm)
|
|
128
|
+
RUN pnpm install --no-frozen-lockfile
|
|
129
|
+
|
|
130
|
+
# =============================================================================
|
|
131
|
+
# SHARED PACKAGE BUILD (PRODUCTION) - Only builds shared, not submodule packages
|
|
132
|
+
# =============================================================================
|
|
133
|
+
FROM workspace-deps-prod AS shared-builder-prod
|
|
134
|
+
|
|
135
|
+
WORKDIR /app/packages/shared
|
|
136
|
+
RUN pnpm build
|
|
137
|
+
|
|
138
|
+
WORKDIR /app
|
|
139
|
+
|
|
140
|
+
# =============================================================================
|
|
141
|
+
# API BUILDER (production) - Uses npm packages
|
|
142
|
+
# =============================================================================
|
|
143
|
+
FROM shared-builder-prod AS api-builder
|
|
144
|
+
|
|
145
|
+
WORKDIR /app
|
|
146
|
+
RUN pnpm --filter {{name}}-api build
|
|
147
|
+
|
|
148
|
+
# =============================================================================
|
|
149
|
+
# API PRODUCTION TARGET
|
|
150
|
+
# =============================================================================
|
|
151
|
+
FROM node:22-alpine AS api-production
|
|
152
|
+
|
|
153
|
+
# Install runtime dependencies only (no build tools + OCR)
|
|
154
|
+
RUN apk add --no-cache cairo jpeg pango giflib libwebp \
|
|
155
|
+
tesseract-ocr graphicsmagick ghostscript
|
|
156
|
+
|
|
157
|
+
RUN corepack enable && corepack prepare pnpm@10.18.2 --activate
|
|
158
|
+
|
|
159
|
+
WORKDIR /app
|
|
160
|
+
ENV NODE_ENV=production
|
|
161
|
+
|
|
162
|
+
# Copy built files from api-builder
|
|
163
|
+
COPY --from=api-builder /app/package.json /app/pnpm-lock.yaml /app/pnpm-workspace.yaml ./
|
|
164
|
+
COPY --from=api-builder /app/packages/shared ./packages/shared
|
|
165
|
+
COPY --from=api-builder /app/apps/api ./apps/api
|
|
166
|
+
|
|
167
|
+
# Install only production dependencies
|
|
168
|
+
RUN pnpm install --no-frozen-lockfile --prod --ignore-scripts
|
|
169
|
+
|
|
170
|
+
WORKDIR /app/apps/api
|
|
171
|
+
|
|
172
|
+
# Expose port (set via build arg; defaults to 3400 for local compose)
|
|
173
|
+
ARG API_PORT=3400
|
|
174
|
+
EXPOSE ${API_PORT}
|
|
175
|
+
|
|
176
|
+
# Production command (can be overridden for worker mode)
|
|
177
|
+
CMD ["node", "dist/main", "--mode=api"]
|
|
178
|
+
|
|
179
|
+
# =============================================================================
|
|
180
|
+
# WEB BUILDER (production) - Uses npm packages
|
|
181
|
+
# =============================================================================
|
|
182
|
+
FROM shared-builder-prod AS web-builder
|
|
183
|
+
|
|
184
|
+
WORKDIR /app
|
|
185
|
+
|
|
186
|
+
# Accept build arguments for Next.js public env vars
|
|
187
|
+
ARG NEXT_PUBLIC_API_URL
|
|
188
|
+
ARG NEXT_PUBLIC_ADDRESS
|
|
189
|
+
ARG NEXT_PUBLIC_VAPID_PUBLIC_KEY
|
|
190
|
+
|
|
191
|
+
# Set them as environment variables for the build
|
|
192
|
+
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
|
193
|
+
ENV NEXT_PUBLIC_ADDRESS=${NEXT_PUBLIC_ADDRESS}
|
|
194
|
+
ENV NEXT_PUBLIC_VAPID_PUBLIC_KEY=${NEXT_PUBLIC_VAPID_PUBLIC_KEY}
|
|
195
|
+
ENV NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=${NEXT_PUBLIC_GOOGLE_MAPS_API_KEY}
|
|
196
|
+
|
|
197
|
+
RUN pnpm --filter {{name}}-web build
|
|
198
|
+
|
|
199
|
+
# =============================================================================
|
|
200
|
+
# WEB PRODUCTION TARGET
|
|
201
|
+
# =============================================================================
|
|
202
|
+
FROM node:22-alpine AS web-production
|
|
203
|
+
|
|
204
|
+
# Install runtime dependencies for Next.js image optimization (sharp)
|
|
205
|
+
RUN apk add --no-cache cairo jpeg pango giflib libwebp
|
|
206
|
+
|
|
207
|
+
# Install pnpm for runtime scripts
|
|
208
|
+
RUN corepack enable && corepack prepare pnpm@10.18.2 --activate
|
|
209
|
+
|
|
210
|
+
WORKDIR /app
|
|
211
|
+
ENV NODE_ENV=production
|
|
212
|
+
|
|
213
|
+
# Copy built files from web-builder
|
|
214
|
+
COPY --from=web-builder /app/package.json /app/pnpm-lock.yaml /app/pnpm-workspace.yaml ./
|
|
215
|
+
COPY --from=web-builder /app/packages/shared ./packages/shared
|
|
216
|
+
COPY --from=web-builder /app/apps/web ./apps/web
|
|
217
|
+
|
|
218
|
+
# Install only production dependencies
|
|
219
|
+
RUN pnpm install --no-frozen-lockfile --prod --ignore-scripts
|
|
220
|
+
|
|
221
|
+
WORKDIR /app/apps/web
|
|
222
|
+
|
|
223
|
+
# Expose port (set via build arg; defaults to 3401 for local compose)
|
|
224
|
+
ARG PORT=3401
|
|
225
|
+
EXPOSE ${PORT}
|
|
226
|
+
|
|
227
|
+
# Production command
|
|
228
|
+
CMD ["pnpm", "--filter", "{{name}}-web", "run", "start"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# {{name}}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
2
|
+
import js from "@eslint/js";
|
|
3
|
+
import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin";
|
|
4
|
+
import tsParser from "@typescript-eslint/parser";
|
|
5
|
+
import globals from "globals";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
const compat = new FlatCompat({
|
|
12
|
+
baseDirectory: __dirname,
|
|
13
|
+
recommendedConfig: js.configs.recommended,
|
|
14
|
+
allConfig: js.configs.all,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export default [
|
|
18
|
+
{
|
|
19
|
+
ignores: ["**/eslint.config.mjs", "dist/**/*"],
|
|
20
|
+
},
|
|
21
|
+
...compat.extends("plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"),
|
|
22
|
+
{
|
|
23
|
+
plugins: {
|
|
24
|
+
"@typescript-eslint": typescriptEslintEslintPlugin,
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
languageOptions: {
|
|
28
|
+
globals: {
|
|
29
|
+
...globals.node,
|
|
30
|
+
...globals.jest,
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
parser: tsParser,
|
|
34
|
+
ecmaVersion: 5,
|
|
35
|
+
sourceType: "module",
|
|
36
|
+
|
|
37
|
+
parserOptions: {
|
|
38
|
+
project: path.resolve(__dirname, "tsconfig.json"),
|
|
39
|
+
tsconfigRootDir: path.resolve(__dirname),
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
rules: {
|
|
44
|
+
"@typescript-eslint/interface-name-prefix": "off",
|
|
45
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
46
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
47
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
48
|
+
"@typescript-eslint/no-var-requires": "off",
|
|
49
|
+
"@typescript-eslint/no-require-imports": "off",
|
|
50
|
+
"@typescript-eslint/no-empty-object-type": "off",
|
|
51
|
+
"@typescript-eslint/no-unused-expressions": "off",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
preset: 'ts-jest',
|
|
3
|
+
testEnvironment: 'node',
|
|
4
|
+
moduleFileExtensions: ['ts', 'js', 'json'],
|
|
5
|
+
rootDir: '.',
|
|
6
|
+
testRegex: 'src/.*\\.spec\\.ts$',
|
|
7
|
+
transform: {
|
|
8
|
+
'^.+\\.ts$': [
|
|
9
|
+
'ts-jest',
|
|
10
|
+
{
|
|
11
|
+
tsconfig: {
|
|
12
|
+
baseUrl: '.',
|
|
13
|
+
paths: {
|
|
14
|
+
'src/*': ['src/*']
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
collectCoverageFrom: ['src/**/*.(t|j)s'],
|
|
21
|
+
coverageDirectory: './coverage',
|
|
22
|
+
moduleNameMapper: {
|
|
23
|
+
'^src/(.*)$': '<rootDir>/src/$1'
|
|
24
|
+
},
|
|
25
|
+
moduleDirectories: ['node_modules', '<rootDir>'],
|
|
26
|
+
testTimeout: 30000,
|
|
27
|
+
setupFilesAfterEnv: [],
|
|
28
|
+
verbose: true
|
|
29
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/nest-cli",
|
|
3
|
+
"collection": "@nestjs/schematics",
|
|
4
|
+
"sourceRoot": "src",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"deleteOutDir": true,
|
|
7
|
+
"assets": [
|
|
8
|
+
{
|
|
9
|
+
"include": "i18n/**/*.json",
|
|
10
|
+
"outDir": "./dist",
|
|
11
|
+
"watchAssets": true
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "",
|
|
3
|
+
"dependencies": {
|
|
4
|
+
"@carlonicora/nestjs-neo4jsonapi": "1.2.0",
|
|
5
|
+
"@aws-sdk/client-s3": "^3.948.0",
|
|
6
|
+
"@aws-sdk/s3-request-presigner": "^3.948.0",
|
|
7
|
+
"@azure/msal-node": "^3.8.4",
|
|
8
|
+
"@azure/openai": "^2.0.0",
|
|
9
|
+
"@azure/storage-blob": "^12.29.1",
|
|
10
|
+
"@fastify/multipart": "^9.3.0",
|
|
11
|
+
"@fastify/static": "^8.3.0",
|
|
12
|
+
"@fastify/swagger": "^9.6.1",
|
|
13
|
+
"@getbrevo/brevo": "^3.0.1",
|
|
14
|
+
"@langchain/aws": "^1.1.0",
|
|
15
|
+
"@langchain/community": "^1.0.7",
|
|
16
|
+
"@langchain/core": "^1.1.4",
|
|
17
|
+
"@langchain/langgraph": "^1.0.4",
|
|
18
|
+
"@langchain/ollama": "^1.0.3",
|
|
19
|
+
"@langchain/openai": "^1.1.3",
|
|
20
|
+
"@langchain/textsplitters": "^1.0.1",
|
|
21
|
+
"@microsoft/microsoft-graph-client": "^3.0.7",
|
|
22
|
+
"@microsoft/microsoft-graph-types": "^2.43.1",
|
|
23
|
+
"@nestjs/bullmq": "^11.0.4",
|
|
24
|
+
"@nestjs/cli": "^11.0.14",
|
|
25
|
+
"@nestjs/common": "^11.1.9",
|
|
26
|
+
"@nestjs/config": "^4.0.2",
|
|
27
|
+
"@nestjs/core": "^11.1.9",
|
|
28
|
+
"@nestjs/event-emitter": "^3.0.1",
|
|
29
|
+
"@nestjs/jwt": "^11.0.2",
|
|
30
|
+
"@nestjs/microservices": "^11.1.9",
|
|
31
|
+
"@nestjs/passport": "^11.0.5",
|
|
32
|
+
"@nestjs/platform-fastify": "^11.1.9",
|
|
33
|
+
"@nestjs/platform-socket.io": "^11.1.9",
|
|
34
|
+
"@nestjs/schedule": "^6.1.0",
|
|
35
|
+
"@nestjs/swagger": "^11.2.3",
|
|
36
|
+
"@nestjs/throttler": "^6.5.0",
|
|
37
|
+
"@nestjs/websockets": "^11.1.9",
|
|
38
|
+
"@opentelemetry/api": "^1.9.0",
|
|
39
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.208.0",
|
|
40
|
+
"@opentelemetry/instrumentation-fastify": "^0.53.0",
|
|
41
|
+
"@opentelemetry/instrumentation-http": "^0.208.0",
|
|
42
|
+
"@opentelemetry/instrumentation-nestjs-core": "^0.55.0",
|
|
43
|
+
"@opentelemetry/resources": "^2.2.0",
|
|
44
|
+
"@opentelemetry/sdk-node": "^0.208.0",
|
|
45
|
+
"@opentelemetry/semantic-conventions": "^1.38.0",
|
|
46
|
+
"@{{name}}/shared": "workspace:*",
|
|
47
|
+
"@sendgrid/mail": "^8.1.6",
|
|
48
|
+
"adm-zip": "^0.5.16",
|
|
49
|
+
"async": "^3.2.6",
|
|
50
|
+
"axios": "^1.13.2",
|
|
51
|
+
"bcryptjs": "^3.0.3",
|
|
52
|
+
"bullmq": "^5.66.0",
|
|
53
|
+
"cheerio": "^1.1.2",
|
|
54
|
+
"class-transformer": "^0.5.1",
|
|
55
|
+
"class-validator": "^0.14.3",
|
|
56
|
+
"dotenv": "^17.2.3",
|
|
57
|
+
"fast-xml-parser": "^5.3.3",
|
|
58
|
+
"fastify": "^5.6.2",
|
|
59
|
+
"handlebars": "^4.7.8",
|
|
60
|
+
"ioredis": "^5.8.2",
|
|
61
|
+
"jsdom": "^27.3.0",
|
|
62
|
+
"jszip": "^3.10.1",
|
|
63
|
+
"langchain": "^1.1.5",
|
|
64
|
+
"lodash": "^4.17.21",
|
|
65
|
+
"marked": "^17.0.1",
|
|
66
|
+
"mathjs": "^15.1.0",
|
|
67
|
+
"mime-types": "^3.0.2",
|
|
68
|
+
"natural": "^8.1.0",
|
|
69
|
+
"neo4j-driver": "^6.0.1",
|
|
70
|
+
"nestjs-cls": "^6.1.0",
|
|
71
|
+
"nestjs-i18n": "^10.6.0",
|
|
72
|
+
"node-tesseract-ocr": "^2.2.1",
|
|
73
|
+
"nodemailer": "^7.0.11",
|
|
74
|
+
"officeparser": "^5.2.2",
|
|
75
|
+
"openai": "^6.10.0",
|
|
76
|
+
"passport": "^0.7.0",
|
|
77
|
+
"passport-jwt": "^4.0.1",
|
|
78
|
+
"pdf-parse": "^2.4.5",
|
|
79
|
+
"pdf2pic": "^3.2.0",
|
|
80
|
+
"pdfjs-dist": "^5.4.449",
|
|
81
|
+
"pino": "^10.1.0",
|
|
82
|
+
"pino-loki": "^2.6.0",
|
|
83
|
+
"pino-pretty": "^13.1.3",
|
|
84
|
+
"pino-roll": "^4.0.0",
|
|
85
|
+
"qs": "^6.14.0",
|
|
86
|
+
"reflect-metadata": "^0.2.2",
|
|
87
|
+
"rrule": "^2.8.1",
|
|
88
|
+
"rxjs": "^7.8.2",
|
|
89
|
+
"sharp": "^0.34.5",
|
|
90
|
+
"socket.io": "^4.8.1",
|
|
91
|
+
"tslib": "^2.8.1",
|
|
92
|
+
"turndown": "^7.2.2",
|
|
93
|
+
"uuid": "^13.0.0",
|
|
94
|
+
"web-push": "^3.6.7",
|
|
95
|
+
"windows-iana": "^5.1.0",
|
|
96
|
+
"xlsx-republish": "^0.20.3",
|
|
97
|
+
"zod-to-json-schema": "^3.25.0"
|
|
98
|
+
},
|
|
99
|
+
"description": "",
|
|
100
|
+
"devDependencies": {
|
|
101
|
+
"@eslint/js": "^9.39.1",
|
|
102
|
+
"@nestjs/schematics": "^11.0.9",
|
|
103
|
+
"@nestjs/testing": "^11.1.9",
|
|
104
|
+
"@types/jest": "^30.0.0",
|
|
105
|
+
"@types/jsdom": "^27.0.0",
|
|
106
|
+
"@types/microsoft-graph": "^2.40.1",
|
|
107
|
+
"@types/supertest": "^6.0.3",
|
|
108
|
+
"@types/web-push": "^3.6.4",
|
|
109
|
+
"@typescript-eslint/eslint-plugin": "^8.49.0",
|
|
110
|
+
"@typescript-eslint/parser": "^8.49.0",
|
|
111
|
+
"commander": "^14.0.2",
|
|
112
|
+
"esbuild": "^0.27.1",
|
|
113
|
+
"eslint": "^9.39.1",
|
|
114
|
+
"eslint-config-prettier": "^10.1.8",
|
|
115
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
116
|
+
"glob": "^13.0.0",
|
|
117
|
+
"globals": "^16.5.0",
|
|
118
|
+
"jest": "^30.2.0",
|
|
119
|
+
"nodemon": "^3.1.11",
|
|
120
|
+
"source-map-support": "^0.5.21",
|
|
121
|
+
"supertest": "^7.1.4",
|
|
122
|
+
"testcontainers": "^11.10.0",
|
|
123
|
+
"ts-jest": "^29.4.6",
|
|
124
|
+
"ts-loader": "^9.5.4",
|
|
125
|
+
"ts-node": "^10.9.2",
|
|
126
|
+
"tsconfig-paths": "^4.2.0"
|
|
127
|
+
},
|
|
128
|
+
"engines": {
|
|
129
|
+
"node": "22"
|
|
130
|
+
},
|
|
131
|
+
"license": "UNLICENSED",
|
|
132
|
+
"name": "{{name}}-api",
|
|
133
|
+
"private": true,
|
|
134
|
+
"scripts": {
|
|
135
|
+
"build": "nest build",
|
|
136
|
+
"dev": "nodemon --watch src --ext ts --exec \"ts-node -r tsconfig-paths/register src/main.ts --mode=api\"",
|
|
137
|
+
"dev:worker": "nodemon --watch src --ext ts --exec \"ts-node -r tsconfig-paths/register src/main.ts --mode=worker\"",
|
|
138
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
139
|
+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
|
140
|
+
"start": "nest start --mode=api",
|
|
141
|
+
"start:debug": "nest start --debug --watch",
|
|
142
|
+
"start:dev": "nodemon --watch src --ext ts --exec \"ts-node -r tsconfig-paths/register src/main.ts --mode=api\"",
|
|
143
|
+
"start:prod": "node --max-old-space-size=6144 dist/main --mode=api",
|
|
144
|
+
"start:worker": "nest start --mode=worker",
|
|
145
|
+
"start:worker:dev": "nodemon --watch src --ext ts --exec \"ts-node -r tsconfig-paths/register src/main.ts --mode=worker\"",
|
|
146
|
+
"start:worker:prod": "node --max-old-space-size=6144 dist/main --mode=worker",
|
|
147
|
+
"test": "jest",
|
|
148
|
+
"test:cov": "jest --coverage",
|
|
149
|
+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
150
|
+
"test:e2e": "jest --config ./test/jest-e2e.json --verbose=false --noStackTrace",
|
|
151
|
+
"test:e2e:debug": "jest --config ./test/jest-e2e.json",
|
|
152
|
+
"test:watch": "jest --watch"
|
|
153
|
+
},
|
|
154
|
+
"version": "1.0.0"
|
|
155
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { baseConfig } from "@carlonicora/nestjs-neo4jsonapi";
|
|
2
|
+
import { JobName } from "src/config/enums/job.name";
|
|
3
|
+
import { QueueId } from "src/config/enums/queue.id";
|
|
4
|
+
import { ConfigInterface } from "src/config/interfaces/config.interface";
|
|
5
|
+
|
|
6
|
+
export default (): ConfigInterface => {
|
|
7
|
+
return {
|
|
8
|
+
...baseConfig,
|
|
9
|
+
chunkQueues: {
|
|
10
|
+
queueIds: Object.values(QueueId),
|
|
11
|
+
},
|
|
12
|
+
contentTypes: {
|
|
13
|
+
types: [],
|
|
14
|
+
},
|
|
15
|
+
jobNames: JobName,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as dotenv from "dotenv";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
|
|
4
|
+
// Load environment variables FIRST (before any library imports)
|
|
5
|
+
dotenv.config({ path: path.resolve(__dirname, "../../../.env") });
|
|
6
|
+
|
|
7
|
+
import { bootstrap } from "@carlonicora/nestjs-neo4jsonapi";
|
|
8
|
+
|
|
9
|
+
import config from "src/config/config";
|
|
10
|
+
import { FeaturesModules } from "./features/features.modules";
|
|
11
|
+
|
|
12
|
+
// Queue configuration is now via baseConfig.chunkQueues in config/config.ts
|
|
13
|
+
bootstrap({
|
|
14
|
+
appModules: [FeaturesModules],
|
|
15
|
+
i18n: {
|
|
16
|
+
fallbackLanguage: "en",
|
|
17
|
+
path: path.join(__dirname, "i18n"),
|
|
18
|
+
},
|
|
19
|
+
config: config,
|
|
20
|
+
contentExtension: {
|
|
21
|
+
additionalRelationships: [],
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This migration creates the initial set of features in the database.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MigrationInterface } from "@carlonicora/nestjs-neo4jsonapi";
|
|
6
|
+
import { featureQuery, roleQuery } from "src/neo4j.migrations/queries/migration.queries";
|
|
7
|
+
|
|
8
|
+
export const migration: MigrationInterface[] = [
|
|
9
|
+
{
|
|
10
|
+
query: roleQuery,
|
|
11
|
+
queryParams: {
|
|
12
|
+
roleId: "53394cb8-1e87-11ef-8b48-bed54b8f8aba",
|
|
13
|
+
roleName: "Administrators",
|
|
14
|
+
isSelectable: false,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
query: roleQuery,
|
|
19
|
+
queryParams: {
|
|
20
|
+
roleId: "2e1eee00-6cba-4506-9059-ccd24e4ea5b0",
|
|
21
|
+
roleName: "Company Administrator",
|
|
22
|
+
isSelectable: true,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
query: featureQuery,
|
|
27
|
+
queryParams: {
|
|
28
|
+
featureId: "17036fb0-060b-4c83-a617-f32259819783",
|
|
29
|
+
featureName: "Common",
|
|
30
|
+
isProduction: true,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
];
|