create-mercato-app 0.4.2-canary-e5804f7db1
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 +94 -0
- package/bin/create-mercato-app +21 -0
- package/dist/index.js +177 -0
- package/package.json +42 -0
- package/template/.env.example +217 -0
- package/template/.yarnrc.yml.template +2 -0
- package/template/components.json +22 -0
- package/template/gitignore +50 -0
- package/template/next.config.ts +28 -0
- package/template/package.json.template +87 -0
- package/template/postcss.config.mjs +5 -0
- package/template/public/catch-the-tornado-logo.png +0 -0
- package/template/public/file.svg +1 -0
- package/template/public/globe.svg +1 -0
- package/template/public/next.svg +1 -0
- package/template/public/open-mercato.svg +50 -0
- package/template/public/vercel.svg +1 -0
- package/template/public/window.svg +1 -0
- package/template/src/app/(backend)/backend/[...slug]/page.tsx +59 -0
- package/template/src/app/(backend)/backend/layout.tsx +350 -0
- package/template/src/app/(backend)/backend/page.tsx +13 -0
- package/template/src/app/(frontend)/[...slug]/page.tsx +32 -0
- package/template/src/app/api/[...slug]/route.ts +227 -0
- package/template/src/app/api/docs/markdown/route.ts +35 -0
- package/template/src/app/api/docs/openapi/route.ts +30 -0
- package/template/src/app/globals.css +178 -0
- package/template/src/app/layout.tsx +76 -0
- package/template/src/app/page.tsx +134 -0
- package/template/src/bootstrap.ts +58 -0
- package/template/src/components/ClientBootstrap.tsx +37 -0
- package/template/src/components/GlobalNoticeBars.tsx +116 -0
- package/template/src/components/OrganizationSwitcher.tsx +360 -0
- package/template/src/components/StartPageContent.tsx +269 -0
- package/template/src/components/ui/button.tsx +59 -0
- package/template/src/components/ui/card.tsx +92 -0
- package/template/src/components/ui/checkbox.tsx +29 -0
- package/template/src/components/ui/input.tsx +21 -0
- package/template/src/components/ui/label.tsx +24 -0
- package/template/src/di.ts +11 -0
- package/template/src/i18n/de.json +375 -0
- package/template/src/i18n/en.json +376 -0
- package/template/src/i18n/es.json +376 -0
- package/template/src/i18n/pl.json +375 -0
- package/template/src/modules/.gitkeep +0 -0
- package/template/src/modules.ts +31 -0
- package/template/src/proxy.ts +17 -0
- package/template/tsconfig.json +54 -0
- package/template/types/pg/index.d.ts +1 -0
- package/template/types/react-big-calendar/index.d.ts +16 -0
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# create-mercato-app
|
|
2
|
+
|
|
3
|
+
Create a new Open Mercato application with a single command.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx create-mercato-app my-app
|
|
9
|
+
cd my-app
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx create-mercato-app <app-name> [options]
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Arguments
|
|
19
|
+
|
|
20
|
+
| Argument | Description |
|
|
21
|
+
|----------|-------------|
|
|
22
|
+
| `app-name` | Name of the application (creates folder with this name) |
|
|
23
|
+
|
|
24
|
+
### Options
|
|
25
|
+
|
|
26
|
+
| Option | Description |
|
|
27
|
+
|--------|-------------|
|
|
28
|
+
| `--registry <url>` | Custom npm registry URL |
|
|
29
|
+
| `--verdaccio` | Use local Verdaccio registry (http://localhost:4873) |
|
|
30
|
+
| `--help`, `-h` | Show help |
|
|
31
|
+
| `--version`, `-v` | Show version |
|
|
32
|
+
|
|
33
|
+
### Examples
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Create a new app using the public npm registry
|
|
37
|
+
npx create-mercato-app my-store
|
|
38
|
+
|
|
39
|
+
# Create a new app using a local Verdaccio registry
|
|
40
|
+
npx create-mercato-app my-store --verdaccio
|
|
41
|
+
|
|
42
|
+
# Create a new app using a custom registry
|
|
43
|
+
npx create-mercato-app my-store --registry http://localhost:4873
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## After Creating Your App
|
|
47
|
+
|
|
48
|
+
1. Navigate to your app directory:
|
|
49
|
+
```bash
|
|
50
|
+
cd my-app
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
2. Copy and configure your environment:
|
|
54
|
+
```bash
|
|
55
|
+
cp .env.example .env
|
|
56
|
+
# Edit .env with your database credentials
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
3. Install dependencies:
|
|
60
|
+
```bash
|
|
61
|
+
yarn install
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
4. Generate required files:
|
|
65
|
+
```bash
|
|
66
|
+
yarn generate
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
5. Run database migrations:
|
|
70
|
+
```bash
|
|
71
|
+
yarn db:migrate
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
6. Initialize the application:
|
|
75
|
+
```bash
|
|
76
|
+
yarn initialize
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
7. Start the development server:
|
|
80
|
+
```bash
|
|
81
|
+
yarn dev
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Requirements
|
|
85
|
+
|
|
86
|
+
- Node.js 18 or later
|
|
87
|
+
- PostgreSQL database
|
|
88
|
+
- Yarn (recommended) or npm
|
|
89
|
+
|
|
90
|
+
## Learn More
|
|
91
|
+
|
|
92
|
+
For more information about Open Mercato, visit:
|
|
93
|
+
- [GitHub Repository](https://github.com/open-mercato/open-mercato)
|
|
94
|
+
- [Documentation](https://docs.openmercato.com)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// Stub loader for the create-mercato-app CLI
|
|
4
|
+
// This file exists so yarn/npm can create bin symlinks before the package is built.
|
|
5
|
+
// It dynamically loads the actual CLI from dist/index.js
|
|
6
|
+
|
|
7
|
+
import { existsSync } from 'node:fs';
|
|
8
|
+
import { join, dirname } from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const distIndex = join(__dirname, '..', 'dist', 'index.js');
|
|
13
|
+
|
|
14
|
+
if (!existsSync(distIndex)) {
|
|
15
|
+
console.error('Error: CLI not built. Run "yarn build" first.');
|
|
16
|
+
console.error(`Expected: ${distIndex}`);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Import the actual CLI
|
|
21
|
+
await import(distIndex);
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// src/index.ts
|
|
5
|
+
import { existsSync, mkdirSync, readdirSync, statSync, readFileSync, writeFileSync, copyFileSync } from "node:fs";
|
|
6
|
+
import { join, dirname, basename, resolve } from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
import pc from "picocolors";
|
|
9
|
+
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
var PACKAGE_VERSION = "0.4.1";
|
|
11
|
+
var TEMPLATE_DIR = join(__dirname, "..", "template");
|
|
12
|
+
function showHelp() {
|
|
13
|
+
console.log(`
|
|
14
|
+
${pc.bold("create-mercato-app")} - Create a new Open Mercato application
|
|
15
|
+
|
|
16
|
+
${pc.bold("Usage:")}
|
|
17
|
+
create-mercato-app <app-name> [options]
|
|
18
|
+
|
|
19
|
+
${pc.bold("Arguments:")}
|
|
20
|
+
app-name Name of the application (will create folder with this name)
|
|
21
|
+
|
|
22
|
+
${pc.bold("Options:")}
|
|
23
|
+
--registry <url> Custom npm registry URL
|
|
24
|
+
--verdaccio Use local Verdaccio registry (http://localhost:4873)
|
|
25
|
+
--help, -h Show help
|
|
26
|
+
--version, -v Show version
|
|
27
|
+
|
|
28
|
+
${pc.bold("Examples:")}
|
|
29
|
+
npx create-mercato-app my-store
|
|
30
|
+
npx create-mercato-app my-store --verdaccio
|
|
31
|
+
npx create-mercato-app my-store --registry http://localhost:4873
|
|
32
|
+
`);
|
|
33
|
+
}
|
|
34
|
+
function showVersion() {
|
|
35
|
+
console.log(`create-mercato-app v${PACKAGE_VERSION}`);
|
|
36
|
+
}
|
|
37
|
+
function parseArgs(args) {
|
|
38
|
+
const options = {
|
|
39
|
+
registry: void 0,
|
|
40
|
+
verdaccio: false,
|
|
41
|
+
help: false,
|
|
42
|
+
version: false
|
|
43
|
+
};
|
|
44
|
+
let appName = null;
|
|
45
|
+
for (let i = 0; i < args.length; i++) {
|
|
46
|
+
const arg = args[i];
|
|
47
|
+
if (arg === "--help" || arg === "-h") {
|
|
48
|
+
options.help = true;
|
|
49
|
+
} else if (arg === "--version" || arg === "-v") {
|
|
50
|
+
options.version = true;
|
|
51
|
+
} else if (arg === "--verdaccio") {
|
|
52
|
+
options.verdaccio = true;
|
|
53
|
+
} else if (arg === "--registry") {
|
|
54
|
+
options.registry = args[++i];
|
|
55
|
+
} else if (!arg.startsWith("-")) {
|
|
56
|
+
appName = arg;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return { appName, options };
|
|
60
|
+
}
|
|
61
|
+
function validateAppName(name) {
|
|
62
|
+
if (!name) {
|
|
63
|
+
return { valid: false, error: "App name is required" };
|
|
64
|
+
}
|
|
65
|
+
if (!/^[a-z0-9-]+$/.test(name)) {
|
|
66
|
+
return {
|
|
67
|
+
valid: false,
|
|
68
|
+
error: "App name must be lowercase alphanumeric with hyphens only (e.g., my-app)"
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (name.startsWith("-") || name.endsWith("-")) {
|
|
72
|
+
return { valid: false, error: "App name cannot start or end with a hyphen" };
|
|
73
|
+
}
|
|
74
|
+
return { valid: true };
|
|
75
|
+
}
|
|
76
|
+
var FILE_RENAMES = {
|
|
77
|
+
gitignore: ".gitignore"
|
|
78
|
+
};
|
|
79
|
+
function copyDirRecursive(src, dest, placeholders) {
|
|
80
|
+
if (!existsSync(dest)) {
|
|
81
|
+
mkdirSync(dest, { recursive: true });
|
|
82
|
+
}
|
|
83
|
+
const entries = readdirSync(src);
|
|
84
|
+
for (const entry of entries) {
|
|
85
|
+
const srcPath = join(src, entry);
|
|
86
|
+
const destName = FILE_RENAMES[entry] ?? entry;
|
|
87
|
+
let destPath = join(dest, destName);
|
|
88
|
+
const stat = statSync(srcPath);
|
|
89
|
+
if (stat.isDirectory()) {
|
|
90
|
+
copyDirRecursive(srcPath, destPath, placeholders);
|
|
91
|
+
} else if (entry.endsWith(".template")) {
|
|
92
|
+
const finalName = entry.replace(".template", "");
|
|
93
|
+
destPath = join(dest, finalName);
|
|
94
|
+
let content = readFileSync(srcPath, "utf-8");
|
|
95
|
+
for (const [key, value] of Object.entries(placeholders)) {
|
|
96
|
+
content = content.replace(new RegExp(`\\{\\{${key}\\}\\}`, "g"), value);
|
|
97
|
+
}
|
|
98
|
+
writeFileSync(destPath, content);
|
|
99
|
+
} else {
|
|
100
|
+
copyFileSync(srcPath, destPath);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function main() {
|
|
105
|
+
const args = process.argv.slice(2);
|
|
106
|
+
const { appName: appNameArg, options } = parseArgs(args);
|
|
107
|
+
if (options.help) {
|
|
108
|
+
showHelp();
|
|
109
|
+
process.exit(0);
|
|
110
|
+
}
|
|
111
|
+
if (options.version) {
|
|
112
|
+
showVersion();
|
|
113
|
+
process.exit(0);
|
|
114
|
+
}
|
|
115
|
+
if (!appNameArg) {
|
|
116
|
+
console.error(pc.red("Error: App name is required"));
|
|
117
|
+
console.error("");
|
|
118
|
+
showHelp();
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
const targetDir = resolve(process.cwd(), appNameArg);
|
|
122
|
+
const appName = basename(targetDir);
|
|
123
|
+
const validation = validateAppName(appName);
|
|
124
|
+
if (!validation.valid) {
|
|
125
|
+
console.error(pc.red(`Error: ${validation.error}`));
|
|
126
|
+
process.exit(1);
|
|
127
|
+
}
|
|
128
|
+
if (existsSync(targetDir)) {
|
|
129
|
+
console.error(pc.red(`Error: Directory "${appName}" already exists`));
|
|
130
|
+
process.exit(1);
|
|
131
|
+
}
|
|
132
|
+
if (!existsSync(TEMPLATE_DIR)) {
|
|
133
|
+
console.error(pc.red("Error: Template directory not found"));
|
|
134
|
+
console.error(`Expected: ${TEMPLATE_DIR}`);
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
let registryConfig = "";
|
|
138
|
+
if (options.verdaccio) {
|
|
139
|
+
registryConfig = `npmScopes:
|
|
140
|
+
open-mercato:
|
|
141
|
+
npmRegistryServer: "http://localhost:4873"`;
|
|
142
|
+
} else if (options.registry) {
|
|
143
|
+
registryConfig = `npmScopes:
|
|
144
|
+
open-mercato:
|
|
145
|
+
npmRegistryServer: "${options.registry}"`;
|
|
146
|
+
}
|
|
147
|
+
console.log("");
|
|
148
|
+
console.log(pc.bold(`Creating a new Open Mercato app in ${pc.cyan(targetDir)}`));
|
|
149
|
+
console.log("");
|
|
150
|
+
const placeholders = {
|
|
151
|
+
APP_NAME: appName,
|
|
152
|
+
PACKAGE_VERSION,
|
|
153
|
+
REGISTRY_CONFIG: registryConfig
|
|
154
|
+
};
|
|
155
|
+
try {
|
|
156
|
+
copyDirRecursive(TEMPLATE_DIR, targetDir, placeholders);
|
|
157
|
+
console.log(pc.green("Success!") + ` Created ${pc.bold(appName)}`);
|
|
158
|
+
console.log("");
|
|
159
|
+
console.log("Next steps:");
|
|
160
|
+
console.log("");
|
|
161
|
+
console.log(pc.cyan(` cd ${appName}`));
|
|
162
|
+
console.log(pc.cyan(" cp .env.example .env"));
|
|
163
|
+
console.log(pc.dim(" # Edit .env with your database credentials"));
|
|
164
|
+
console.log(pc.cyan(" yarn install"));
|
|
165
|
+
console.log(pc.cyan(" yarn generate"));
|
|
166
|
+
console.log(pc.cyan(" yarn db:migrate"));
|
|
167
|
+
console.log(pc.cyan(" yarn initialize"));
|
|
168
|
+
console.log(pc.cyan(" yarn dev"));
|
|
169
|
+
console.log("");
|
|
170
|
+
console.log(pc.dim("For more information, visit https://github.com/open-mercato/open-mercato"));
|
|
171
|
+
console.log("");
|
|
172
|
+
} catch (error) {
|
|
173
|
+
console.error(pc.red("Error creating app:"), error);
|
|
174
|
+
process.exit(1);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-mercato-app",
|
|
3
|
+
"version": "0.4.2-canary-e5804f7db1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Create a new Open Mercato application",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"bin": "./bin/create-mercato-app",
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"dist",
|
|
11
|
+
"template"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "node build.mjs",
|
|
15
|
+
"typecheck": "tsc --noEmit"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"picocolors": "^1.1.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "^24.10.1",
|
|
22
|
+
"esbuild": "^0.25.0",
|
|
23
|
+
"typescript": "^5.9.3"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/open-mercato/open-mercato.git",
|
|
31
|
+
"directory": "packages/create-app"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"open-mercato",
|
|
35
|
+
"erp",
|
|
36
|
+
"commerce",
|
|
37
|
+
"scaffolding",
|
|
38
|
+
"cli"
|
|
39
|
+
],
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"stableVersion": "0.4.1"
|
|
42
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Example environment configuration
|
|
2
|
+
# Copy this file to .env and adjust values for your environment.
|
|
3
|
+
|
|
4
|
+
# PostgreSQL Configuration
|
|
5
|
+
POSTGRES_USER=postgres
|
|
6
|
+
POSTGRES_PASSWORD=postgres
|
|
7
|
+
POSTGRES_DB=open-mercato
|
|
8
|
+
POSTGRES_PORT=5432
|
|
9
|
+
|
|
10
|
+
# PostgreSQL connection string (required)
|
|
11
|
+
DATABASE_URL=postgres://postgres:postgres@localhost:5432/open-mercato
|
|
12
|
+
|
|
13
|
+
# JWT secret for auth tokens (required)
|
|
14
|
+
JWT_SECRET=change-me-dev-secret
|
|
15
|
+
|
|
16
|
+
# Events transport (choose one)
|
|
17
|
+
# REDIS_URL=redis://localhost:6379
|
|
18
|
+
# or
|
|
19
|
+
# EVENTS_REDIS_URL=redis://localhost:6379
|
|
20
|
+
|
|
21
|
+
# Email provider (optional)
|
|
22
|
+
# RESEND_API_KEY=
|
|
23
|
+
|
|
24
|
+
# Public URL used in emails and onboarding flows
|
|
25
|
+
APP_URL=http://localhost:3000
|
|
26
|
+
|
|
27
|
+
# Enable self-service onboarding (default: false)
|
|
28
|
+
SELF_SERVICE_ONBOARDING_ENABLED=false
|
|
29
|
+
DEMO_MODE=true
|
|
30
|
+
|
|
31
|
+
# Admin email to notify about onboarding submissions
|
|
32
|
+
ADMIN_EMAIL=ops@your-domain.com
|
|
33
|
+
|
|
34
|
+
# Node environment
|
|
35
|
+
NODE_ENV=development
|
|
36
|
+
|
|
37
|
+
# Auto-spawn workers when starting the app (default: true)
|
|
38
|
+
# Set to false to run workers separately in production
|
|
39
|
+
AUTO_SPAWN_WORKERS=true
|
|
40
|
+
|
|
41
|
+
# SSL Certificate Configuration
|
|
42
|
+
# Path to additional CA certificates for Node.js HTTPS connections
|
|
43
|
+
# Required for Raiffeisen Bank API which doesn't send complete certificate chain
|
|
44
|
+
# The GeoTrust EV RSA CA G2 intermediate certificate is needed for SSL verification
|
|
45
|
+
# Certificate valid until: July 2, 2030
|
|
46
|
+
# To update: curl -o certs/geotrust-ev-rsa-ca-g2.pem https://cacerts.digicert.com/GeoTrustEVRSACAG2.crt.pem
|
|
47
|
+
NODE_EXTRA_CA_CERTS=./certs/geotrust-ev-rsa-ca-g2.pem
|
|
48
|
+
|
|
49
|
+
# Hybrid query engine SQL logging (optional, default: false)
|
|
50
|
+
# Set to true to log raw SQL statements from the hybrid query engine.
|
|
51
|
+
QUERY_ENGINE_DEBUG_SQL=false
|
|
52
|
+
|
|
53
|
+
# Enable tree profiler for matching resources/entities (comma-separated filters, e.g. * - for all profilers,customers.*, customers.people)
|
|
54
|
+
# OM_PROFILE=
|
|
55
|
+
# Enable detailed CRUD profiling for matching resources (comma-separated filters, e.g. customers.*, *)
|
|
56
|
+
# OM_CRUD_PROFILE=
|
|
57
|
+
# Enable hybrid query engine profiling for matching entities (comma-separated filters, e.g. customers.*, customers.people)
|
|
58
|
+
# OM_QE_PROFILE=
|
|
59
|
+
|
|
60
|
+
# Enable cache for CRUD API responses (default: false)
|
|
61
|
+
ENABLE_CRUD_API_CACHE=false
|
|
62
|
+
|
|
63
|
+
# Auto-reindex query indexes when coverage gaps are detected (default: true)
|
|
64
|
+
SCHEDULE_AUTO_REINDEX=true
|
|
65
|
+
|
|
66
|
+
# Skip immediate coverage recalculation on read (default: false)
|
|
67
|
+
OPTIMIZE_INDEX_COVERAGE_STATS=false
|
|
68
|
+
|
|
69
|
+
# Continue serving results from entity indexes when coverage gaps are detected (default: true)
|
|
70
|
+
FORCE_QUERY_INDEX_ON_PARTIAL_INDEXES=true
|
|
71
|
+
|
|
72
|
+
# Hashed search tokenization defaults
|
|
73
|
+
OM_SEARCH_ENABLED=true
|
|
74
|
+
OM_SEARCH_MIN_LEN=3
|
|
75
|
+
OM_SEARCH_ENABLE_PARTIAL=true
|
|
76
|
+
OM_SEARCH_HASH_ALGO=sha256
|
|
77
|
+
OM_SEARCH_STORE_RAW_TOKENS=false
|
|
78
|
+
# Optional comma-separated blocklist of field name substrings to skip during tokenization
|
|
79
|
+
# OM_SEARCH_FIELD_BLOCKLIST=password,token,secret,hash
|
|
80
|
+
|
|
81
|
+
# Search module debug logging (Meilisearch, vector search, reindex operations)
|
|
82
|
+
OM_SEARCH_DEBUG=false
|
|
83
|
+
|
|
84
|
+
# Query index engine debug logging (search:source-has-tokens, coverage, etc.)
|
|
85
|
+
OM_QUERY_INDEX_DEBUG=false
|
|
86
|
+
|
|
87
|
+
# Toggle EAV backward compatibility for user-defined entities (custom field values)
|
|
88
|
+
# When true, DataEngine will also write to custom_field_values on create/update of custom entities.
|
|
89
|
+
# Default is false: values are only stored in custom_entities_storage.
|
|
90
|
+
ENTITIES_BACKCOMPAT_EAV_FOR_CUSTOM=false
|
|
91
|
+
|
|
92
|
+
# Cache strategy (default: memory)
|
|
93
|
+
CACHE_STRATEGY=sqlite
|
|
94
|
+
|
|
95
|
+
# Default TTL in milliseconds (optional)
|
|
96
|
+
CACHE_TTL=300000
|
|
97
|
+
|
|
98
|
+
# Redis Configuration
|
|
99
|
+
#REDIS_PORT=6379
|
|
100
|
+
|
|
101
|
+
# Redis configuration (for redis strategy)
|
|
102
|
+
#CACHE_REDIS_URL=redis://localhost:6379
|
|
103
|
+
|
|
104
|
+
# SQLite configuration (for sqlite strategy)
|
|
105
|
+
CACHE_SQLITE_PATH=./data/cache.db
|
|
106
|
+
|
|
107
|
+
# JSON file configuration (for jsonfile strategy)
|
|
108
|
+
#CACHE_JSON_FILE_PATH=./data/cache.json
|
|
109
|
+
|
|
110
|
+
# Database pooling settings
|
|
111
|
+
DB_POOL_MIN=5
|
|
112
|
+
DB_POOL_MAX=20
|
|
113
|
+
DB_POOL_IDLE_TIMEOUT=30000
|
|
114
|
+
DB_POOL_ACQUIRE_TIMEOUT=60000
|
|
115
|
+
|
|
116
|
+
# Audit log retention windows
|
|
117
|
+
# Core resources (users, roles) keep access history longer to support investigations.
|
|
118
|
+
AUDIT_LOGS_CORE_RETENTION_DAYS=7
|
|
119
|
+
# Non-core reads rotate aggressively to limit storage.
|
|
120
|
+
AUDIT_LOGS_NON_CORE_RETENTION_HOURS=8
|
|
121
|
+
|
|
122
|
+
# Tenant data encryption (enabled by default)
|
|
123
|
+
TENANT_DATA_ENCRYPTION=yes
|
|
124
|
+
TENANT_DATA_ENCRYPTION_DEBUG=false
|
|
125
|
+
# Preferred fallback key when Vault is unavailable (use a strong 32+ char secret)
|
|
126
|
+
TENANT_DATA_ENCRYPTION_FALLBACK_KEY=dev-tenant-encryption-fallback-key-32chars
|
|
127
|
+
# Legacy secondary fallback secret (optional)
|
|
128
|
+
TENANT_DATA_ENCRYPTION_KEY=
|
|
129
|
+
# Hashicorp Vault configuration
|
|
130
|
+
VAULT_ADDR=http://localhost:8200
|
|
131
|
+
VAULT_TOKEN=dev-only-token
|
|
132
|
+
VAULT_KV_PATH=secret/data
|
|
133
|
+
|
|
134
|
+
# ============================================================================
|
|
135
|
+
# Embedding Provider Configuration (for vector search)
|
|
136
|
+
# ============================================================================
|
|
137
|
+
# Vector search requires ONE embedding provider to be configured.
|
|
138
|
+
# OpenAI is the default provider if no explicit configuration is set.
|
|
139
|
+
|
|
140
|
+
# OpenAI (default embedding provider)
|
|
141
|
+
# Models: text-embedding-3-small (1536 dim), text-embedding-3-large (3072 dim)
|
|
142
|
+
OPENAI_API_KEY=your_openai_api_key_here
|
|
143
|
+
|
|
144
|
+
# Google Generative AI
|
|
145
|
+
# Models: text-embedding-004 (768 dim), embedding-001 (768 dim)
|
|
146
|
+
# GOOGLE_GENERATIVE_AI_API_KEY=
|
|
147
|
+
|
|
148
|
+
# Mistral AI
|
|
149
|
+
# Models: mistral-embed (1024 dim)
|
|
150
|
+
# MISTRAL_API_KEY=
|
|
151
|
+
|
|
152
|
+
# Cohere
|
|
153
|
+
# Models: embed-english-v3.0 (1024 dim), embed-multilingual-v3.0 (1024 dim)
|
|
154
|
+
# COHERE_API_KEY=
|
|
155
|
+
|
|
156
|
+
# Amazon Bedrock
|
|
157
|
+
# Models: amazon.titan-embed-text-v2:0 (1024 dim), cohere.embed-english-v3 (1024 dim)
|
|
158
|
+
# AWS_ACCESS_KEY_ID=
|
|
159
|
+
# AWS_SECRET_ACCESS_KEY=
|
|
160
|
+
# AWS_REGION=us-east-1
|
|
161
|
+
|
|
162
|
+
# Ollama (Local/Self-hosted)
|
|
163
|
+
# Models: nomic-embed-text (768 dim), mxbai-embed-large (1024 dim), all-minilm (384 dim)
|
|
164
|
+
# Default: http://localhost:11434 (no /api suffix needed)
|
|
165
|
+
# OLLAMA_BASE_URL=http://localhost:11434
|
|
166
|
+
|
|
167
|
+
# ============================================================================
|
|
168
|
+
# OCR (Optical Character Recognition) Configuration
|
|
169
|
+
# ============================================================================
|
|
170
|
+
# Default OCR model for image and PDF text extraction (optional)
|
|
171
|
+
# Falls back to 'gpt-4o' if not specified. Can be overridden per partition.
|
|
172
|
+
# Supported models: gpt-4o, gpt-4o-mini
|
|
173
|
+
OCR_MODEL=gpt-4o
|
|
174
|
+
|
|
175
|
+
# Custom OCR prompt (optional, advanced)
|
|
176
|
+
# Override the default prompt sent to the LLM for text extraction
|
|
177
|
+
# OCR_DEFAULT_PROMPT="Extract all text content from this image..."
|
|
178
|
+
|
|
179
|
+
# Enable/disable OCR for new partitions by default (default: true)
|
|
180
|
+
# OPENMERCATO_DEFAULT_ATTACHMENT_OCR_ENABLED=true
|
|
181
|
+
|
|
182
|
+
# ============================================================================
|
|
183
|
+
# OpenCode AI Assistant Configuration
|
|
184
|
+
# ============================================================================
|
|
185
|
+
# OpenCode handles AI requests for the AI Assistant feature.
|
|
186
|
+
# Configure the provider and set the corresponding API key.
|
|
187
|
+
|
|
188
|
+
# Provider selection: anthropic, openai, or google (default: anthropic)
|
|
189
|
+
OPENCODE_PROVIDER=anthropic
|
|
190
|
+
|
|
191
|
+
# Optional: Override the default model for the selected provider
|
|
192
|
+
# Default models by provider:
|
|
193
|
+
# - anthropic: claude-haiku-4-5-20251001
|
|
194
|
+
# - openai: gpt-4o-mini
|
|
195
|
+
# - google: gemini-2.0-flash
|
|
196
|
+
# OPENCODE_MODEL=anthropic/claude-sonnet-4-20250514
|
|
197
|
+
|
|
198
|
+
# Provider API keys (set the one matching OPENCODE_PROVIDER)
|
|
199
|
+
OPENCODE_ANTHROPIC_API_KEY=your_anthropic_api_key_here
|
|
200
|
+
# OPENCODE_OPENAI_API_KEY=your_openai_api_key_here
|
|
201
|
+
# OPENCODE_GOOGLE_API_KEY=your_google_api_key_here
|
|
202
|
+
|
|
203
|
+
# ============================================================================
|
|
204
|
+
# Meilisearch Configuration (for hybrid search)
|
|
205
|
+
# ============================================================================
|
|
206
|
+
# Meilisearch provides fast full-text fuzzy search capabilities.
|
|
207
|
+
# When configured, it becomes the primary search strategy.
|
|
208
|
+
# If not configured, the system falls back to token-based search.
|
|
209
|
+
|
|
210
|
+
# Meilisearch server URL (required for Meilisearch strategy)
|
|
211
|
+
# MEILISEARCH_HOST=http://localhost:7700
|
|
212
|
+
|
|
213
|
+
# Meilisearch API key (required for production, optional for development)
|
|
214
|
+
# MEILISEARCH_API_KEY=your_master_key_here
|
|
215
|
+
|
|
216
|
+
# Index prefix for tenant isolation (default: om)
|
|
217
|
+
# MEILISEARCH_INDEX_PREFIX=om
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "src/app/globals.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"iconLibrary": "lucide",
|
|
14
|
+
"aliases": {
|
|
15
|
+
"components": "@/components",
|
|
16
|
+
"utils": "@/lib/utils",
|
|
17
|
+
"ui": "@/components/ui",
|
|
18
|
+
"lib": "@/lib",
|
|
19
|
+
"hooks": "@/hooks"
|
|
20
|
+
},
|
|
21
|
+
"registries": {}
|
|
22
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
.pnp.*
|
|
4
|
+
.yarn/*
|
|
5
|
+
!.yarn/patches
|
|
6
|
+
!.yarn/plugins
|
|
7
|
+
!.yarn/releases
|
|
8
|
+
!.yarn/sdks
|
|
9
|
+
!.yarn/versions
|
|
10
|
+
|
|
11
|
+
# Next.js
|
|
12
|
+
.next/
|
|
13
|
+
out/
|
|
14
|
+
|
|
15
|
+
# Build outputs
|
|
16
|
+
dist/
|
|
17
|
+
build/
|
|
18
|
+
|
|
19
|
+
# Environment files
|
|
20
|
+
.env
|
|
21
|
+
.env.local
|
|
22
|
+
.env.development.local
|
|
23
|
+
.env.test.local
|
|
24
|
+
.env.production.local
|
|
25
|
+
|
|
26
|
+
# Generated files
|
|
27
|
+
.mercato/
|
|
28
|
+
|
|
29
|
+
# IDE
|
|
30
|
+
.idea/
|
|
31
|
+
.vscode/
|
|
32
|
+
*.swp
|
|
33
|
+
*.swo
|
|
34
|
+
|
|
35
|
+
# OS
|
|
36
|
+
.DS_Store
|
|
37
|
+
Thumbs.db
|
|
38
|
+
|
|
39
|
+
# Testing
|
|
40
|
+
coverage/
|
|
41
|
+
|
|
42
|
+
# Logs
|
|
43
|
+
*.log
|
|
44
|
+
npm-debug.log*
|
|
45
|
+
yarn-debug.log*
|
|
46
|
+
yarn-error.log*
|
|
47
|
+
|
|
48
|
+
# Misc
|
|
49
|
+
*.tgz
|
|
50
|
+
.cache/
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { NextConfig } from "next";
|
|
2
|
+
|
|
3
|
+
const nextConfig: NextConfig = {
|
|
4
|
+
experimental: {
|
|
5
|
+
serverMinification: false,
|
|
6
|
+
turbopackMinify: false,
|
|
7
|
+
},
|
|
8
|
+
// Transpile @open-mercato packages that have TypeScript in src/
|
|
9
|
+
// Note: @open-mercato/shared is excluded as it has pre-built dist/ files
|
|
10
|
+
transpilePackages: [
|
|
11
|
+
'@open-mercato/core',
|
|
12
|
+
'@open-mercato/ui',
|
|
13
|
+
'@open-mercato/events',
|
|
14
|
+
'@open-mercato/cache',
|
|
15
|
+
'@open-mercato/queue',
|
|
16
|
+
'@open-mercato/search',
|
|
17
|
+
'@open-mercato/content',
|
|
18
|
+
'@open-mercato/onboarding',
|
|
19
|
+
'@open-mercato/ai-assistant',
|
|
20
|
+
],
|
|
21
|
+
serverExternalPackages: [
|
|
22
|
+
'esbuild',
|
|
23
|
+
'@esbuild/darwin-arm64',
|
|
24
|
+
'@open-mercato/cli',
|
|
25
|
+
],
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default nextConfig
|