Skip to content

Commit 45d7565

Browse files
authored
Unify roomote and cloud databases (#112)
1 parent 990d58c commit 45d7565

File tree

90 files changed

+722
-4483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+722
-4483
lines changed
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# docker compose build base dashboard
1+
# docker compose build base roomote-dashboard
22

33
FROM roomote-base AS base
44

@@ -14,12 +14,10 @@ COPY apps/roomote/package.json ./apps/roomote/
1414
COPY scripts/bootstrap.mjs ./scripts/
1515
RUN pnpm install
1616

17-
COPY apps/roomote ./apps/roomote/
17+
COPY apps/roomote-dashboard ./apps/roomote-dashboard/
1818
COPY packages/config-eslint ./packages/config-eslint/
1919
COPY packages/config-typescript ./packages/config-typescript/
20-
COPY packages/types ./packages/types/
21-
COPY packages/ipc ./packages/ipc/
2220

23-
WORKDIR /roo/apps/roomote
21+
WORKDIR /roo/apps/roomote-dashboard
2422
EXPOSE 3002
25-
CMD ["pnpm", "dashboard"]
23+
CMD ["pnpm", "dev"]

.github/workflows/CI.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
env:
4141
POSTGRES_USER: postgres
4242
POSTGRES_PASSWORD: password
43-
POSTGRES_DB: roo_code_test
43+
POSTGRES_DB: test
4444
ports:
4545
- 5432:5432
4646
options: >-
@@ -69,13 +69,13 @@ jobs:
6969
- name: Run type checker
7070
run: pnpm check-types
7171
- name: Setup database schema
72-
run: pnpm --filter @roo-code-cloud/web db:test:push --force
72+
run: pnpm --filter @roo-code-cloud/db db:test:push --force
7373
env:
74-
DATABASE_URL: postgres://postgres:password@localhost:5432/roo_code_test
74+
DATABASE_URL: postgres://postgres:password@localhost:5432/test
7575
- name: Run unit tests
7676
run: pnpm test
7777
env:
78-
DATABASE_URL: postgres://postgres:password@localhost:5432/roo_code_test
78+
DATABASE_URL: postgres://postgres:password@localhost:5432/test
7979

8080
check:
8181
needs: [build, test]
@@ -106,6 +106,6 @@ jobs:
106106
run: pnpm install
107107
- name: Migrate production database
108108
run: npx drizzle-kit migrate
109-
working-directory: apps/web
109+
working-directory: apps/db
110110
env:
111111
DATABASE_URL: ${{ secrets.PRODUCTION_DATABASE_URL }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Thumbs.db
1111
# .env
1212
.env
1313
.env*.local
14+
.env*.preview
1415
.env*.production
1516

1617
# turbo
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { config } from "@roo-code-cloud/config-eslint/base"
2+
3+
/** @type {import("eslint").Linter.Config} */
4+
export default [...config]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "@roo-code-cloud/roomote-dashboard",
3+
"private": true,
4+
"type": "module",
5+
"scripts": {
6+
"lint": "eslint src --ext=ts --max-warnings=0",
7+
"check-types": "tsc --noEmit",
8+
"dev": "tsx src/index.ts",
9+
"clean": "rimraf .turbo"
10+
},
11+
"dependencies": {
12+
"@bull-board/api": "^6.10.1",
13+
"@bull-board/express": "^6.10.1",
14+
"@bull-board/ui": "^6.10.1",
15+
"bullmq": "^5.54.3",
16+
"express": "^5.1.0",
17+
"ioredis": "^5.6.1"
18+
},
19+
"devDependencies": {
20+
"@roo-code-cloud/config-eslint": "workspace:^",
21+
"@roo-code-cloud/config-typescript": "workspace:^",
22+
"@types/express": "^5.0.3",
23+
"@types/node": "^24.0.3",
24+
"tsx": "^4.19.3"
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
import IORedis from 'ioredis';
1+
import { Redis } from 'ioredis';
22
import { Queue } from 'bullmq';
33
import { ExpressAdapter } from '@bull-board/express';
4-
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';
4+
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter.js';
55
import { createBullBoard } from '@bull-board/api';
66
import express from 'express';
77
import type { Express, Request, Response } from 'express';
88

9-
const redis = new IORedis(process.env.REDIS_URL || 'redis://localhost:6380', {
9+
const redis = new Redis(process.env.REDIS_URL || 'redis://localhost:6380', {
1010
maxRetriesPerRequest: null,
1111
});
12+
1213
const queue = new Queue('roomote', { connection: redis });
1314

1415
const serverAdapter = new ExpressAdapter();
1516
serverAdapter.setBasePath('/admin/queues');
1617
createBullBoard({ queues: [new BullMQAdapter(queue)], serverAdapter });
1718

18-
const port = 3002;
1919
const app: Express = express();
2020
app.use('/admin/queues', serverAdapter.getRouter());
2121
app.use('/', (req: Request, res: Response) => res.redirect('/admin/queues'));
22+
23+
const port = 3002;
24+
2225
app.listen(port, () =>
2326
console.log(`Bull Board running on: http://localhost:${port}/admin/queues`),
2427
);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": "@roo-code-cloud/config-typescript/base.json",
3+
"include": ["src/**/*.ts"],
4+
"exclude": ["node_modules"]
5+
}

0 commit comments

Comments
 (0)