create-chaaskit 0.1.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/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +25 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add-infra.d.ts +6 -0
- package/dist/commands/add-infra.d.ts.map +1 -0
- package/dist/commands/add-infra.js +160 -0
- package/dist/commands/add-infra.js.map +1 -0
- package/dist/commands/build.d.ts +2 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +63 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/db-sync.d.ts +13 -0
- package/dist/commands/db-sync.d.ts.map +1 -0
- package/dist/commands/db-sync.js +108 -0
- package/dist/commands/db-sync.js.map +1 -0
- package/dist/commands/dev.d.ts +7 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +61 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +214 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/.env.example +24 -0
- package/dist/templates/README.md +81 -0
- package/dist/templates/app/components/AcceptInviteClient.tsx +10 -0
- package/dist/templates/app/components/AdminDashboardClient.tsx +10 -0
- package/dist/templates/app/components/AdminTeamClient.tsx +10 -0
- package/dist/templates/app/components/AdminTeamsClient.tsx +10 -0
- package/dist/templates/app/components/AdminUsersClient.tsx +10 -0
- package/dist/templates/app/components/ApiKeysClient.tsx +10 -0
- package/dist/templates/app/components/AutomationsClient.tsx +10 -0
- package/dist/templates/app/components/ChatClient.tsx +13 -0
- package/dist/templates/app/components/ClientOnly.tsx +6 -0
- package/dist/templates/app/components/DocumentsClient.tsx +10 -0
- package/dist/templates/app/components/OAuthConsentClient.tsx +10 -0
- package/dist/templates/app/components/PricingClient.tsx +10 -0
- package/dist/templates/app/components/TeamSettingsClient.tsx +10 -0
- package/dist/templates/app/components/VerifyEmailClient.tsx +10 -0
- package/dist/templates/app/entry.client.tsx +12 -0
- package/dist/templates/app/entry.server.tsx +67 -0
- package/dist/templates/app/root.tsx +91 -0
- package/dist/templates/app/routes/_index.tsx +82 -0
- package/dist/templates/app/routes/admin._index.tsx +57 -0
- package/dist/templates/app/routes/admin.teams.$teamId.tsx +57 -0
- package/dist/templates/app/routes/admin.teams._index.tsx +57 -0
- package/dist/templates/app/routes/admin.users.tsx +57 -0
- package/dist/templates/app/routes/api-keys.tsx +57 -0
- package/dist/templates/app/routes/automations.tsx +57 -0
- package/dist/templates/app/routes/chat._index.tsx +11 -0
- package/dist/templates/app/routes/chat.admin._index.tsx +10 -0
- package/dist/templates/app/routes/chat.admin.teams.$teamId.tsx +10 -0
- package/dist/templates/app/routes/chat.admin.teams._index.tsx +10 -0
- package/dist/templates/app/routes/chat.admin.users.tsx +10 -0
- package/dist/templates/app/routes/chat.api-keys.tsx +10 -0
- package/dist/templates/app/routes/chat.automations.tsx +10 -0
- package/dist/templates/app/routes/chat.documents.tsx +10 -0
- package/dist/templates/app/routes/chat.team.$teamId.settings.tsx +10 -0
- package/dist/templates/app/routes/chat.thread.$threadId.tsx +11 -0
- package/dist/templates/app/routes/chat.tsx +39 -0
- package/dist/templates/app/routes/documents.tsx +57 -0
- package/dist/templates/app/routes/invite.$token.tsx +10 -0
- package/dist/templates/app/routes/login.tsx +334 -0
- package/dist/templates/app/routes/oauth.consent.tsx +10 -0
- package/dist/templates/app/routes/pricing.tsx +10 -0
- package/dist/templates/app/routes/privacy.tsx +197 -0
- package/dist/templates/app/routes/register.tsx +398 -0
- package/dist/templates/app/routes/shared.$shareId.tsx +226 -0
- package/dist/templates/app/routes/team.$teamId.settings.tsx +57 -0
- package/dist/templates/app/routes/terms.tsx +173 -0
- package/dist/templates/app/routes/thread.$threadId.tsx +102 -0
- package/dist/templates/app/routes/verify-email.tsx +10 -0
- package/dist/templates/app/routes.ts +47 -0
- package/dist/templates/config/app.config.ts +216 -0
- package/dist/templates/docs/admin.md +257 -0
- package/dist/templates/docs/api-keys.md +403 -0
- package/dist/templates/docs/authentication.md +247 -0
- package/dist/templates/docs/configuration.md +1212 -0
- package/dist/templates/docs/custom-pages.md +466 -0
- package/dist/templates/docs/deployment.md +362 -0
- package/dist/templates/docs/development.md +411 -0
- package/dist/templates/docs/documents.md +293 -0
- package/dist/templates/docs/extensions.md +639 -0
- package/dist/templates/docs/index.md +139 -0
- package/dist/templates/docs/installation.md +286 -0
- package/dist/templates/docs/mcp.md +952 -0
- package/dist/templates/docs/native-tools.md +688 -0
- package/dist/templates/docs/queue.md +514 -0
- package/dist/templates/docs/scheduled-prompts.md +279 -0
- package/dist/templates/docs/settings.md +415 -0
- package/dist/templates/docs/slack.md +318 -0
- package/dist/templates/docs/styling.md +288 -0
- package/dist/templates/extensions/agents/.gitkeep +0 -0
- package/dist/templates/extensions/pages/.gitkeep +0 -0
- package/dist/templates/extensions/payment-plans/.gitkeep +0 -0
- package/dist/templates/index.html +16 -0
- package/dist/templates/infra-aws/.github/workflows/deploy.yml +95 -0
- package/dist/templates/infra-aws/README.md +207 -0
- package/dist/templates/infra-aws/bin/cdk.ts +18 -0
- package/dist/templates/infra-aws/cdk.json +43 -0
- package/dist/templates/infra-aws/config/deployment.ts +156 -0
- package/dist/templates/infra-aws/lib/chaaskit-stack.ts +419 -0
- package/dist/templates/infra-aws/package.json +27 -0
- package/dist/templates/infra-aws/scripts/build-app.sh +63 -0
- package/dist/templates/infra-aws/tsconfig.json +25 -0
- package/dist/templates/package.json +46 -0
- package/dist/templates/prisma/schema/base.prisma +584 -0
- package/dist/templates/prisma/schema/custom.prisma +24 -0
- package/dist/templates/prisma/schema.prisma +271 -0
- package/dist/templates/public/favicon.svg +4 -0
- package/dist/templates/public/logo.svg +4 -0
- package/dist/templates/react-router.config.ts +11 -0
- package/dist/templates/server.js +52 -0
- package/dist/templates/src/main.tsx +8 -0
- package/dist/templates/tsconfig.json +26 -0
- package/dist/templates/vite.config.ts +26 -0
- package/package.json +46 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import prompts from 'prompts';
|
|
7
|
+
import { spawn } from 'child_process';
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
10
|
+
// Convert project name to database name (replace dashes/spaces with underscores, lowercase)
|
|
11
|
+
function toDbName(name) {
|
|
12
|
+
return name.toLowerCase().replace(/[-\s]+/g, '_');
|
|
13
|
+
}
|
|
14
|
+
export async function init(projectName, options) {
|
|
15
|
+
console.log();
|
|
16
|
+
console.log(chalk.bold('🚀 Create ChaasKit App'));
|
|
17
|
+
console.log();
|
|
18
|
+
// Prompt for project name if not provided
|
|
19
|
+
if (!projectName) {
|
|
20
|
+
const response = await prompts({
|
|
21
|
+
type: 'text',
|
|
22
|
+
name: 'projectName',
|
|
23
|
+
message: 'What is your project named?',
|
|
24
|
+
initial: 'my-chat-app',
|
|
25
|
+
});
|
|
26
|
+
if (!response.projectName) {
|
|
27
|
+
console.log(chalk.red('Project name is required'));
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
projectName = response.projectName;
|
|
31
|
+
}
|
|
32
|
+
// At this point projectName is guaranteed to be defined
|
|
33
|
+
const finalProjectName = projectName;
|
|
34
|
+
const projectPath = path.resolve(process.cwd(), finalProjectName);
|
|
35
|
+
// Check if directory exists
|
|
36
|
+
if (await fs.pathExists(projectPath)) {
|
|
37
|
+
const response = await prompts({
|
|
38
|
+
type: 'confirm',
|
|
39
|
+
name: 'overwrite',
|
|
40
|
+
message: `Directory ${finalProjectName} already exists. Overwrite?`,
|
|
41
|
+
initial: false,
|
|
42
|
+
});
|
|
43
|
+
if (!response.overwrite) {
|
|
44
|
+
console.log(chalk.yellow('Aborted.'));
|
|
45
|
+
process.exit(0);
|
|
46
|
+
}
|
|
47
|
+
await fs.remove(projectPath);
|
|
48
|
+
}
|
|
49
|
+
// Create project directory
|
|
50
|
+
await fs.ensureDir(projectPath);
|
|
51
|
+
const spinner = ora('Creating project files...').start();
|
|
52
|
+
try {
|
|
53
|
+
// Copy template files
|
|
54
|
+
const templatesPath = path.join(__dirname, '../templates');
|
|
55
|
+
await copyTemplateFiles(templatesPath, projectPath, finalProjectName);
|
|
56
|
+
spinner.succeed('Project files created');
|
|
57
|
+
// Determine package manager
|
|
58
|
+
const packageManager = options.useYarn ? 'yarn' : options.useNpm ? 'npm' : 'pnpm';
|
|
59
|
+
// Install dependencies
|
|
60
|
+
if (!options.skipInstall) {
|
|
61
|
+
const installSpinner = ora(`Installing dependencies with ${packageManager}...`).start();
|
|
62
|
+
try {
|
|
63
|
+
await runCommand(packageManager, ['install'], { cwd: projectPath });
|
|
64
|
+
installSpinner.succeed('Dependencies installed');
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
installSpinner.fail('Failed to install dependencies');
|
|
68
|
+
console.log(chalk.yellow(`\nYou can install dependencies manually by running:`));
|
|
69
|
+
console.log(chalk.cyan(` cd ${finalProjectName}`));
|
|
70
|
+
console.log(chalk.cyan(` ${packageManager} install`));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Print success message
|
|
74
|
+
console.log();
|
|
75
|
+
console.log(chalk.green('✅ Success!') + ` Created ${finalProjectName} at ${projectPath}`);
|
|
76
|
+
console.log();
|
|
77
|
+
console.log('Inside that directory, you can run:');
|
|
78
|
+
console.log();
|
|
79
|
+
console.log(chalk.cyan(` ${packageManager} dev`));
|
|
80
|
+
console.log(' Starts the development servers');
|
|
81
|
+
console.log();
|
|
82
|
+
console.log(chalk.cyan(` ${packageManager} build`));
|
|
83
|
+
console.log(' Builds the app for production');
|
|
84
|
+
console.log();
|
|
85
|
+
console.log(chalk.cyan(` ${packageManager} db:push`));
|
|
86
|
+
console.log(' Push database schema changes');
|
|
87
|
+
console.log();
|
|
88
|
+
console.log('We suggest that you begin by:');
|
|
89
|
+
console.log();
|
|
90
|
+
console.log(chalk.cyan(` cd ${finalProjectName}`));
|
|
91
|
+
console.log(chalk.cyan(' cp .env.example .env'));
|
|
92
|
+
console.log(chalk.cyan(' # Edit .env with your DATABASE_URL and API keys'));
|
|
93
|
+
console.log(chalk.cyan(` ${packageManager} db:push`));
|
|
94
|
+
console.log(chalk.cyan(` ${packageManager} dev`));
|
|
95
|
+
console.log();
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
spinner.fail('Failed to create project');
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async function copyTemplateFiles(templatesPath, targetPath, projectName) {
|
|
103
|
+
// Create directory structure for React Router v7 app
|
|
104
|
+
await fs.ensureDir(path.join(targetPath, 'app', 'routes'));
|
|
105
|
+
await fs.ensureDir(path.join(targetPath, 'app', 'components'));
|
|
106
|
+
await fs.ensureDir(path.join(targetPath, 'app', 'pages'));
|
|
107
|
+
await fs.ensureDir(path.join(targetPath, 'config'));
|
|
108
|
+
await fs.ensureDir(path.join(targetPath, 'extensions', 'agents'));
|
|
109
|
+
await fs.ensureDir(path.join(targetPath, 'extensions', 'payment-plans'));
|
|
110
|
+
await fs.ensureDir(path.join(targetPath, 'extensions', 'pages'));
|
|
111
|
+
await fs.ensureDir(path.join(targetPath, 'prisma', 'schema'));
|
|
112
|
+
await fs.ensureDir(path.join(targetPath, 'public'));
|
|
113
|
+
// Copy template files
|
|
114
|
+
// Note: Client wrapper components (*Client.tsx) and documentation files are now
|
|
115
|
+
// provided by @chaaskit/client package - routes import directly from there.
|
|
116
|
+
const templates = [
|
|
117
|
+
// React Router app files
|
|
118
|
+
{ src: 'app/routes.ts', dest: 'app/routes.ts' },
|
|
119
|
+
{ src: 'app/root.tsx', dest: 'app/root.tsx' },
|
|
120
|
+
{ src: 'app/entry.client.tsx', dest: 'app/entry.client.tsx' },
|
|
121
|
+
{ src: 'app/entry.server.tsx', dest: 'app/entry.server.tsx' },
|
|
122
|
+
// ClientOnly re-export for convenience
|
|
123
|
+
{ src: 'app/components/ClientOnly.tsx', dest: 'app/components/ClientOnly.tsx' },
|
|
124
|
+
// Public routes (no basePath prefix)
|
|
125
|
+
{ src: 'app/routes/_index.tsx', dest: 'app/routes/_index.tsx' },
|
|
126
|
+
{ src: 'app/routes/login.tsx', dest: 'app/routes/login.tsx' },
|
|
127
|
+
{ src: 'app/routes/register.tsx', dest: 'app/routes/register.tsx' },
|
|
128
|
+
{ src: 'app/routes/shared.$shareId.tsx', dest: 'app/routes/shared.$shareId.tsx' },
|
|
129
|
+
{ src: 'app/routes/terms.tsx', dest: 'app/routes/terms.tsx' },
|
|
130
|
+
{ src: 'app/routes/privacy.tsx', dest: 'app/routes/privacy.tsx' },
|
|
131
|
+
{ src: 'app/routes/verify-email.tsx', dest: 'app/routes/verify-email.tsx' },
|
|
132
|
+
{ src: 'app/routes/invite.$token.tsx', dest: 'app/routes/invite.$token.tsx' },
|
|
133
|
+
{ src: 'app/routes/pricing.tsx', dest: 'app/routes/pricing.tsx' },
|
|
134
|
+
{ src: 'app/routes/oauth.consent.tsx', dest: 'app/routes/oauth.consent.tsx' },
|
|
135
|
+
// Authenticated routes (under basePath, e.g., /chat/*)
|
|
136
|
+
// Layout route that handles authentication for all chat.* routes
|
|
137
|
+
{ src: 'app/routes/chat.tsx', dest: 'app/routes/chat.tsx' },
|
|
138
|
+
{ src: 'app/routes/chat._index.tsx', dest: 'app/routes/chat._index.tsx' },
|
|
139
|
+
{ src: 'app/routes/chat.thread.$threadId.tsx', dest: 'app/routes/chat.thread.$threadId.tsx' },
|
|
140
|
+
{ src: 'app/routes/chat.api-keys.tsx', dest: 'app/routes/chat.api-keys.tsx' },
|
|
141
|
+
{ src: 'app/routes/chat.documents.tsx', dest: 'app/routes/chat.documents.tsx' },
|
|
142
|
+
{ src: 'app/routes/chat.automations.tsx', dest: 'app/routes/chat.automations.tsx' },
|
|
143
|
+
{ src: 'app/routes/chat.team.$teamId.settings.tsx', dest: 'app/routes/chat.team.$teamId.settings.tsx' },
|
|
144
|
+
{ src: 'app/routes/chat.admin._index.tsx', dest: 'app/routes/chat.admin._index.tsx' },
|
|
145
|
+
{ src: 'app/routes/chat.admin.users.tsx', dest: 'app/routes/chat.admin.users.tsx' },
|
|
146
|
+
{ src: 'app/routes/chat.admin.teams._index.tsx', dest: 'app/routes/chat.admin.teams._index.tsx' },
|
|
147
|
+
{ src: 'app/routes/chat.admin.teams.$teamId.tsx', dest: 'app/routes/chat.admin.teams.$teamId.tsx' },
|
|
148
|
+
// Config
|
|
149
|
+
{ src: 'config/app.config.ts', dest: 'config/app.config.ts' },
|
|
150
|
+
{ src: 'react-router.config.ts', dest: 'react-router.config.ts' },
|
|
151
|
+
{ src: 'vite.config.ts', dest: 'vite.config.ts' },
|
|
152
|
+
// Extensions
|
|
153
|
+
{ src: 'extensions/agents/.gitkeep', dest: 'extensions/agents/.gitkeep' },
|
|
154
|
+
{ src: 'extensions/payment-plans/.gitkeep', dest: 'extensions/payment-plans/.gitkeep' },
|
|
155
|
+
{ src: 'extensions/pages/.gitkeep', dest: 'extensions/pages/.gitkeep' },
|
|
156
|
+
// Public assets
|
|
157
|
+
{ src: 'public/logo.svg', dest: 'public/logo.svg' },
|
|
158
|
+
{ src: 'public/favicon.svg', dest: 'public/favicon.svg' },
|
|
159
|
+
// Root files
|
|
160
|
+
{
|
|
161
|
+
src: '.env.example',
|
|
162
|
+
dest: '.env.example',
|
|
163
|
+
transform: (content) => content.replace(/\{\{DB_NAME\}\}/g, toDbName(projectName)),
|
|
164
|
+
},
|
|
165
|
+
{ src: '.gitignore', dest: '.gitignore' },
|
|
166
|
+
{
|
|
167
|
+
src: 'package.json',
|
|
168
|
+
dest: 'package.json',
|
|
169
|
+
transform: (content) => content.replace(/\{\{PROJECT_NAME\}\}/g, projectName),
|
|
170
|
+
},
|
|
171
|
+
{ src: 'tsconfig.json', dest: 'tsconfig.json' },
|
|
172
|
+
{ src: 'server.js', dest: 'server.js' },
|
|
173
|
+
{ src: 'README.md', dest: 'README.md', transform: (content) => content.replace(/\{\{PROJECT_NAME\}\}/g, projectName) },
|
|
174
|
+
// Prisma
|
|
175
|
+
{ src: 'prisma/schema/base.prisma', dest: 'prisma/schema/base.prisma' },
|
|
176
|
+
{ src: 'prisma/schema/custom.prisma', dest: 'prisma/schema/custom.prisma' },
|
|
177
|
+
];
|
|
178
|
+
for (const template of templates) {
|
|
179
|
+
const srcPath = path.join(templatesPath, template.src);
|
|
180
|
+
const destPath = path.join(targetPath, template.dest);
|
|
181
|
+
if (await fs.pathExists(srcPath)) {
|
|
182
|
+
let content = await fs.readFile(srcPath, 'utf-8');
|
|
183
|
+
if (template.transform) {
|
|
184
|
+
content = template.transform(content);
|
|
185
|
+
}
|
|
186
|
+
await fs.outputFile(destPath, content);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
// Create empty file for .gitkeep files
|
|
190
|
+
if (template.src.endsWith('.gitkeep')) {
|
|
191
|
+
await fs.outputFile(destPath, '');
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function runCommand(command, args, options) {
|
|
197
|
+
return new Promise((resolve, reject) => {
|
|
198
|
+
const child = spawn(command, args, {
|
|
199
|
+
...options,
|
|
200
|
+
stdio: 'inherit',
|
|
201
|
+
shell: true,
|
|
202
|
+
});
|
|
203
|
+
child.on('close', (code) => {
|
|
204
|
+
if (code === 0) {
|
|
205
|
+
resolve();
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
reject(new Error(`Command failed with code ${code}`));
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
child.on('error', reject);
|
|
212
|
+
});
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,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,OAAe,EAAE,IAAc,EAAE,OAAwB;IAC3E,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE;YACjC,GAAG,OAAO;YACV,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACzB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBACf,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,KAAK,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC,CAAC;YACxD,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { init } from './commands/init.js';
|
|
4
|
+
import { dev } from './commands/dev.js';
|
|
5
|
+
import { build } from './commands/build.js';
|
|
6
|
+
import { dbSync } from './commands/db-sync.js';
|
|
7
|
+
import { addInfra } from './commands/add-infra.js';
|
|
8
|
+
const program = new Command();
|
|
9
|
+
program
|
|
10
|
+
.name('chaaskit')
|
|
11
|
+
.description('Create and manage ChaasKit applications')
|
|
12
|
+
.version('0.1.0');
|
|
13
|
+
// Create a new project
|
|
14
|
+
program
|
|
15
|
+
.command('create [project-name]')
|
|
16
|
+
.description('Create a new ChaasKit project')
|
|
17
|
+
.option('--template <template>', 'Template to use', 'default')
|
|
18
|
+
.option('--skip-install', 'Skip dependency installation')
|
|
19
|
+
.option('--use-npm', 'Use npm instead of pnpm')
|
|
20
|
+
.option('--use-yarn', 'Use yarn instead of pnpm')
|
|
21
|
+
.action(async (projectName, options) => {
|
|
22
|
+
await init(projectName, options);
|
|
23
|
+
});
|
|
24
|
+
// Dev server (for use inside a project)
|
|
25
|
+
program
|
|
26
|
+
.command('dev')
|
|
27
|
+
.description('Start development servers')
|
|
28
|
+
.option('-p, --port <port>', 'Backend port', '3000')
|
|
29
|
+
.option('--client-port <port>', 'Frontend port', '5173')
|
|
30
|
+
.action(async (options) => {
|
|
31
|
+
await dev(options);
|
|
32
|
+
});
|
|
33
|
+
// Build (for use inside a project)
|
|
34
|
+
program
|
|
35
|
+
.command('build')
|
|
36
|
+
.description('Build for production')
|
|
37
|
+
.action(async () => {
|
|
38
|
+
await build();
|
|
39
|
+
});
|
|
40
|
+
// Sync database schema
|
|
41
|
+
program
|
|
42
|
+
.command('db:sync')
|
|
43
|
+
.description('Sync Prisma schema from @chaaskit/db (preserves custom models)')
|
|
44
|
+
.option('-f, --force', 'Force update of modified core models')
|
|
45
|
+
.action(async (options) => {
|
|
46
|
+
await dbSync(options);
|
|
47
|
+
});
|
|
48
|
+
// Add infrastructure-as-code
|
|
49
|
+
program
|
|
50
|
+
.command('add-infra <provider>')
|
|
51
|
+
.description('Add infrastructure-as-code to your project (aws)')
|
|
52
|
+
.option('-n, --service-name <name>', 'Service name for AWS resources')
|
|
53
|
+
.action(async (provider, options) => {
|
|
54
|
+
await addInfra(provider, options);
|
|
55
|
+
});
|
|
56
|
+
program.parse();
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CA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AW,CAAC,sBAAsB,CAAC;KACnC,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,KAAK,EAAE,CAAC;AAChB,CAAC,CAAC,CAAC;AAEL,uBAAuB;AACvB,OAAO;KACJ,OAAO,CAAC,SAAS,CAAC;KAClB,WAAW,CAAC,gEAAgE,CAAC;KAC7E,MAAM,CAAC,aAAa,EAAE,sCAAsC,CAAC;KAC7D,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;AACxB,CAAC,CAAC,CAAC;AAEL,6BAA6B;AAC7B,OAAO;KACJ,OAAO,CAAC,sBAAsB,CAAC;KAC/B,WAAW,CAAC,kDAAkD,CAAC;KAC/D,MAAM,CAAC,2BAA2B,EAAE,gCAAgC,CAAC;KACrE,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IAClC,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACpC,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Application URLs
|
|
2
|
+
APP_URL=http://localhost:5173
|
|
3
|
+
API_URL=http://localhost:3000
|
|
4
|
+
|
|
5
|
+
# Database
|
|
6
|
+
DATABASE_URL="postgresql://user:password@localhost:5432/{{DB_NAME}}?schema=public"
|
|
7
|
+
|
|
8
|
+
# Authentication Secrets (generate with: openssl rand -base64 32)
|
|
9
|
+
SESSION_SECRET=your-session-secret-min-32-characters-here
|
|
10
|
+
JWT_SECRET=your-jwt-secret-min-32-characters-here
|
|
11
|
+
|
|
12
|
+
# AI Provider (at least one required)
|
|
13
|
+
OPENAI_API_KEY=
|
|
14
|
+
ANTHROPIC_API_KEY=
|
|
15
|
+
|
|
16
|
+
# Optional: Stripe (for payments)
|
|
17
|
+
STRIPE_SECRET_KEY=
|
|
18
|
+
STRIPE_WEBHOOK_SECRET=
|
|
19
|
+
|
|
20
|
+
# Optional: OAuth Providers
|
|
21
|
+
GOOGLE_CLIENT_ID=
|
|
22
|
+
GOOGLE_CLIENT_SECRET=
|
|
23
|
+
GITHUB_CLIENT_ID=
|
|
24
|
+
GITHUB_CLIENT_SECRET=
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
AI-powered chat application built with ChaasKit.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
1. **Install dependencies**
|
|
8
|
+
```bash
|
|
9
|
+
pnpm install
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
2. **Configure environment**
|
|
13
|
+
```bash
|
|
14
|
+
cp .env.example .env
|
|
15
|
+
# Edit .env with your API keys and database URL
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
3. **Setup database**
|
|
19
|
+
```bash
|
|
20
|
+
pnpm db:push
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
4. **Start development**
|
|
24
|
+
```bash
|
|
25
|
+
pnpm dev
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Configuration
|
|
29
|
+
|
|
30
|
+
Edit `config/app.config.ts` to customize:
|
|
31
|
+
- App name and branding
|
|
32
|
+
- Theme colors
|
|
33
|
+
- Authentication methods
|
|
34
|
+
- AI provider and model
|
|
35
|
+
- Payment plans
|
|
36
|
+
- And more...
|
|
37
|
+
|
|
38
|
+
## Extensions
|
|
39
|
+
|
|
40
|
+
Add custom functionality in the `extensions/` directory:
|
|
41
|
+
|
|
42
|
+
- `extensions/agents/` - Custom AI agents
|
|
43
|
+
- `extensions/payment-plans/` - Custom pricing plans
|
|
44
|
+
- `extensions/pages/` - Custom pages for the frontend
|
|
45
|
+
|
|
46
|
+
## Commands
|
|
47
|
+
|
|
48
|
+
- `pnpm dev` - Start development servers
|
|
49
|
+
- `pnpm build` - Build for production
|
|
50
|
+
- `pnpm start` - Start production server
|
|
51
|
+
- `pnpm db:push` - Push database schema
|
|
52
|
+
- `pnpm db:studio` - Open database GUI
|
|
53
|
+
|
|
54
|
+
## Using Local/Development Packages
|
|
55
|
+
|
|
56
|
+
To test unreleased features or contribute to the core packages:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Clone the monorepo
|
|
60
|
+
git clone https://github.com/your-repo/chaaskit
|
|
61
|
+
cd chaaskit
|
|
62
|
+
|
|
63
|
+
# Build and link packages globally
|
|
64
|
+
pnpm build
|
|
65
|
+
pnpm -r exec pnpm link --global
|
|
66
|
+
|
|
67
|
+
# In your project directory, link the local packages
|
|
68
|
+
cd /path/to/your-project
|
|
69
|
+
pnpm link --global @chaaskit/server @chaaskit/client @chaaskit/db @chaaskit/shared
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
After making changes to the monorepo, rebuild to update linked packages:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
cd /path/to/chaaskit
|
|
76
|
+
pnpm build
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Documentation
|
|
80
|
+
|
|
81
|
+
For full documentation, see the `docs/` directory or visit the [ChaasKit docs](https://github.com/your-repo/chat-saas).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Client-only component for Automations (Scheduled Prompts) page
|
|
2
|
+
import { ChatProviders, ScheduledPromptsPage } from '@chaaskit/client';
|
|
3
|
+
|
|
4
|
+
export default function AutomationsClient() {
|
|
5
|
+
return (
|
|
6
|
+
<ChatProviders>
|
|
7
|
+
<ScheduledPromptsPage />
|
|
8
|
+
</ChatProviders>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file is only imported on the client side via dynamic import
|
|
2
|
+
// It uses @chaaskit/client components directly
|
|
3
|
+
import { ChatProviders, MainLayout, ChatPage } from '@chaaskit/client';
|
|
4
|
+
|
|
5
|
+
export default function ChatClient() {
|
|
6
|
+
return (
|
|
7
|
+
<ChatProviders>
|
|
8
|
+
<MainLayout>
|
|
9
|
+
<ChatPage />
|
|
10
|
+
</MainLayout>
|
|
11
|
+
</ChatProviders>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export ClientOnly from @chaaskit/client/ssr-utils for convenience.
|
|
3
|
+
* This allows routes to import from local components if needed.
|
|
4
|
+
* Uses ssr-utils to avoid pulling in browser-only dependencies during SSR.
|
|
5
|
+
*/
|
|
6
|
+
export { ClientOnly } from '@chaaskit/client/ssr-utils';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { startTransition, StrictMode } from 'react';
|
|
2
|
+
import { hydrateRoot } from 'react-dom/client';
|
|
3
|
+
import { HydratedRouter } from 'react-router/dom';
|
|
4
|
+
|
|
5
|
+
startTransition(() => {
|
|
6
|
+
hydrateRoot(
|
|
7
|
+
document,
|
|
8
|
+
<StrictMode>
|
|
9
|
+
<HydratedRouter />
|
|
10
|
+
</StrictMode>
|
|
11
|
+
);
|
|
12
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PassThrough } from 'node:stream';
|
|
2
|
+
import { isbot } from 'isbot';
|
|
3
|
+
import { renderToPipeableStream } from 'react-dom/server';
|
|
4
|
+
import { ServerRouter } from 'react-router';
|
|
5
|
+
import { createReadableStreamFromReadable } from '@react-router/node';
|
|
6
|
+
import type { EntryContext } from 'react-router';
|
|
7
|
+
|
|
8
|
+
const ABORT_DELAY = 5_000;
|
|
9
|
+
|
|
10
|
+
export default function handleRequest(
|
|
11
|
+
request: Request,
|
|
12
|
+
responseStatusCode: number,
|
|
13
|
+
responseHeaders: Headers,
|
|
14
|
+
routerContext: EntryContext
|
|
15
|
+
) {
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
let shellRendered = false;
|
|
18
|
+
const userAgent = request.headers.get('user-agent');
|
|
19
|
+
const isBotRequest = userAgent && isbot(userAgent);
|
|
20
|
+
|
|
21
|
+
const { pipe, abort } = renderToPipeableStream(
|
|
22
|
+
<ServerRouter context={routerContext} url={request.url} />,
|
|
23
|
+
{
|
|
24
|
+
onShellReady() {
|
|
25
|
+
shellRendered = true;
|
|
26
|
+
// For bots, wait for onAllReady instead
|
|
27
|
+
if (!isBotRequest) {
|
|
28
|
+
const body = new PassThrough();
|
|
29
|
+
responseHeaders.set('Content-Type', 'text/html');
|
|
30
|
+
resolve(
|
|
31
|
+
new Response(createReadableStreamFromReadable(body), {
|
|
32
|
+
headers: responseHeaders,
|
|
33
|
+
status: responseStatusCode,
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
pipe(body);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
onAllReady() {
|
|
40
|
+
// For bots, send the full rendered content
|
|
41
|
+
if (isBotRequest) {
|
|
42
|
+
const body = new PassThrough();
|
|
43
|
+
responseHeaders.set('Content-Type', 'text/html');
|
|
44
|
+
resolve(
|
|
45
|
+
new Response(createReadableStreamFromReadable(body), {
|
|
46
|
+
headers: responseHeaders,
|
|
47
|
+
status: responseStatusCode,
|
|
48
|
+
})
|
|
49
|
+
);
|
|
50
|
+
pipe(body);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
onShellError(error: unknown) {
|
|
54
|
+
reject(error);
|
|
55
|
+
},
|
|
56
|
+
onError(error: unknown) {
|
|
57
|
+
responseStatusCode = 500;
|
|
58
|
+
if (shellRendered) {
|
|
59
|
+
console.error(error);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
setTimeout(abort, ABORT_DELAY);
|
|
66
|
+
});
|
|
67
|
+
}
|