Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
electron/node_modules/
ui/node_modules/
ui-lovable/node_modules/

ui/node_modules
18 changes: 18 additions & 0 deletions src/compiler/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "windows-gcc-x86",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "C:/MinGW/bin/gcc.exe",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x86",
"compilerArgs": [
""
]
}
],
"version": 4
}
24 changes: 24 additions & 0 deletions src/compiler/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "c:/Users/Admin/Desktop/compiler",
"program": "c:/Users/Admin/Desktop/compiler/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
59 changes: 59 additions & 0 deletions src/compiler/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
41 changes: 41 additions & 0 deletions src/compiler/ast/ast.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// ast/ast.h
#pragma once
#include <string>
#include <vector>
#include <unordered_map>

using namespace std;

enum class ComponentType {
API,
DATABASE,
CACHE,
UNKNOWN
};

struct Component {
string id;
ComponentType type;
string profile;

// parameters (generic key-value for now)
unordered_map<string, double> numeric_params;
};

struct Link {
string source;
string target;
unordered_map<string, double> numeric_params;
};

struct Workload {
string type;
double base_rps;
long duration_ms;
};

struct ArchitectureAST {
unordered_map<string, Component> components;
vector<Link> links;
Workload workload;
};
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions src/compiler/common/errors.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// common/errors.h
#pragma once
#include <string>
#include <vector>

using namespace std;

struct ValidationError {
string message;
vector<string> related_ids;
};
34 changes: 34 additions & 0 deletions src/compiler/compiler.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include <iostream>
#include <fstream>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

int main(int argc, char* argv[]) {
if (argc < 2) {
std::cout << "NOT VALID\n";
return 0;
}

std::ifstream in(argv[1]);
if (!in) {
std::cout << "NOT VALID\n";
return 0;
}

try {
json j;
in >> j;

// 🔹 Minimal validation for now
if (j.is_object()) {
std::cout << "VALID\n";
} else {
std::cout << "NOT VALID\n";
}
} catch (...) {
std::cout << "NOT VALID\n";
}

return 0;
}
Binary file added src/compiler/compiler.exe
Binary file not shown.
Empty file added src/compiler/expand/expand.cpp
Empty file.
Empty file added src/compiler/expand/expand.h
Empty file.
36 changes: 36 additions & 0 deletions src/compiler/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"components": [
{
"id": "node_1767887801509_qc15k0i5w",
"type": "database",
"profile": "mongodb",
"position": {
"x": 180,
"y": 200
},
"label": "MongoDB",
"parameters": {
"max_concurrency": 100,
"base_latency_ms": 10,
"disk_fail_prob": 0.001,
"read_write_ratio": 0.8
}
}
],
"links": [],
"routes": [],
"workload": {
"type": "steady",
"base_rps": 100,
"duration_ms": 60000,
"spikes": [],
"distribution": "constant",
"distribution_params": {}
},
"faults": [],
"metadata": {
"version": "1.0.0",
"name": "Untitled Project",
"createdAt": "2026-01-08T15:56:48.258Z"
}
}
Loading