create-forgeon 0.1.2 → 0.1.6
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 +19 -17
- package/bin/create-forgeon.mjs +22 -22
- package/package.json +1 -1
- package/src/cli/add-help.mjs +12 -12
- package/src/cli/add-options.mjs +54 -54
- package/src/cli/add-options.test.mjs +24 -24
- package/src/cli/help.mjs +20 -20
- package/src/cli/options.mjs +121 -121
- package/src/cli/options.test.mjs +41 -41
- package/src/cli/prompt-select.mjs +94 -94
- package/src/cli/prompt-select.test.mjs +148 -148
- package/src/constants.mjs +13 -13
- package/src/core/docs.mjs +128 -128
- package/src/core/docs.test.mjs +91 -91
- package/src/core/install.mjs +14 -14
- package/src/core/scaffold.mjs +48 -45
- package/src/core/validate.mjs +12 -12
- package/src/core/validate.test.mjs +73 -73
- package/src/databases/index.mjs +26 -26
- package/src/frameworks/index.mjs +32 -32
- package/src/infrastructure/proxy.mjs +12 -12
- package/src/modules/docs.mjs +70 -70
- package/src/modules/executor.mjs +39 -21
- package/src/modules/executor.test.mjs +95 -45
- package/src/modules/i18n.mjs +283 -0
- package/src/modules/registry.mjs +43 -35
- package/src/presets/i18n.mjs +228 -180
- package/src/presets/index.mjs +2 -2
- package/src/presets/proxy.mjs +32 -32
- package/src/run-add-module.mjs +47 -47
- package/src/run-create-forgeon.mjs +72 -72
- package/src/utils/fs.mjs +26 -26
- package/src/utils/values.mjs +20 -20
- package/templates/base/.dockerignore +7 -7
- package/templates/base/.editorconfig +11 -11
- package/templates/base/README.md +46 -46
- package/templates/base/apps/api/Dockerfile +24 -24
- package/templates/base/apps/api/package.json +39 -39
- package/templates/base/apps/api/prisma/migrations/0001_init/migration.sql +11 -11
- package/templates/base/apps/api/prisma/schema.prisma +14 -14
- package/templates/base/apps/api/prisma/seed.ts +19 -19
- package/templates/base/apps/api/src/app.module.ts +32 -32
- package/templates/base/apps/api/src/common/dto/echo-query.dto.ts +5 -5
- package/templates/base/apps/api/src/common/filters/app-exception.filter.ts +129 -129
- package/templates/base/apps/api/src/config/app.config.ts +12 -12
- package/templates/base/apps/api/src/health/health.controller.ts +30 -30
- package/templates/base/apps/api/src/main.ts +25 -25
- package/templates/base/apps/api/src/prisma/prisma.module.ts +8 -8
- package/templates/base/apps/api/src/prisma/prisma.service.ts +26 -26
- package/templates/base/apps/api/tsconfig.build.json +8 -8
- package/templates/base/apps/api/tsconfig.json +8 -8
- package/templates/base/apps/web/Dockerfile +12 -12
- package/templates/base/apps/web/index.html +11 -11
- package/templates/base/apps/web/package.json +21 -21
- package/templates/base/apps/web/src/App.tsx +35 -35
- package/templates/base/apps/web/src/main.tsx +8 -8
- package/templates/base/apps/web/src/styles.css +32 -32
- package/templates/base/apps/web/tsconfig.json +17 -17
- package/templates/base/apps/web/vite.config.ts +14 -14
- package/templates/base/docs/AI/ARCHITECTURE.md +37 -37
- package/templates/base/docs/AI/MODULE_SPEC.md +56 -56
- package/templates/base/docs/AI/PROJECT.md +31 -31
- package/templates/base/docs/AI/TASKS.md +57 -57
- package/templates/base/docs/README.md +6 -6
- package/templates/base/infra/caddy/Caddyfile +15 -15
- package/templates/base/infra/docker/.env.example +9 -9
- package/templates/base/infra/docker/caddy.Dockerfile +15 -15
- package/templates/base/infra/docker/compose.caddy.yml +44 -44
- package/templates/base/infra/docker/compose.nginx.yml +44 -44
- package/templates/base/infra/docker/compose.none.yml +37 -37
- package/templates/base/infra/docker/compose.yml +44 -44
- package/templates/base/infra/docker/nginx.Dockerfile +15 -15
- package/templates/base/infra/nginx/nginx.conf +31 -31
- package/templates/base/package.json +23 -23
- package/templates/base/packages/core/README.md +2 -2
- package/templates/base/packages/core/package.json +13 -13
- package/templates/base/packages/core/tsconfig.json +7 -7
- package/templates/base/packages/i18n/package.json +18 -18
- package/templates/base/packages/i18n/src/forgeon-i18n.module.ts +45 -45
- package/templates/base/packages/i18n/tsconfig.json +8 -8
- package/templates/base/pnpm-workspace.yaml +2 -2
- package/templates/base/resources/i18n/en/common.json +4 -4
- package/templates/base/resources/i18n/en/validation.json +2 -2
- package/templates/base/resources/i18n/uk/common.json +4 -4
- package/templates/base/resources/i18n/uk/validation.json +2 -2
- package/templates/base/tsconfig.base.json +16 -16
- package/templates/docs-fragments/AI_ARCHITECTURE/00_title.md +1 -1
- package/templates/docs-fragments/AI_ARCHITECTURE/10_layout_base.md +6 -6
- package/templates/docs-fragments/AI_ARCHITECTURE/11_layout_infra.md +1 -1
- package/templates/docs-fragments/AI_ARCHITECTURE/12_layout_i18n_resources.md +1 -1
- package/templates/docs-fragments/AI_ARCHITECTURE/20_env_base.md +4 -4
- package/templates/docs-fragments/AI_ARCHITECTURE/21_env_i18n.md +3 -3
- package/templates/docs-fragments/AI_ARCHITECTURE/30_default_db.md +7 -7
- package/templates/docs-fragments/AI_ARCHITECTURE/31_docker_runtime.md +5 -5
- package/templates/docs-fragments/AI_ARCHITECTURE/32_scope_freeze.md +5 -5
- package/templates/docs-fragments/AI_ARCHITECTURE/40_docs_generation.md +9 -9
- package/templates/docs-fragments/AI_ARCHITECTURE/50_extension_points.md +8 -8
- package/templates/docs-fragments/AI_PROJECT/00_title.md +1 -1
- package/templates/docs-fragments/AI_PROJECT/10_what_is.md +3 -3
- package/templates/docs-fragments/AI_PROJECT/20_structure_base.md +5 -5
- package/templates/docs-fragments/AI_PROJECT/21_structure_i18n.md +2 -0
- package/templates/docs-fragments/AI_PROJECT/22_structure_docker.md +1 -1
- package/templates/docs-fragments/AI_PROJECT/23_structure_docs.md +1 -1
- package/templates/docs-fragments/AI_PROJECT/30_run_dev.md +8 -8
- package/templates/docs-fragments/AI_PROJECT/31_run_docker.md +5 -5
- package/templates/docs-fragments/AI_PROJECT/32_proxy_notes.md +5 -5
- package/templates/docs-fragments/AI_PROJECT/32_proxy_notes_none.md +5 -5
- package/templates/docs-fragments/AI_PROJECT/33_i18n_notes.md +2 -0
- package/templates/docs-fragments/AI_PROJECT/40_change_boundaries_base.md +3 -3
- package/templates/docs-fragments/AI_PROJECT/41_change_boundaries_docker.md +1 -1
- package/templates/docs-fragments/README/00_title.md +3 -3
- package/templates/docs-fragments/README/10_stack.md +8 -8
- package/templates/docs-fragments/README/20_quick_start_dev_intro.md +6 -6
- package/templates/docs-fragments/README/21_quick_start_dev_db_docker.md +4 -4
- package/templates/docs-fragments/README/21_quick_start_dev_db_local.md +1 -1
- package/templates/docs-fragments/README/22_quick_start_dev_outro.md +7 -7
- package/templates/docs-fragments/README/30_quick_start_docker.md +7 -7
- package/templates/docs-fragments/README/30_quick_start_docker_none.md +9 -9
- package/templates/docs-fragments/README/31_proxy_preset_caddy.md +9 -9
- package/templates/docs-fragments/README/31_proxy_preset_nginx.md +8 -8
- package/templates/docs-fragments/README/31_proxy_preset_none.md +6 -6
- package/templates/docs-fragments/README/32_prisma_container_start.md +5 -5
- package/templates/docs-fragments/README/40_i18n.md +14 -8
- package/templates/docs-fragments/README/90_next_steps.md +7 -7
- package/templates/module-fragments/i18n/00_title.md +5 -0
- package/templates/module-fragments/i18n/10_overview.md +9 -0
- package/templates/module-fragments/i18n/20_scope.md +7 -0
- package/templates/module-fragments/i18n/90_status_implemented.md +3 -0
- package/templates/module-fragments/jwt-auth/00_title.md +1 -1
- package/templates/module-fragments/jwt-auth/10_overview.md +6 -6
- package/templates/module-fragments/jwt-auth/20_scope.md +7 -7
- package/templates/module-fragments/jwt-auth/90_status_planned.md +3 -3
- package/templates/module-fragments/queue/00_title.md +1 -1
- package/templates/module-fragments/queue/10_overview.md +6 -6
- package/templates/module-fragments/queue/20_scope.md +7 -7
- package/templates/module-fragments/queue/90_status_planned.md +3 -3
- package/templates/module-presets/i18n/apps/web/src/App.tsx +61 -0
- package/templates/module-presets/i18n/packages/i18n-contracts/package.json +14 -0
- package/templates/module-presets/i18n/packages/i18n-contracts/src/index.ts +7 -0
- package/templates/module-presets/i18n/packages/i18n-contracts/tsconfig.json +8 -0
- package/templates/module-presets/i18n/packages/i18n-web/package.json +17 -0
- package/templates/module-presets/i18n/packages/i18n-web/src/index.ts +50 -0
- package/templates/module-presets/i18n/packages/i18n-web/tsconfig.json +8 -0
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { DynamicModule, Module } from '@nestjs/common';
|
|
2
|
-
import {
|
|
3
|
-
AcceptLanguageResolver,
|
|
4
|
-
I18nJsonLoader,
|
|
5
|
-
I18nModule,
|
|
6
|
-
QueryResolver,
|
|
7
|
-
} from 'nestjs-i18n';
|
|
8
|
-
import { join } from 'path';
|
|
9
|
-
|
|
10
|
-
export interface ForgeonI18nOptions {
|
|
11
|
-
enabled: boolean;
|
|
12
|
-
defaultLang: string;
|
|
13
|
-
fallbackLang: string;
|
|
14
|
-
path?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@Module({})
|
|
18
|
-
export class ForgeonI18nModule {
|
|
19
|
-
static register(options: ForgeonI18nOptions): DynamicModule {
|
|
20
|
-
if (!options.enabled) {
|
|
21
|
-
return { module: ForgeonI18nModule };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const translationsPath =
|
|
25
|
-
options.path ?? join(process.cwd(), 'resources', 'i18n');
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
module: ForgeonI18nModule,
|
|
29
|
-
imports: [
|
|
30
|
-
I18nModule.forRoot({
|
|
31
|
-
fallbackLanguage: options.fallbackLang,
|
|
32
|
-
loader: I18nJsonLoader,
|
|
33
|
-
loaderOptions: {
|
|
34
|
-
path: translationsPath,
|
|
35
|
-
watch: false,
|
|
36
|
-
},
|
|
37
|
-
resolvers: [
|
|
38
|
-
{ use: AcceptLanguageResolver, options: { matchType: 'strict-loose' } },
|
|
39
|
-
{ use: QueryResolver, options: ['lang'] },
|
|
40
|
-
],
|
|
41
|
-
}),
|
|
42
|
-
],
|
|
43
|
-
exports: [I18nModule],
|
|
44
|
-
};
|
|
45
|
-
}
|
|
1
|
+
import { DynamicModule, Module } from '@nestjs/common';
|
|
2
|
+
import {
|
|
3
|
+
AcceptLanguageResolver,
|
|
4
|
+
I18nJsonLoader,
|
|
5
|
+
I18nModule,
|
|
6
|
+
QueryResolver,
|
|
7
|
+
} from 'nestjs-i18n';
|
|
8
|
+
import { join } from 'path';
|
|
9
|
+
|
|
10
|
+
export interface ForgeonI18nOptions {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
defaultLang: string;
|
|
13
|
+
fallbackLang: string;
|
|
14
|
+
path?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@Module({})
|
|
18
|
+
export class ForgeonI18nModule {
|
|
19
|
+
static register(options: ForgeonI18nOptions): DynamicModule {
|
|
20
|
+
if (!options.enabled) {
|
|
21
|
+
return { module: ForgeonI18nModule };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const translationsPath =
|
|
25
|
+
options.path ?? join(process.cwd(), 'resources', 'i18n');
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
module: ForgeonI18nModule,
|
|
29
|
+
imports: [
|
|
30
|
+
I18nModule.forRoot({
|
|
31
|
+
fallbackLanguage: options.fallbackLang,
|
|
32
|
+
loader: I18nJsonLoader,
|
|
33
|
+
loaderOptions: {
|
|
34
|
+
path: translationsPath,
|
|
35
|
+
watch: false,
|
|
36
|
+
},
|
|
37
|
+
resolvers: [
|
|
38
|
+
{ use: AcceptLanguageResolver, options: { matchType: 'strict-loose' } },
|
|
39
|
+
{ use: QueryResolver, options: ['lang'] },
|
|
40
|
+
],
|
|
41
|
+
}),
|
|
42
|
+
],
|
|
43
|
+
exports: [I18nModule],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"rootDir": "src",
|
|
5
|
-
"outDir": "dist",
|
|
6
|
-
"types": ["node"]
|
|
7
|
-
},
|
|
8
|
-
"include": ["src/**/*.ts"]
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": "src",
|
|
5
|
+
"outDir": "dist",
|
|
6
|
+
"types": ["node"]
|
|
7
|
+
},
|
|
8
|
+
"include": ["src/**/*.ts"]
|
|
9
9
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
packages:
|
|
2
|
-
- apps/*
|
|
1
|
+
packages:
|
|
2
|
+
- apps/*
|
|
3
3
|
- packages/*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"errors.accessDenied": "Access denied",
|
|
3
|
-
"errors.notFound": "Resource not found",
|
|
4
|
-
"common.ok": "OK"
|
|
1
|
+
{
|
|
2
|
+
"errors.accessDenied": "Access denied",
|
|
3
|
+
"errors.notFound": "Resource not found",
|
|
4
|
+
"common.ok": "OK"
|
|
5
5
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"validation.required": "Field is required"
|
|
1
|
+
{
|
|
2
|
+
"validation.required": "Field is required"
|
|
3
3
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"errors.accessDenied": "Доступ заборонено",
|
|
3
|
-
"errors.notFound": "Ресурс не знайдено",
|
|
4
|
-
"common.ok": "OK"
|
|
1
|
+
{
|
|
2
|
+
"errors.accessDenied": "Доступ заборонено",
|
|
3
|
+
"errors.notFound": "Ресурс не знайдено",
|
|
4
|
+
"common.ok": "OK"
|
|
5
5
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"validation.required": "Поле є обов'язковим"
|
|
1
|
+
{
|
|
2
|
+
"validation.required": "Поле є обов'язковим"
|
|
3
3
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"experimentalDecorators": true,
|
|
9
|
-
"emitDecoratorMetadata": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"declaration": true,
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"outDir": "dist"
|
|
16
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
"emitDecoratorMetadata": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"outDir": "dist"
|
|
16
|
+
}
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
# ARCHITECTURE
|
|
1
|
+
# ARCHITECTURE
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
## Monorepo Layout
|
|
2
|
-
|
|
3
|
-
- `apps/*` - deployable apps
|
|
4
|
-
- `packages/*` - reusable modules and presets
|
|
5
|
-
|
|
6
|
-
Canonical stack is fixed for now: NestJS API + React web + Prisma/Postgres + Docker.
|
|
1
|
+
## Monorepo Layout
|
|
2
|
+
|
|
3
|
+
- `apps/*` - deployable apps
|
|
4
|
+
- `packages/*` - reusable modules and presets
|
|
5
|
+
|
|
6
|
+
Canonical stack is fixed for now: NestJS API + React web + Prisma/Postgres + Docker.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
- `infra/*` - runtime infrastructure (compose, proxy, env examples)
|
|
1
|
+
- `infra/*` - runtime infrastructure (compose, proxy, env examples)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
- `resources/*` - static assets (includes translation dictionaries when i18n is enabled)
|
|
1
|
+
- `resources/*` - static assets (includes translation dictionaries when i18n is enabled)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## Environment Flags
|
|
2
|
-
|
|
3
|
-
- `PORT` - API port (default 3000)
|
|
4
|
-
- `DATABASE_URL` - DB connection string for Prisma
|
|
1
|
+
## Environment Flags
|
|
2
|
+
|
|
3
|
+
- `PORT` - API port (default 3000)
|
|
4
|
+
- `DATABASE_URL` - DB connection string for Prisma
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
- `I18N_ENABLED` - toggles i18n package wiring
|
|
2
|
-
- `I18N_DEFAULT_LANG` - default language
|
|
3
|
-
- `I18N_FALLBACK_LANG` - fallback language
|
|
1
|
+
- `I18N_ENABLED` - toggles i18n package wiring
|
|
2
|
+
- `I18N_DEFAULT_LANG` - default language
|
|
3
|
+
- `I18N_FALLBACK_LANG` - fallback language
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
## Default DB Stack
|
|
2
|
-
|
|
3
|
-
Current default stack is `{{DB_LABEL}}`.
|
|
4
|
-
|
|
5
|
-
- Prisma schema and migrations live in `apps/api/prisma`
|
|
6
|
-
- DB access is encapsulated via `PrismaModule` (`apps/api/src/prisma`)
|
|
7
|
-
- Additional DB presets are intentionally out of scope for the current milestone.
|
|
1
|
+
## Default DB Stack
|
|
2
|
+
|
|
3
|
+
Current default stack is `{{DB_LABEL}}`.
|
|
4
|
+
|
|
5
|
+
- Prisma schema and migrations live in `apps/api/prisma`
|
|
6
|
+
- DB access is encapsulated via `PrismaModule` (`apps/api/src/prisma`)
|
|
7
|
+
- Additional DB presets are intentionally out of scope for the current milestone.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
## Docker Runtime Flow
|
|
2
|
-
|
|
3
|
-
- Compose file: `infra/docker/compose.yml`
|
|
4
|
-
- API starts through migration deploy, then NestJS server boot.
|
|
5
|
-
- Active reverse proxy preset: `{{PROXY_LABEL}}` (`{{PROXY_CONFIG_PATH}}`)
|
|
1
|
+
## Docker Runtime Flow
|
|
2
|
+
|
|
3
|
+
- Compose file: `infra/docker/compose.yml`
|
|
4
|
+
- API starts through migration deploy, then NestJS server boot.
|
|
5
|
+
- Active reverse proxy preset: `{{PROXY_LABEL}}` (`{{PROXY_CONFIG_PATH}}`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
## Scope Freeze (Current)
|
|
2
|
-
|
|
3
|
-
- Frontend preset selection is disabled (React is fixed).
|
|
4
|
-
- DB preset selection is disabled (Prisma/Postgres is fixed).
|
|
5
|
-
- Docker is always generated; runtime proxy is selectable (`caddy|nginx|none`).
|
|
1
|
+
## Scope Freeze (Current)
|
|
2
|
+
|
|
3
|
+
- Frontend preset selection is disabled (React is fixed).
|
|
4
|
+
- DB preset selection is disabled (Prisma/Postgres is fixed).
|
|
5
|
+
- Docker is always generated; runtime proxy is selectable (`caddy|nginx|none`).
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
## Docs Generation Pipeline
|
|
2
|
-
|
|
3
|
-
Project docs are assembled from markdown fragments in:
|
|
4
|
-
|
|
5
|
-
- `packages/create-forgeon/templates/docs-fragments/README`
|
|
6
|
-
- `packages/create-forgeon/templates/docs-fragments/AI_PROJECT`
|
|
7
|
-
- `packages/create-forgeon/templates/docs-fragments/AI_ARCHITECTURE`
|
|
8
|
-
|
|
9
|
-
During scaffold generation, the CLI selects fragments based on chosen flags and writes final docs into project root and `docs/AI`.
|
|
1
|
+
## Docs Generation Pipeline
|
|
2
|
+
|
|
3
|
+
Project docs are assembled from markdown fragments in:
|
|
4
|
+
|
|
5
|
+
- `packages/create-forgeon/templates/docs-fragments/README`
|
|
6
|
+
- `packages/create-forgeon/templates/docs-fragments/AI_PROJECT`
|
|
7
|
+
- `packages/create-forgeon/templates/docs-fragments/AI_ARCHITECTURE`
|
|
8
|
+
|
|
9
|
+
During scaffold generation, the CLI selects fragments based on chosen flags and writes final docs into project root and `docs/AI`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## Extension Points
|
|
2
|
-
|
|
3
|
-
Future presets should extend both code and docs in parallel:
|
|
4
|
-
|
|
5
|
-
1. Add or update fullstack module templates (`contracts/api/web`).
|
|
6
|
-
2. Register modules in `create-forgeon add` registry.
|
|
7
|
-
3. Add module docs fragments and update module spec docs.
|
|
8
|
-
4. Keep canonical core stack stable unless a major version changes it.
|
|
1
|
+
## Extension Points
|
|
2
|
+
|
|
3
|
+
Future presets should extend both code and docs in parallel:
|
|
4
|
+
|
|
5
|
+
1. Add or update fullstack module templates (`contracts/api/web`).
|
|
6
|
+
2. Register modules in `create-forgeon add` registry.
|
|
7
|
+
3. Add module docs fragments and update module spec docs.
|
|
8
|
+
4. Keep canonical core stack stable unless a major version changes it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
# PROJECT
|
|
1
|
+
# PROJECT
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
## What This Repository Is
|
|
2
|
-
|
|
3
|
-
A canonical fullstack monorepo scaffold intended to be reused as a project starter.
|
|
1
|
+
## What This Repository Is
|
|
2
|
+
|
|
3
|
+
A canonical fullstack monorepo scaffold intended to be reused as a project starter.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
## Structure
|
|
2
|
-
|
|
3
|
-
- `apps/api` - NestJS backend
|
|
4
|
-
- `apps/web` - React frontend (`{{FRONTEND_LABEL}}`, fixed)
|
|
5
|
-
- `packages/core` - shared backend core placeholder
|
|
1
|
+
## Structure
|
|
2
|
+
|
|
3
|
+
- `apps/api` - NestJS backend
|
|
4
|
+
- `apps/web` - React frontend (`{{FRONTEND_LABEL}}`, fixed)
|
|
5
|
+
- `packages/core` - shared backend core placeholder
|
|
@@ -1 +1 @@
|
|
|
1
|
-
- `infra` - Docker Compose (always) + proxy preset (`{{PROXY_LABEL}}`)
|
|
1
|
+
- `infra` - Docker Compose (always) + proxy preset (`{{PROXY_LABEL}}`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
- `docs` - documentation, AI prompts, and module spec contracts
|
|
1
|
+
- `docs` - documentation, AI prompts, and module spec contracts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## Run Modes
|
|
2
|
-
|
|
3
|
-
### Dev mode
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
pnpm install
|
|
7
|
-
pnpm dev
|
|
8
|
-
```
|
|
1
|
+
## Run Modes
|
|
2
|
+
|
|
3
|
+
### Dev mode
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pnpm install
|
|
7
|
+
pnpm dev
|
|
8
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
### Docker mode
|
|
2
|
-
|
|
3
|
-
```bash
|
|
4
|
-
docker compose --env-file infra/docker/.env.example -f infra/docker/compose.yml up --build
|
|
5
|
-
```
|
|
1
|
+
### Docker mode
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
docker compose --env-file infra/docker/.env.example -f infra/docker/compose.yml up --build
|
|
5
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
### Proxy Notes
|
|
2
|
-
|
|
3
|
-
- Active proxy preset: `{{PROXY_LABEL}}`
|
|
4
|
-
- Main proxy config: `{{PROXY_CONFIG_PATH}}`
|
|
5
|
-
- Keep service names `api` and `db` stable unless you update compose and proxy config together.
|
|
1
|
+
### Proxy Notes
|
|
2
|
+
|
|
3
|
+
- Active proxy preset: `{{PROXY_LABEL}}`
|
|
4
|
+
- Main proxy config: `{{PROXY_CONFIG_PATH}}`
|
|
5
|
+
- Keep service names `api` and `db` stable unless you update compose and proxy config together.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
### Proxy Notes
|
|
2
|
-
- Active proxy preset: `none`
|
|
3
|
-
- No proxy config file is used.
|
|
4
|
-
- API is exposed directly from compose on `localhost:3000`.
|
|
5
|
-
- For OAuth/SSL test scenarios, switch to `proxy=caddy`.
|
|
1
|
+
### Proxy Notes
|
|
2
|
+
- Active proxy preset: `none`
|
|
3
|
+
- No proxy config file is used.
|
|
4
|
+
- API is exposed directly from compose on `localhost:3000`.
|
|
5
|
+
- For OAuth/SSL test scenarios, switch to `proxy=caddy`.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
## Change Boundaries
|
|
2
|
-
|
|
3
|
-
- Safe to change first: env files, host ports, and app code under `apps/*`.
|
|
1
|
+
## Change Boundaries
|
|
2
|
+
|
|
3
|
+
- Safe to change first: env files, host ports, and app code under `apps/*`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
- Change carefully: proxy config and docker service names because routing depends on them.
|
|
1
|
+
- Change carefully: proxy config and docker service names because routing depends on them.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Forgeon Fullstack Scaffold
|
|
2
|
-
|
|
3
|
-
Canonical monorepo scaffold for NestJS + frontend with shared packages and generated docs.
|
|
1
|
+
# Forgeon Fullstack Scaffold
|
|
2
|
+
|
|
3
|
+
Canonical monorepo scaffold for NestJS + frontend with shared packages and generated docs.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## Generated Preset
|
|
2
|
-
|
|
3
|
-
- Stack: `NestJS + React + Prisma/Postgres + Docker`
|
|
4
|
-
- Frontend: `{{FRONTEND_LABEL}}` (fixed)
|
|
5
|
-
- Database: `{{DB_LABEL}}` (fixed)
|
|
6
|
-
- i18n: `{{I18N_STATUS}}`
|
|
7
|
-
- Docker/infra: `enabled` (fixed)
|
|
8
|
-
- Reverse proxy: `{{PROXY_LABEL}}` (`caddy|nginx|none`)
|
|
1
|
+
## Generated Preset
|
|
2
|
+
|
|
3
|
+
- Stack: `NestJS + React + Prisma/Postgres + Docker`
|
|
4
|
+
- Frontend: `{{FRONTEND_LABEL}}` (fixed)
|
|
5
|
+
- Database: `{{DB_LABEL}}` (fixed)
|
|
6
|
+
- i18n: `{{I18N_STATUS}}`
|
|
7
|
+
- Docker/infra: `enabled` (fixed)
|
|
8
|
+
- Reverse proxy: `{{PROXY_LABEL}}` (`caddy|nginx|none`)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
## Quick Start (Dev)
|
|
2
|
-
|
|
3
|
-
1. Install dependencies:
|
|
4
|
-
```bash
|
|
5
|
-
pnpm install
|
|
6
|
-
```
|
|
1
|
+
## Quick Start (Dev)
|
|
2
|
+
|
|
3
|
+
1. Install dependencies:
|
|
4
|
+
```bash
|
|
5
|
+
pnpm install
|
|
6
|
+
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
2. Start local Postgres (Docker):
|
|
2
|
-
```bash
|
|
3
|
-
docker compose --env-file infra/docker/.env.example -f infra/docker/compose.yml up db -d
|
|
4
|
-
```
|
|
1
|
+
2. Start local Postgres (Docker):
|
|
2
|
+
```bash
|
|
3
|
+
docker compose --env-file infra/docker/.env.example -f infra/docker/compose.yml up db -d
|
|
4
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
2. Ensure PostgreSQL is running locally and configure `DATABASE_URL` in `apps/api/.env`.
|
|
1
|
+
2. Ensure PostgreSQL is running locally and configure `DATABASE_URL` in `apps/api/.env`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
3. Run API + web in dev mode:
|
|
2
|
-
```bash
|
|
3
|
-
pnpm dev
|
|
4
|
-
```
|
|
5
|
-
4. Open:
|
|
6
|
-
- Web: `http://localhost:5173`
|
|
7
|
-
- API health: `http://localhost:3000/api/health`
|
|
1
|
+
3. Run API + web in dev mode:
|
|
2
|
+
```bash
|
|
3
|
+
pnpm dev
|
|
4
|
+
```
|
|
5
|
+
4. Open:
|
|
6
|
+
- Web: `http://localhost:5173`
|
|
7
|
+
- API health: `http://localhost:3000/api/health`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
## Quick Start (Docker)
|
|
2
|
-
|
|
3
|
-
```bash
|
|
4
|
-
docker compose --env-file infra/docker/.env.example -f infra/docker/compose.yml up --build
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
Open `http://localhost:8080`.
|
|
1
|
+
## Quick Start (Docker)
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
docker compose --env-file infra/docker/.env.example -f infra/docker/compose.yml up --build
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
Open `http://localhost:8080`.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
## Quick Start (Docker)
|
|
2
|
-
|
|
3
|
-
```bash
|
|
4
|
-
docker compose --env-file infra/docker/.env.example -f infra/docker/compose.yml up --build
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
Open API at `http://localhost:3000/api/health`.
|
|
8
|
-
|
|
9
|
-
Frontend is not served by Docker in `proxy=none` mode. Use `pnpm dev` for web.
|
|
1
|
+
## Quick Start (Docker)
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
docker compose --env-file infra/docker/.env.example -f infra/docker/compose.yml up --build
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
Open API at `http://localhost:3000/api/health`.
|
|
8
|
+
|
|
9
|
+
Frontend is not served by Docker in `proxy=none` mode. Use `pnpm dev` for web.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
### Proxy Preset: Caddy
|
|
2
|
-
|
|
3
|
-
- `/api/*` is proxied to `api:3000`.
|
|
4
|
-
- Static frontend build is served by Caddy.
|
|
5
|
-
- Main proxy config: `infra/caddy/Caddyfile`.
|
|
6
|
-
- Compose service wiring: `infra/docker/compose.yml` (`caddy` service).
|
|
7
|
-
- Safe to edit: host ports and env values in `infra/docker/.env.example`.
|
|
8
|
-
- Avoid renaming service hosts (`api`, `db`) unless you also update proxy/compose config.
|
|
9
|
-
- Recommended preset for local SSL/OAuth-style testing.
|
|
1
|
+
### Proxy Preset: Caddy
|
|
2
|
+
|
|
3
|
+
- `/api/*` is proxied to `api:3000`.
|
|
4
|
+
- Static frontend build is served by Caddy.
|
|
5
|
+
- Main proxy config: `infra/caddy/Caddyfile`.
|
|
6
|
+
- Compose service wiring: `infra/docker/compose.yml` (`caddy` service).
|
|
7
|
+
- Safe to edit: host ports and env values in `infra/docker/.env.example`.
|
|
8
|
+
- Avoid renaming service hosts (`api`, `db`) unless you also update proxy/compose config.
|
|
9
|
+
- Recommended preset for local SSL/OAuth-style testing.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
### Proxy Preset: Nginx
|
|
2
|
-
|
|
3
|
-
- `/api/*` is proxied to `api:3000`.
|
|
4
|
-
- Static frontend build is served by Nginx.
|
|
5
|
-
- Main proxy config: `infra/nginx/nginx.conf`.
|
|
6
|
-
- Compose service wiring: `infra/docker/compose.yml` (`nginx` service).
|
|
7
|
-
- Safe to edit: host ports and env values in `infra/docker/.env.example`.
|
|
8
|
-
- Avoid renaming service hosts (`api`, `db`) unless you also update proxy/compose config.
|
|
1
|
+
### Proxy Preset: Nginx
|
|
2
|
+
|
|
3
|
+
- `/api/*` is proxied to `api:3000`.
|
|
4
|
+
- Static frontend build is served by Nginx.
|
|
5
|
+
- Main proxy config: `infra/nginx/nginx.conf`.
|
|
6
|
+
- Compose service wiring: `infra/docker/compose.yml` (`nginx` service).
|
|
7
|
+
- Safe to edit: host ports and env values in `infra/docker/.env.example`.
|
|
8
|
+
- Avoid renaming service hosts (`api`, `db`) unless you also update proxy/compose config.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
### Proxy Preset: none
|
|
2
|
-
|
|
3
|
-
- No reverse proxy container is started.
|
|
4
|
-
- API is exposed directly on `http://localhost:3000`.
|
|
5
|
-
- Useful for minimal local backend testing.
|
|
6
|
-
- For OAuth/SSL-style local tests, prefer `proxy=caddy`.
|
|
1
|
+
### Proxy Preset: none
|
|
2
|
+
|
|
3
|
+
- No reverse proxy container is started.
|
|
4
|
+
- API is exposed directly on `http://localhost:3000`.
|
|
5
|
+
- Useful for minimal local backend testing.
|
|
6
|
+
- For OAuth/SSL-style local tests, prefer `proxy=caddy`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
### Prisma In Container Start
|
|
2
|
-
|
|
3
|
-
API container starts with:
|
|
4
|
-
1. `pnpm --filter @forgeon/api prisma:migrate:deploy`
|
|
5
|
-
2. `node apps/api/dist/main.js`
|
|
1
|
+
### Prisma In Container Start
|
|
2
|
+
|
|
3
|
+
API container starts with:
|
|
4
|
+
1. `pnpm --filter @forgeon/api prisma:migrate:deploy`
|
|
5
|
+
2. `node apps/api/dist/main.js`
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
## i18n Configuration
|
|
2
|
-
|
|
3
|
-
Environment keys:
|
|
4
|
-
- `I18N_ENABLED=true|false`
|
|
5
|
-
- `I18N_DEFAULT_LANG=en`
|
|
6
|
-
- `I18N_FALLBACK_LANG=en`
|
|
7
|
-
|
|
1
|
+
## i18n Configuration
|
|
2
|
+
|
|
3
|
+
Environment keys:
|
|
4
|
+
- `I18N_ENABLED=true|false`
|
|
5
|
+
- `I18N_DEFAULT_LANG=en`
|
|
6
|
+
- `I18N_FALLBACK_LANG=en`
|
|
7
|
+
|
|
8
8
|
Resources location: `resources/i18n`.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Packages:
|
|
11
|
+
- `@forgeon/i18n`
|
|
12
|
+
- `@forgeon/i18n-contracts`
|
|
13
|
+
- `@forgeon/i18n-web`
|
|
14
|
+
|
|
15
|
+
You can apply i18n later with:
|
|
16
|
+
`npx create-forgeon@latest add i18n --project .`
|