Clean working version: deployed TypeScript backend + JSX frontend

- Replace old JS backend with working TypeScript backend from deployed containers
- Backend: Fastify + better-sqlite3 + Yjs CRDT, 17 TS source files, 13 test files
- Frontend: React JSX with fabric.js CAD canvas, vite build, nginx serving
- Fix nginx proxy port 5000→3001 to match backend
- Fix docker-compose port mapping 5000→3001
- Fix vite dev proxy port 5000→3001
- Add backend healthcheck to docker-compose
- Update index.html title to 'Web CAD', lang to 'de'
- Add .a0/ to .gitignore
- Remove old JS backend files (models, routes, config, middleware, seed)
- Remove tracked build artifacts (backend/public/)
This commit is contained in:
Agent Zero
2026-06-28 01:24:31 +02:00
parent 249d5fbdb6
commit 8fa6f795c0
60 changed files with 8988 additions and 3708 deletions
+45
View File
@@ -0,0 +1,45 @@
/**
* Health Endpoint Tests
*/
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import type { FastifyInstance } from 'fastify';
import { SqliteAdapter } from '../src/database/SqliteAdapter.js';
import { createServer } from '../src/server.js';
describe('Health Endpoint', () => {
let app: FastifyInstance;
let db: SqliteAdapter;
beforeAll(async () => {
db = new SqliteAdapter(':memory:');
await db.init();
app = await createServer({ db, port: 0 });
await app.ready();
});
afterAll(async () => {
await app.close();
db.close();
});
it('GET /api/health should return ok status', async () => {
const response = await app.inject({
method: 'GET',
url: '/api/health',
});
expect(response.statusCode).toBe(200);
const body = JSON.parse(response.body);
expect(body.status).toBe('ok');
expect(body.timestamp).toBeDefined();
});
it('GET /api/health should return valid ISO timestamp', async () => {
const response = await app.inject({
method: 'GET',
url: '/api/health',
});
const body = JSON.parse(response.body);
const date = new Date(body.timestamp);
expect(date.toString()).not.toBe('Invalid Date');
});
});