Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e5f384c
remove
ZHallen122 Feb 17, 2025
1a23c41
update safe check
ZHallen122 Feb 18, 2025
bde7d4c
Update template
ZHallen122 Feb 21, 2025
28c9814
update for using shadcn
ZHallen122 Feb 22, 2025
7c318a8
feat(frontend): Code Engine preview, support preview project right no…
NarwhalChen Feb 19, 2025
8860ae1
chore: little fixing in code engine (#126)
Sma1lboy Feb 19, 2025
e0f6903
feat(monitor): enhance execution monitoring with detailed node metric…
Sma1lboy Feb 19, 2025
090797d
Merge remote-tracking branch 'origin/main' into feat-React-CSS-Compon…
ZHallen122 Feb 26, 2025
45ad0e1
[autofix.ci] apply automated fixes
autofix-ci[bot] Feb 26, 2025
5b993f2
update prompt for shadcn, reponse design and merge list
ZHallen122 Feb 27, 2025
aa094e6
dont tell a exmaple may get a better result
ZHallen122 Feb 27, 2025
23171a3
Merge branch 'main' into feat-React-CSS-Components-Lib
Sma1lboy Mar 2, 2025
7db47da
feat(backend): update project description and enhance global componen…
Sma1lboy Mar 2, 2025
d75d50e
feat(frontend): enhance prompt guidelines with detailed design and or…
Sma1lboy Mar 9, 2025
eb9cbd8
fix file arch reference ui incorrect
ZHallen122 Mar 11, 2025
6a97fe1
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 11, 2025
9cffc85
UIUX handler
ZHallen122 Mar 12, 2025
190512f
Add product requirement
ZHallen122 Mar 13, 2025
71ab5cd
Merge branch 'feat-React-CSS-Components-Lib' of https://github.com/Sm…
ZHallen122 Mar 13, 2025
1ae1703
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 13, 2025
53795a2
update import
ZHallen122 Mar 13, 2025
1e0ffc9
Merge branch 'feat-React-CSS-Components-Lib' of https://github.com/Sm…
ZHallen122 Mar 13, 2025
38e34d6
test
ZHallen122 Mar 13, 2025
117ace2
update
ZHallen122 Mar 13, 2025
02177d0
update
ZHallen122 Mar 14, 2025
9ed1ea7
improve prompt
ZHallen122 Mar 15, 2025
d8fc801
update
ZHallen122 Mar 15, 2025
0dc830f
update prompts
ZHallen122 Mar 15, 2025
99c5fb5
add package
ZHallen122 Mar 15, 2025
97f8771
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 15, 2025
2f1ac00
UIUX with calude
ZHallen122 Mar 15, 2025
c1679a8
[autofix.ci] apply automated fixes
autofix-ci[bot] Mar 15, 2025
29e3814
update frontend
ZHallen122 Mar 15, 2025
864d888
Merge branch 'feat-React-CSS-Components-Lib' of https://github.com/Sm…
ZHallen122 Mar 15, 2025
9011e07
remove layout
ZHallen122 Mar 15, 2025
f28ae56
add color pattern
ZHallen122 Mar 15, 2025
2be75ad
improve escape situation
ZHallen122 Mar 16, 2025
5dc8957
remove wirefram drawing
ZHallen122 Mar 16, 2025
3581cc3
Merge remote-tracking branch 'origin/main' into feat-React-CSS-Compon…
ZHallen122 Mar 16, 2025
41e03e9
comment the old test
ZHallen122 Mar 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions backend/src/build-system/__tests__/fullstack-gen.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import { BuilderContext } from '../context';
import { FrontendCodeHandler } from '../handlers/frontend-code-generate';
import { FileStructureAndArchitectureHandler } from '../handlers/file-manager/file-struct';
import { BackendRequirementHandler } from '../handlers/backend/requirements-document';
import { UIUXLayoutHandler } from '../handlers/ux/uiux-layout';

(isIntegrationTest ? describe : describe.skip)('Build Sequence Test', () => {
it('should execute build sequence successfully', async () => {
const sequence: BuildSequence = {
id: 'test-backend-sequence',
version: '1.0.0',
name: 'Wrtie a Cool personal website',
description:
'A personal blog website. I am a cybersecurity engineer so i want it to show i am a really cool hacker, with cool terminal functionality',
name: 'Wrtie a Single page Cool cybersecurity personal website',
description: `A Single page personal blog website. I am a cybersecurity engineer so i want it to show i am a really cool hacker, with cool terminal functionality`,
databaseType: 'SQLite',
model: 'gpt-4o-mini',
projectSize: 'medium', // limit for fun
Expand All @@ -40,6 +40,11 @@ import { BackendRequirementHandler } from '../handlers/backend/requirements-docu
name: 'UX Sitemap Structure Node',
// requires: ['op:UX:SMD'],
},
{
handler: UIUXLayoutHandler,
name: 'UIUX Layout Handler',
// requires: ['op:UX:SMD'],
},
{
handler: UXDMDHandler,
name: 'UX DataMap Document Node',
Expand Down
120 changes: 60 additions & 60 deletions backend/src/build-system/__tests__/test-file-create.spec.ts
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
import * as fs from 'fs-extra';
import * as path from 'path';
import { FileGeneratorHandler } from '../handlers/file-manager/file-generate';
import { Logger } from '@nestjs/common';
import { isIntegrationTest } from 'src/common/utils';
// import * as fs from 'fs-extra';
// import * as path from 'path';
// import { FileGeneratorHandler } from '../handlers/file-manager/file-generate';
// import { Logger } from '@nestjs/common';
// import { isIntegrationTest } from 'src/common/utils';

(isIntegrationTest ? describe : describe.skip)('FileGeneratorHandler', () => {
const projectSrcPath = path.normalize(
path.join('src', 'build-system', '__tests__', 'test-project'),
);
// (isIntegrationTest ? describe : describe.skip)('FileGeneratorHandler', () => {
// const projectSrcPath = path.normalize(
// path.join('src', 'build-system', '__tests__', 'test-project'),
// );

const mdFilePath = path.normalize(
path.join('src', 'build-system', '__tests__', 'file-arch.md'),
);
// const mdFilePath = path.normalize(
// path.join('src', 'build-system', '__tests__', 'file-arch.md'),
// );

const structMdFilePath = path.normalize(
path.join('src', 'build-system', '__tests__', 'file-structure-document.md'),
);
// const structMdFilePath = path.normalize(
// path.join('src', 'build-system', '__tests__', 'file-structure-document.md'),
// );

beforeEach(async () => {
// Ensure the project directory is clean
await fs.remove(
path.normalize(
path.join('src', 'build-system', '__tests__', 'test-project', 'src'),
),
);
});
// beforeEach(async () => {
// // Ensure the project directory is clean
// await fs.remove(
// path.normalize(
// path.join('src', 'build-system', '__tests__', 'test-project', 'src'),
// ),
// );
// });

afterEach(async () => {
// Clean up the generated test files
await fs.remove(
path.normalize(
path.join('src', 'build-system', '__tests__', 'test-project', 'src'),
),
);
});
// afterEach(async () => {
// // Clean up the generated test files
// await fs.remove(
// path.normalize(
// path.join('src', 'build-system', '__tests__', 'test-project', 'src'),
// ),
// );
// });

it('should generate files based on file-arch.md', async () => {
const archMarkdownContent = fs.readFileSync(
path.normalize(path.resolve(mdFilePath)),
'utf8',
);
const structMarkdownContent = fs.readFileSync(
path.normalize(path.resolve(structMdFilePath)),
'utf8',
);
// it('should generate files based on file-arch.md', async () => {
// const archMarkdownContent = fs.readFileSync(
// path.normalize(path.resolve(mdFilePath)),
// 'utf8',
// );
// const structMarkdownContent = fs.readFileSync(
// path.normalize(path.resolve(structMdFilePath)),
// 'utf8',
// );

const handler = new FileGeneratorHandler();
// const handler = new FileGeneratorHandler();

// Run the file generator with the JSON data
const result = await handler.generateFiles(
archMarkdownContent,
projectSrcPath,
);
// // Run the file generator with the JSON data
// const result = await handler.generateFiles(
// archMarkdownContent,
// projectSrcPath,
// );

Logger.log('File generation result:', result);
// Logger.log('File generation result:', result);

// Verify that all files exist
const jsonData = JSON.parse(
/<GENERATEDCODE>([\s\S]*?)<\/GENERATEDCODE>/.exec(
archMarkdownContent,
)![1],
);
const files = Object.keys(jsonData.files);
// // Verify that all files exist
// const jsonData = JSON.parse(
// /<GENERATEDCODE>([\s\S]*?)<\/GENERATEDCODE>/.exec(
// archMarkdownContent,
// )![1],
// );
// const files = Object.keys(jsonData.files);

for (const file of files) {
const filePath = path.resolve(projectSrcPath, file);
expect(fs.existsSync(filePath)).toBeTruthy();
}
}, 30000);
});
// for (const file of files) {
// const filePath = path.resolve(projectSrcPath, file);
// expect(fs.existsSync(filePath)).toBeTruthy();
// }
// }, 30000);
// });
140 changes: 70 additions & 70 deletions backend/src/build-system/__tests__/test.backend-code-generator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
import { BuildSequence } from '../types';
import * as fs from 'fs';
import { executeBuildSequence } from './utils';
import { isIntegrationTest } from 'src/common/utils';
import { PRDHandler } from '../handlers/product-manager/product-requirements-document/prd';
import { UXSMDHandler } from '../handlers/ux/sitemap-document';
import { DBRequirementHandler } from '../handlers/database/requirements-document';
import { DBSchemaHandler } from '../handlers/database/schemas/schemas';
import { BackendCodeHandler } from '../handlers/backend/code-generate';
import { ProjectInitHandler } from '../handlers/project-init';
(isIntegrationTest ? describe : describe.skip)(
'Sequence: PRD -> UXSD -> UXDD -> UXSS -> DBSchemas -> BackendCodeGenerator',
() => {
// Generate a unique folder with a timestamp
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
const logFolderPath = `./logs/backend_code_generator-${timestamp}`;
fs.mkdirSync(logFolderPath, { recursive: true });
// import { BuildSequence } from '../types';
// import * as fs from 'fs';
// import { executeBuildSequence } from './utils';
// import { isIntegrationTest } from 'src/common/utils';
// import { PRDHandler } from '../handlers/product-manager/product-requirements-document/prd';
// import { UXSMDHandler } from '../handlers/ux/sitemap-document';
// import { DBRequirementHandler } from '../handlers/database/requirements-document';
// import { DBSchemaHandler } from '../handlers/database/schemas/schemas';
// import { BackendCodeHandler } from '../handlers/backend/code-generate';
// import { ProjectInitHandler } from '../handlers/project-init';
// (isIntegrationTest ? describe : describe.skip)(
// 'Sequence: PRD -> UXSD -> UXDD -> UXSS -> DBSchemas -> BackendCodeGenerator',
// () => {
// // Generate a unique folder with a timestamp
// const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
// const logFolderPath = `./logs/backend_code_generator-${timestamp}`;
// fs.mkdirSync(logFolderPath, { recursive: true });

(isIntegrationTest ? it : it.skip)(
'should execute the backend code generation sequence and log results to individual files',
async () => {
// Define the build sequence up to Backend Code Generator
const sequence: BuildSequence = {
id: 'test-backend-sequence',
version: '1.0.0',
name: 'Spotify-like Music Web',
description: 'Users can play music',
databaseType: 'SQLite',
nodes: [
{
handler: ProjectInitHandler,
name: 'Project Folders Setup',
},
{
handler: PRDHandler,
name: 'PRD Generation Node',
},
// (isIntegrationTest ? it : it.skip)(
// 'should execute the backend code generation sequence and log results to individual files',
// async () => {
// // Define the build sequence up to Backend Code Generator
// const sequence: BuildSequence = {
// id: 'test-backend-sequence',
// version: '1.0.0',
// name: 'Spotify-like Music Web',
// description: 'Users can play music',
// databaseType: 'SQLite',
// nodes: [
// {
// handler: ProjectInitHandler,
// name: 'Project Folders Setup',
// },
// {
// handler: PRDHandler,
// name: 'PRD Generation Node',
// },

{
handler: UXSMDHandler,
name: 'UX Sitemap Document Node',
// requires: ['op:PRD'],
},
// {
// handler: UXSMDHandler,
// name: 'UX Sitemap Document Node',
// // requires: ['op:PRD'],
// },

{
handler: UXSMDHandler,
name: 'UX Data Map Document Node',
// requires: ['op:UX:SMD'],
},
// {
// handler: UXSMDHandler,
// name: 'UX Data Map Document Node',
// // requires: ['op:UX:SMD'],
// },

{
handler: DBRequirementHandler,
name: 'Database Requirements Node',
// requires: ['op:UX:DATAMAP:DOC'],
},
// {
// handler: DBRequirementHandler,
// name: 'Database Requirements Node',
// // requires: ['op:UX:DATAMAP:DOC'],
// },

{
handler: DBSchemaHandler,
name: 'Database Schemas Node',
// requires: ['op:DATABASE_REQ'],
},
// {
// handler: DBSchemaHandler,
// name: 'Database Schemas Node',
// // requires: ['op:DATABASE_REQ'],
// },

{
handler: BackendCodeHandler,
name: 'Backend Code Generator Node',
// requires: ['op:DATABASE:SCHEMAS', 'op:UX:DATAMAP:DOC'],
},
],
};
// {
// handler: BackendCodeHandler,
// name: 'Backend Code Generator Node',
// // requires: ['op:DATABASE:SCHEMAS', 'op:UX:DATAMAP:DOC'],
// },
// ],
// };

// Initialize the BuilderContext with the defined sequence and environment
executeBuildSequence('backend code geneerate', sequence);
},
600000,
); // Timeout set to 10 minutes
},
);
// // Initialize the BuilderContext with the defined sequence and environment
// executeBuildSequence('backend code geneerate', sequence);
// },
// 600000,
// ); // Timeout set to 10 minutes
// },
// );
Loading
Loading