@ahmadubaidillah/cli 1.1.0 → 1.1.2
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/bin.js +289 -276
- package/dist/templates/ai_wrapper/files/README.md +3 -0
- package/dist/templates/ai_wrapper/files/package.json +16 -0
- package/dist/templates/ai_wrapper/files/src/app.ts +23 -0
- package/dist/templates/ai_wrapper/files/src/modules/prompts/prompts.routes.ts +64 -0
- package/dist/templates/ai_wrapper/files/src/modules/usage/usage.routes.ts +12 -0
- package/dist/templates/ai_wrapper/template.config.json +16 -0
- package/dist/templates/booking/files/README.md +3 -0
- package/dist/templates/booking/files/package.json +16 -0
- package/dist/templates/booking/files/src/app.ts +23 -0
- package/dist/templates/booking/files/src/modules/availability/availability.routes.ts +12 -0
- package/dist/templates/booking/files/src/modules/calendar/calendar.routes.ts +12 -0
- package/dist/templates/booking/template.config.json +17 -0
- package/dist/templates/cms/files/frontend/src/components/editor/Editor.tsx +36 -0
- package/dist/templates/cms/files/package.json +22 -0
- package/dist/templates/cms/files/src/app.ts +23 -0
- package/dist/templates/cms/files/src/modules/media/media.routes.ts +26 -0
- package/dist/templates/cms/files/src/modules/posts/post.routes.ts +33 -0
- package/dist/templates/cms/template.config.json +17 -0
- package/dist/templates/crm/files/README.md +3 -0
- package/dist/templates/crm/files/package.json +16 -0
- package/dist/templates/crm/files/src/app.ts +23 -0
- package/dist/templates/crm/files/src/modules/contacts/contacts.routes.ts +12 -0
- package/dist/templates/crm/files/src/modules/pipelines/pipelines.routes.ts +12 -0
- package/dist/templates/crm/template.config.json +19 -0
- package/dist/templates/finance/files/README.md +3 -0
- package/dist/templates/finance/files/package.json +16 -0
- package/dist/templates/finance/files/src/app.ts +23 -0
- package/dist/templates/finance/files/src/modules/reports/reports.routes.ts +12 -0
- package/dist/templates/finance/files/src/modules/transactions/transactions.routes.ts +12 -0
- package/dist/templates/finance/template.config.json +15 -0
- package/dist/templates/landing/files/README.md +10 -0
- package/dist/templates/landing/files/package.json +17 -0
- package/dist/templates/landing/template.config.json +15 -0
- package/dist/templates/marketplace/files/README.md +3 -0
- package/dist/templates/marketplace/files/package.json +16 -0
- package/dist/templates/marketplace/files/src/app.ts +25 -0
- package/dist/templates/marketplace/files/src/modules/orders/orders.routes.ts +12 -0
- package/dist/templates/marketplace/files/src/modules/products/products.routes.ts +12 -0
- package/dist/templates/marketplace/files/src/modules/vendors/vendors.routes.ts +12 -0
- package/dist/templates/marketplace/template.config.json +25 -0
- package/dist/templates/preact/files/package.json +18 -0
- package/dist/templates/preact/files/src/main.jsx +4 -0
- package/dist/templates/preact/template.config.json +11 -0
- package/dist/templates/saas/files/package.json +24 -0
- package/dist/templates/saas/files/playwright.config.ts +25 -0
- package/dist/templates/saas/files/src/app.ts +32 -0
- package/dist/templates/saas/files/src/core/env.ts +24 -0
- package/dist/templates/saas/files/src/core/errors.ts +39 -0
- package/dist/templates/saas/files/src/modules/users/repositories/user.repository.ts +25 -0
- package/dist/templates/saas/files/src/modules/users/routes/user.routes.ts +33 -0
- package/dist/templates/saas/files/src/modules/users/services/user.service.ts +24 -0
- package/dist/templates/saas/files/src/modules/users/validators/user.validator.ts +17 -0
- package/dist/templates/saas/files/tests/e2e/basic.spec.ts +13 -0
- package/dist/templates/saas/template.config.json +26 -0
- package/dist/templates/templates/ai_wrapper/files/README.md +3 -0
- package/dist/templates/templates/ai_wrapper/files/package.json +16 -0
- package/dist/templates/templates/ai_wrapper/files/src/app.ts +23 -0
- package/dist/templates/templates/ai_wrapper/files/src/modules/prompts/prompts.routes.ts +64 -0
- package/dist/templates/templates/ai_wrapper/files/src/modules/usage/usage.routes.ts +12 -0
- package/dist/templates/templates/ai_wrapper/template.config.json +16 -0
- package/dist/templates/templates/booking/files/README.md +3 -0
- package/dist/templates/templates/booking/files/package.json +16 -0
- package/dist/templates/templates/booking/files/src/app.ts +23 -0
- package/dist/templates/templates/booking/files/src/modules/availability/availability.routes.ts +12 -0
- package/dist/templates/templates/booking/files/src/modules/calendar/calendar.routes.ts +12 -0
- package/dist/templates/templates/booking/template.config.json +17 -0
- package/dist/templates/templates/cms/files/frontend/src/components/editor/Editor.tsx +36 -0
- package/dist/templates/templates/cms/files/package.json +22 -0
- package/dist/templates/templates/cms/files/src/app.ts +23 -0
- package/dist/templates/templates/cms/files/src/modules/media/media.routes.ts +26 -0
- package/dist/templates/templates/cms/files/src/modules/posts/post.routes.ts +33 -0
- package/dist/templates/templates/cms/template.config.json +17 -0
- package/dist/templates/templates/crm/files/README.md +3 -0
- package/dist/templates/templates/crm/files/package.json +16 -0
- package/dist/templates/templates/crm/files/src/app.ts +23 -0
- package/dist/templates/templates/crm/files/src/modules/contacts/contacts.routes.ts +12 -0
- package/dist/templates/templates/crm/files/src/modules/pipelines/pipelines.routes.ts +12 -0
- package/dist/templates/templates/crm/template.config.json +19 -0
- package/dist/templates/templates/finance/files/README.md +3 -0
- package/dist/templates/templates/finance/files/package.json +16 -0
- package/dist/templates/templates/finance/files/src/app.ts +23 -0
- package/dist/templates/templates/finance/files/src/modules/reports/reports.routes.ts +12 -0
- package/dist/templates/templates/finance/files/src/modules/transactions/transactions.routes.ts +12 -0
- package/dist/templates/templates/finance/template.config.json +15 -0
- package/dist/templates/templates/landing/files/README.md +10 -0
- package/dist/templates/templates/landing/files/package.json +17 -0
- package/dist/templates/templates/landing/template.config.json +15 -0
- package/dist/templates/templates/marketplace/files/README.md +3 -0
- package/dist/templates/templates/marketplace/files/package.json +16 -0
- package/dist/templates/templates/marketplace/files/src/app.ts +25 -0
- package/dist/templates/templates/marketplace/files/src/modules/orders/orders.routes.ts +12 -0
- package/dist/templates/templates/marketplace/files/src/modules/products/products.routes.ts +12 -0
- package/dist/templates/templates/marketplace/files/src/modules/vendors/vendors.routes.ts +12 -0
- package/dist/templates/templates/marketplace/template.config.json +25 -0
- package/dist/templates/templates/preact/files/package.json +18 -0
- package/dist/templates/templates/preact/files/src/main.jsx +4 -0
- package/dist/templates/templates/preact/template.config.json +11 -0
- package/dist/templates/templates/saas/files/package.json +24 -0
- package/dist/templates/templates/saas/files/playwright.config.ts +25 -0
- package/dist/templates/templates/saas/files/src/app.ts +32 -0
- package/dist/templates/templates/saas/files/src/core/env.ts +24 -0
- package/dist/templates/templates/saas/files/src/core/errors.ts +39 -0
- package/dist/templates/templates/saas/files/src/modules/users/repositories/user.repository.ts +25 -0
- package/dist/templates/templates/saas/files/src/modules/users/routes/user.routes.ts +33 -0
- package/dist/templates/templates/saas/files/src/modules/users/services/user.service.ts +24 -0
- package/dist/templates/templates/saas/files/src/modules/users/validators/user.validator.ts +17 -0
- package/dist/templates/templates/saas/files/tests/e2e/basic.spec.ts +13 -0
- package/dist/templates/templates/saas/template.config.json +26 -0
- package/package.json +2 -2
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createSignal, onMount } from 'solid-js';
|
|
2
|
+
import { Editor } from '@tiptap/core';
|
|
3
|
+
import StarterKit from '@tiptap/starter-kit';
|
|
4
|
+
|
|
5
|
+
export function TipTapEditor(props: { initialContent: string; onSave: (content: string) => void }) {
|
|
6
|
+
let editorElement: HTMLDivElement;
|
|
7
|
+
const [editor, setEditor] = createSignal<Editor | null>(null);
|
|
8
|
+
|
|
9
|
+
onMount(() => {
|
|
10
|
+
const tiptapEditor = new Editor({
|
|
11
|
+
element: editorElement,
|
|
12
|
+
extensions: [StarterKit],
|
|
13
|
+
content: props.initialContent || '<p>Hello World!</p>',
|
|
14
|
+
onUpdate: ({ editor }) => {
|
|
15
|
+
props.onSave(editor.getHTML());
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
setEditor(tiptapEditor);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div class="tiptap-editor-container bg-white p-4 border rounded shadow-sm">
|
|
23
|
+
<div ref={editorElement!} class="prose max-w-none min-h-[300px] focus:outline-none" />
|
|
24
|
+
<button
|
|
25
|
+
class="mt-4 px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 font-semibold transition"
|
|
26
|
+
onClick={() => {
|
|
27
|
+
if (editor()) {
|
|
28
|
+
props.onSave(editor()!.getHTML());
|
|
29
|
+
}
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
Save Post
|
|
33
|
+
</button>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{PROJECT_NAME}}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "bun run --hot src/app.ts",
|
|
7
|
+
"start": "bun run src/app.ts",
|
|
8
|
+
"build": "bun build ./src/app.ts --outdir ./dist"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"hono": "latest",
|
|
12
|
+
"zod": "latest",
|
|
13
|
+
"drizzle-orm": "latest",
|
|
14
|
+
"postgres": "latest",
|
|
15
|
+
"@tiptap/core": "latest",
|
|
16
|
+
"@tiptap/pm": "latest",
|
|
17
|
+
"@tiptap/starter-kit": "latest"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"drizzle-kit": "latest"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { logger } from 'hono/logger';
|
|
3
|
+
import { postRoutes } from './modules/posts/post.routes';
|
|
4
|
+
import { mediaRoutes } from './modules/media/media.routes';
|
|
5
|
+
|
|
6
|
+
const app = new Hono();
|
|
7
|
+
|
|
8
|
+
app.use('*', logger());
|
|
9
|
+
|
|
10
|
+
app.get('/', (c) => {
|
|
11
|
+
return c.json({
|
|
12
|
+
message: 'Welcome to {{PROJECT_NAME}} CMS - Powered by DevForge',
|
|
13
|
+
status: 'running'
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
app.route('/posts', postRoutes);
|
|
18
|
+
app.route('/media', mediaRoutes);
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
port: 3000,
|
|
22
|
+
fetch: app.fetch,
|
|
23
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
|
|
3
|
+
export const mediaRoutes = new Hono();
|
|
4
|
+
|
|
5
|
+
// List all media
|
|
6
|
+
mediaRoutes.get('/', (c) => {
|
|
7
|
+
return c.json({ media: [] });
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// Upload media
|
|
11
|
+
mediaRoutes.post('/upload', async (c) => {
|
|
12
|
+
const body = await c.req.parseBody();
|
|
13
|
+
const file = body['file'];
|
|
14
|
+
|
|
15
|
+
if (!file) {
|
|
16
|
+
return c.json({ error: 'File is required' }, 400);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return c.json({ message: 'Media uploaded', filename: file });
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Delete media
|
|
23
|
+
mediaRoutes.delete('/:id', (c) => {
|
|
24
|
+
const id = c.req.param('id');
|
|
25
|
+
return c.json({ message: 'Media deleted', id });
|
|
26
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
|
|
3
|
+
export const postRoutes = new Hono();
|
|
4
|
+
|
|
5
|
+
// List all posts
|
|
6
|
+
postRoutes.get('/', (c) => {
|
|
7
|
+
return c.json({ posts: [] });
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// Create a new post
|
|
11
|
+
postRoutes.post('/', async (c) => {
|
|
12
|
+
const body = await c.req.json();
|
|
13
|
+
return c.json({ message: 'Post created', data: body });
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// Get a single post by ID
|
|
17
|
+
postRoutes.get('/:id', (c) => {
|
|
18
|
+
const id = c.req.param('id');
|
|
19
|
+
return c.json({ id, title: 'Sample Post', content: '<p>Sample Content</p>' });
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Update a post
|
|
23
|
+
postRoutes.put('/:id', async (c) => {
|
|
24
|
+
const id = c.req.param('id');
|
|
25
|
+
const body = await c.req.json();
|
|
26
|
+
return c.json({ message: 'Post updated', id, data: body });
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Delete a post
|
|
30
|
+
postRoutes.delete('/:id', (c) => {
|
|
31
|
+
const id = c.req.param('id');
|
|
32
|
+
return c.json({ message: 'Post deleted', id });
|
|
33
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cms",
|
|
3
|
+
"description": "Content Management System with TipTap editor, media library, and post management.",
|
|
4
|
+
"stack": {
|
|
5
|
+
"runtime": "bun",
|
|
6
|
+
"backend": "hono",
|
|
7
|
+
"frontend": "solidjs",
|
|
8
|
+
"database": "postgres"
|
|
9
|
+
},
|
|
10
|
+
"supportedPlugins": [
|
|
11
|
+
"auth",
|
|
12
|
+
"email",
|
|
13
|
+
"analytics",
|
|
14
|
+
"file-upload",
|
|
15
|
+
"github-actions"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{PROJECT_NAME}}-crm",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "bun run --hot src/app.ts",
|
|
7
|
+
"start": "bun run src/app.ts",
|
|
8
|
+
"build": "bun build ./src/app.ts --outdir ./dist"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"hono": "latest",
|
|
12
|
+
"zod": "latest",
|
|
13
|
+
"drizzle-orm": "latest",
|
|
14
|
+
"postgres": "latest"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { logger } from 'hono/logger';
|
|
3
|
+
import { contactsRoutes } from './modules/contacts/contacts.routes';
|
|
4
|
+
import { pipelinesRoutes } from './modules/pipelines/pipelines.routes';
|
|
5
|
+
|
|
6
|
+
const app = new Hono();
|
|
7
|
+
|
|
8
|
+
app.use('*', logger());
|
|
9
|
+
|
|
10
|
+
app.get('/', (c) => {
|
|
11
|
+
return c.json({
|
|
12
|
+
message: 'Welcome to {{PROJECT_NAME}} CRM - Powered by DevForge',
|
|
13
|
+
status: 'running'
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
app.route('/contacts', contactsRoutes);
|
|
18
|
+
app.route('/pipelines', pipelinesRoutes);
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
port: 3000,
|
|
22
|
+
fetch: app.fetch,
|
|
23
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
|
|
3
|
+
export const contactsRoutes = new Hono();
|
|
4
|
+
|
|
5
|
+
contactsRoutes.get('/', (c) => {
|
|
6
|
+
return c.json({ data: [], module: 'contacts' });
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
contactsRoutes.post('/', async (c) => {
|
|
10
|
+
const body = await c.req.json();
|
|
11
|
+
return c.json({ message: 'contacts created', data: body });
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
|
|
3
|
+
export const pipelinesRoutes = new Hono();
|
|
4
|
+
|
|
5
|
+
pipelinesRoutes.get('/', (c) => {
|
|
6
|
+
return c.json({ data: [], module: 'pipelines' });
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
pipelinesRoutes.post('/', async (c) => {
|
|
10
|
+
const body = await c.req.json();
|
|
11
|
+
return c.json({ message: 'pipelines created', data: body });
|
|
12
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "crm",
|
|
3
|
+
"description": "Customer Relationship Management system for leads and pipelines.",
|
|
4
|
+
"stack": {
|
|
5
|
+
"runtime": "bun",
|
|
6
|
+
"backend": "hono",
|
|
7
|
+
"frontend": "solidjs",
|
|
8
|
+
"database": "postgres"
|
|
9
|
+
},
|
|
10
|
+
"supportedPlugins": [
|
|
11
|
+
"openapi",
|
|
12
|
+
"websocket",
|
|
13
|
+
"queue",
|
|
14
|
+
"auth",
|
|
15
|
+
"email",
|
|
16
|
+
"analytics",
|
|
17
|
+
"github-actions"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{PROJECT_NAME}}-finance",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "bun run --hot src/app.ts",
|
|
7
|
+
"start": "bun run src/app.ts",
|
|
8
|
+
"build": "bun build ./src/app.ts --outdir ./dist"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"hono": "latest",
|
|
12
|
+
"zod": "latest",
|
|
13
|
+
"drizzle-orm": "latest",
|
|
14
|
+
"postgres": "latest"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { logger } from 'hono/logger';
|
|
3
|
+
import { transactionsRoutes } from './modules/transactions/transactions.routes';
|
|
4
|
+
import { reportsRoutes } from './modules/reports/reports.routes';
|
|
5
|
+
|
|
6
|
+
const app = new Hono();
|
|
7
|
+
|
|
8
|
+
app.use('*', logger());
|
|
9
|
+
|
|
10
|
+
app.get('/', (c) => {
|
|
11
|
+
return c.json({
|
|
12
|
+
message: 'Welcome to {{PROJECT_NAME}} FINANCE - Powered by DevForge',
|
|
13
|
+
status: 'running'
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
app.route('/transactions', transactionsRoutes);
|
|
18
|
+
app.route('/reports', reportsRoutes);
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
port: 3000,
|
|
22
|
+
fetch: app.fetch,
|
|
23
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
|
|
3
|
+
export const reportsRoutes = new Hono();
|
|
4
|
+
|
|
5
|
+
reportsRoutes.get('/', (c) => {
|
|
6
|
+
return c.json({ data: [], module: 'reports' });
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
reportsRoutes.post('/', async (c) => {
|
|
10
|
+
const body = await c.req.json();
|
|
11
|
+
return c.json({ message: 'reports created', data: body });
|
|
12
|
+
});
|
package/dist/templates/templates/finance/files/src/modules/transactions/transactions.routes.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
|
|
3
|
+
export const transactionsRoutes = new Hono();
|
|
4
|
+
|
|
5
|
+
transactionsRoutes.get('/', (c) => {
|
|
6
|
+
return c.json({ data: [], module: 'transactions' });
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
transactionsRoutes.post('/', async (c) => {
|
|
10
|
+
const body = await c.req.json();
|
|
11
|
+
return c.json({ message: 'transactions created', data: body });
|
|
12
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "finance",
|
|
3
|
+
"description": "Expense tracker and finance dashboard.",
|
|
4
|
+
"stack": {
|
|
5
|
+
"runtime": "bun",
|
|
6
|
+
"backend": "hono",
|
|
7
|
+
"frontend": "solidjs",
|
|
8
|
+
"database": "postgres"
|
|
9
|
+
},
|
|
10
|
+
"supportedPlugins": [
|
|
11
|
+
"auth",
|
|
12
|
+
"analytics",
|
|
13
|
+
"github-actions"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{PROJECT_NAME}}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"dev": "astro dev",
|
|
6
|
+
"start": "astro dev",
|
|
7
|
+
"build": "astro build",
|
|
8
|
+
"preview": "astro preview",
|
|
9
|
+
"astro": "astro"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"astro": "latest",
|
|
13
|
+
"@astrojs/tailwind": "latest",
|
|
14
|
+
"tailwindcss": "latest",
|
|
15
|
+
"alpinejs": "latest"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "landing",
|
|
3
|
+
"description": "Marketing websites and product landing pages",
|
|
4
|
+
"stack": {
|
|
5
|
+
"runtime": "bun",
|
|
6
|
+
"frontend": "astro",
|
|
7
|
+
"css": "tailwindcss",
|
|
8
|
+
"interactivity": "alpinejs"
|
|
9
|
+
},
|
|
10
|
+
"supportedPlugins": [
|
|
11
|
+
"analytics",
|
|
12
|
+
"email",
|
|
13
|
+
"github-actions"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{PROJECT_NAME}}-marketplace",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "bun run --hot src/app.ts",
|
|
7
|
+
"start": "bun run src/app.ts",
|
|
8
|
+
"build": "bun build ./src/app.ts --outdir ./dist"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"hono": "latest",
|
|
12
|
+
"zod": "latest",
|
|
13
|
+
"drizzle-orm": "latest",
|
|
14
|
+
"postgres": "latest"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { logger } from 'hono/logger';
|
|
3
|
+
import { productsRoutes } from './modules/products/products.routes';
|
|
4
|
+
import { ordersRoutes } from './modules/orders/orders.routes';
|
|
5
|
+
import { vendorsRoutes } from './modules/vendors/vendors.routes';
|
|
6
|
+
|
|
7
|
+
const app = new Hono();
|
|
8
|
+
|
|
9
|
+
app.use('*', logger());
|
|
10
|
+
|
|
11
|
+
app.get('/', (c) => {
|
|
12
|
+
return c.json({
|
|
13
|
+
message: 'Welcome to {{PROJECT_NAME}} MARKETPLACE - Powered by DevForge',
|
|
14
|
+
status: 'running'
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
app.route('/products', productsRoutes);
|
|
19
|
+
app.route('/orders', ordersRoutes);
|
|
20
|
+
app.route('/vendors', vendorsRoutes);
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
port: 3000,
|
|
24
|
+
fetch: app.fetch,
|
|
25
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
|
|
3
|
+
export const ordersRoutes = new Hono();
|
|
4
|
+
|
|
5
|
+
ordersRoutes.get('/', (c) => {
|
|
6
|
+
return c.json({ data: [], module: 'orders' });
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
ordersRoutes.post('/', async (c) => {
|
|
10
|
+
const body = await c.req.json();
|
|
11
|
+
return c.json({ message: 'orders created', data: body });
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
|
|
3
|
+
export const productsRoutes = new Hono();
|
|
4
|
+
|
|
5
|
+
productsRoutes.get('/', (c) => {
|
|
6
|
+
return c.json({ data: [], module: 'products' });
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
productsRoutes.post('/', async (c) => {
|
|
10
|
+
const body = await c.req.json();
|
|
11
|
+
return c.json({ message: 'products created', data: body });
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
|
|
3
|
+
export const vendorsRoutes = new Hono();
|
|
4
|
+
|
|
5
|
+
vendorsRoutes.get('/', (c) => {
|
|
6
|
+
return c.json({ data: [], module: 'vendors' });
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
vendorsRoutes.post('/', async (c) => {
|
|
10
|
+
const body = await c.req.json();
|
|
11
|
+
return c.json({ message: 'vendors created', data: body });
|
|
12
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "marketplace",
|
|
3
|
+
"description": "Multi-vendor ecommerce / digital marketplace platform.",
|
|
4
|
+
"stack": {
|
|
5
|
+
"runtime": "bun",
|
|
6
|
+
"backend": "hono",
|
|
7
|
+
"frontend": "solidjs",
|
|
8
|
+
"database": "postgres"
|
|
9
|
+
},
|
|
10
|
+
"supportedPlugins": [
|
|
11
|
+
"admin-panel",
|
|
12
|
+
"openapi",
|
|
13
|
+
"websocket",
|
|
14
|
+
"queue",
|
|
15
|
+
"openapi",
|
|
16
|
+
"websocket",
|
|
17
|
+
"queue",
|
|
18
|
+
"auth",
|
|
19
|
+
"payment",
|
|
20
|
+
"email",
|
|
21
|
+
"search",
|
|
22
|
+
"file-upload",
|
|
23
|
+
"github-actions"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "devforge-preact-app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"preact": "latest"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@preact/preset-vite": "latest",
|
|
16
|
+
"vite": "latest"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "devforge-saas-app",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "bun run --hot src/app.ts",
|
|
7
|
+
"start": "bun run src/app.ts",
|
|
8
|
+
"build": "bun build ./src/app.ts --outdir ./dist",
|
|
9
|
+
"db:push": "drizzle-kit push",
|
|
10
|
+
"db:studio": "drizzle-kit studio",
|
|
11
|
+
"test:e2e": "playwright test"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"hono": "latest",
|
|
15
|
+
"zod": "latest",
|
|
16
|
+
"drizzle-orm": "latest",
|
|
17
|
+
"postgres": "latest",
|
|
18
|
+
"@better-auth/hono": "latest"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"drizzle-kit": "latest",
|
|
22
|
+
"@playwright/test": "latest"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineConfig, devices } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
testDir: './tests/e2e',
|
|
5
|
+
fullyParallel: true,
|
|
6
|
+
forbidOnly: !!process.env.CI,
|
|
7
|
+
retries: process.env.CI ? 2 : 0,
|
|
8
|
+
workers: process.env.CI ? 1 : undefined,
|
|
9
|
+
reporter: 'html',
|
|
10
|
+
use: {
|
|
11
|
+
baseURL: 'http://localhost:3000',
|
|
12
|
+
trace: 'on-first-retry',
|
|
13
|
+
},
|
|
14
|
+
projects: [
|
|
15
|
+
{
|
|
16
|
+
name: 'chromium',
|
|
17
|
+
use: { ...devices['Desktop Chrome'] },
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
webServer: {
|
|
21
|
+
command: 'bun run dev',
|
|
22
|
+
url: 'http://localhost:3000',
|
|
23
|
+
reuseExistingServer: !process.env.CI,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { logger } from 'hono/logger';
|
|
3
|
+
import { cors } from 'hono/cors';
|
|
4
|
+
import { env } from './core/env';
|
|
5
|
+
import { errorHandler } from './core/errors';
|
|
6
|
+
import { userRoutes } from './modules/users/routes/user.routes';
|
|
7
|
+
|
|
8
|
+
const app = new Hono();
|
|
9
|
+
|
|
10
|
+
// Global Middleware
|
|
11
|
+
app.use('*', logger());
|
|
12
|
+
app.use('*', cors());
|
|
13
|
+
|
|
14
|
+
// Health Check
|
|
15
|
+
app.get('/', (c) => {
|
|
16
|
+
return c.json({
|
|
17
|
+
message: 'Welcome to {{PROJECT_NAME}} - Powered by DevForge',
|
|
18
|
+
status: 'running',
|
|
19
|
+
version: '1.0.0'
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Feature Routes
|
|
24
|
+
app.route('/api/users', userRoutes);
|
|
25
|
+
|
|
26
|
+
// Error Handling
|
|
27
|
+
app.onError(errorHandler);
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
port: parseInt(env.PORT),
|
|
31
|
+
fetch: app.fetch,
|
|
32
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const envSchema = z.object({
|
|
4
|
+
DATABASE_URL: z.string().url(),
|
|
5
|
+
BETTER_AUTH_SECRET: z.string().min(32),
|
|
6
|
+
BETTER_AUTH_URL: z.string().url(),
|
|
7
|
+
NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
|
|
8
|
+
PORT: z.string().default('3000'),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type Env = z.infer<typeof envSchema>;
|
|
12
|
+
|
|
13
|
+
export function validateEnv() {
|
|
14
|
+
const result = envSchema.safeParse(process.env);
|
|
15
|
+
|
|
16
|
+
if (!result.success) {
|
|
17
|
+
console.error('❌ Invalid environment variables:', result.error.format());
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return result.data;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const env = validateEnv();
|