@neuralforge/dashboard 0.9.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/package.json +22 -0
- package/src/api/experiments.ts +7 -0
- package/src/api/index.ts +6 -0
- package/src/api/metrics.ts +7 -0
- package/src/api/routes.ts +14 -0
- package/src/components/ExperimentList.tsx +7 -0
- package/src/components/HyperparamTable.tsx +7 -0
- package/src/components/MetricPanel.tsx +7 -0
- package/src/components/ModelGraph.tsx +7 -0
- package/src/components/TrainingChart.tsx +7 -0
- package/src/hooks/useExperiment.ts +6 -0
- package/src/hooks/useMetrics.ts +6 -0
- package/src/hooks/useWebSocket.ts +6 -0
- package/src/index.ts +7 -0
- package/src/server.ts +19 -0
- package/src/utils/colors.ts +7 -0
- package/src/utils/format.ts +7 -0
- package/src/utils/ws.ts +6 -0
- package/tests/api.test.ts +13 -0
- package/tests/server.test.ts +13 -0
- package/tsconfig.json +7 -0
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@neuralforge/dashboard",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Training visualization dashboard",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"test": "vitest",
|
|
10
|
+
"lint": "eslint src/"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"typescript": "^5.4.0",
|
|
14
|
+
"express": "^4.18.0",
|
|
15
|
+
"ws": "^8.16.0",
|
|
16
|
+
"react": "^18.2.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"vitest": "^1.6.0",
|
|
20
|
+
"eslint": "^8.57.0"
|
|
21
|
+
}
|
|
22
|
+
}
|
package/src/api/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API routes
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Router, Application } from 'express';
|
|
6
|
+
|
|
7
|
+
export function setupRoutes(app: Application): void {
|
|
8
|
+
const router = Router();
|
|
9
|
+
router.get('/api/metrics', (req, res) => res.json({ metrics: [] }));
|
|
10
|
+
router.get('/api/experiments', (req, res) => res.json({ experiments: [] }));
|
|
11
|
+
router.get('/api/health', (req, res) => res.json({ status: 'ok' }));
|
|
12
|
+
app.use(router);
|
|
13
|
+
}
|
|
14
|
+
|
package/src/index.ts
ADDED
package/src/server.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard HTTP server
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import express from 'express';
|
|
6
|
+
import { setupRoutes } from './api';
|
|
7
|
+
|
|
8
|
+
export interface ServerConfig {
|
|
9
|
+
port: number;
|
|
10
|
+
host?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createServer(config: ServerConfig) {
|
|
14
|
+
const app = express();
|
|
15
|
+
app.use(express.json());
|
|
16
|
+
setupRoutes(app);
|
|
17
|
+
return app.listen(config.port, config.host || '0.0.0.0');
|
|
18
|
+
}
|
|
19
|
+
|
package/src/utils/ws.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { setupRoutes } from '../src';
|
|
3
|
+
|
|
4
|
+
describe('setupRoutes', () => {
|
|
5
|
+
it('should be defined', () => {
|
|
6
|
+
expect(setupRoutes).toBeDefined();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it('should initialize correctly', () => {
|
|
10
|
+
const instance = new setupRoutes();
|
|
11
|
+
expect(instance).toBeInstanceOf(setupRoutes);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { createServer } from '../src';
|
|
3
|
+
|
|
4
|
+
describe('createServer', () => {
|
|
5
|
+
it('should be defined', () => {
|
|
6
|
+
expect(createServer).toBeDefined();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it('should initialize correctly', () => {
|
|
10
|
+
const instance = new createServer();
|
|
11
|
+
expect(instance).toBeInstanceOf(createServer);
|
|
12
|
+
});
|
|
13
|
+
});
|