Skip to content

Commit d407e52

Browse files
committed
fix: Remove notification system
1 parent 1594268 commit d407e52

30 files changed

Lines changed: 24 additions & 1841 deletions

.env.example

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,6 @@ STORAGE_MODE=memory
6161
# Example: postgresql://username:password@localhost:5432/renovate_dashboard
6262
DATABASE_URL=
6363

64-
# ===================================
65-
# Notifications (Optional)
66-
# ===================================
67-
68-
# Microsoft Teams incoming webhook URL
69-
TEAMS_WEBHOOK_URL=
70-
71-
# Email SMTP configuration
72-
SMTP_HOST=
73-
SMTP_PORT=587
74-
SMTP_SECURE=false
75-
SMTP_USER=
76-
SMTP_PASS=
77-
NOTIFICATION_FROM_EMAIL=noreply@example.com
78-
7964
# ===================================
8065
# Scheduler Configuration
8166
# ===================================

backend/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"helmet": "^8.1.0",
3434
"morgan": "^1.10.1",
3535
"node-cron": "^4.2.1",
36-
"nodemailer": "^8.0.5",
3736
"pg": "^8.20.0",
3837
"redis": "^5.11.0",
3938
"socket.io": "^4.8.3",
@@ -47,7 +46,6 @@
4746
"@types/express-session": "^1.18.2",
4847
"@types/morgan": "^1.9.10",
4948
"@types/node": "^25.5.0",
50-
"@types/nodemailer": "^7.0.11",
5149
"@typescript-eslint/eslint-plugin": "^8.58.1",
5250
"@typescript-eslint/parser": "^8.58.1",
5351
"@vitest/coverage-v8": "^4.1.2",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-- Drop notification tables and related enums
2+
DROP TABLE IF EXISTS "NotificationHistory";
3+
DROP TABLE IF EXISTS "NotificationConfig";
4+
5+
DROP TYPE IF EXISTS "NotificationStatus";
6+
DROP TYPE IF EXISTS "NotificationTrigger";
7+
DROP TYPE IF EXISTS "NotificationType";

backend/prisma/schema.prisma

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -80,34 +80,6 @@ model ScanHistory {
8080
@@index([createdAt])
8181
}
8282

83-
model NotificationConfig {
84-
id String @id @default(cuid())
85-
type NotificationType
86-
name String
87-
enabled Boolean @default(true)
88-
config Json // Flexible config storage
89-
triggers NotificationTrigger[]
90-
createdAt DateTime @default(now())
91-
updatedAt DateTime @updatedAt
92-
93-
@@unique([type, name])
94-
}
95-
96-
model NotificationHistory {
97-
id String @id @default(cuid())
98-
type NotificationType
99-
trigger NotificationTrigger
100-
recipient String
101-
subject String
102-
content String
103-
status NotificationStatus
104-
errorMessage String?
105-
sentAt DateTime @default(now())
106-
107-
@@index([type])
108-
@@index([sentAt])
109-
}
110-
11183
model AppSettings {
11284
id String @id @default("app-settings")
11385
githubOrg String
@@ -212,22 +184,3 @@ enum ScanStatus {
212184
completed
213185
failed
214186
}
215-
216-
enum NotificationType {
217-
teams
218-
email
219-
inApp
220-
}
221-
222-
enum NotificationTrigger {
223-
critical
224-
newAdoption
225-
stalePR
226-
scanComplete
227-
}
228-
229-
enum NotificationStatus {
230-
sent
231-
failed
232-
pending
233-
}

backend/prisma/seed.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { NotificationType, NotificationTrigger } from '../src/generated/prisma/client.js';
21
import { createPrismaClient } from '../src/lib/prisma.js';
32

43
const prisma = createPrismaClient();
@@ -17,28 +16,6 @@ async function main() {
1716
},
1817
});
1918

20-
// Create default in-app notification config
21-
await prisma.notificationConfig.upsert({
22-
where: {
23-
type_name: {
24-
type: NotificationType.inApp,
25-
name: 'In-App Notifications',
26-
},
27-
},
28-
update: {},
29-
create: {
30-
type: NotificationType.inApp,
31-
name: 'In-App Notifications',
32-
enabled: true,
33-
config: {},
34-
triggers: [
35-
NotificationTrigger.critical,
36-
NotificationTrigger.newAdoption,
37-
NotificationTrigger.scanComplete,
38-
],
39-
},
40-
});
41-
4219
console.log('Database seeded successfully!');
4320
}
4421

backend/src/config/env.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@ const envSchema = z.object({
3636
// Storage mode: 'database' or 'memory' (default: memory for easy startup)
3737
STORAGE_MODE: z.enum(['database', 'memory']).default('memory'),
3838

39-
// Teams (optional)
40-
TEAMS_WEBHOOK_URL: z.string().optional(),
41-
42-
// Email (optional)
43-
SMTP_HOST: z.string().optional(),
44-
SMTP_PORT: z.string().optional(),
45-
SMTP_SECURE: z.string().optional(),
46-
SMTP_USER: z.string().optional(),
47-
SMTP_PASS: z.string().optional(),
48-
NOTIFICATION_FROM_EMAIL: z.string().optional(),
49-
5039
// Scheduler
5140
SCAN_INTERVAL_MINUTES: z.string().default('60'),
5241

@@ -86,17 +75,6 @@ export const config = {
8675
sessionSecret: env.SESSION_SECRET,
8776
},
8877
frontendUrl: env.FRONTEND_URL,
89-
teams: {
90-
webhookUrl: env.TEAMS_WEBHOOK_URL,
91-
},
92-
email: {
93-
host: env.SMTP_HOST,
94-
port: env.SMTP_PORT ? parseInt(env.SMTP_PORT, 10) : undefined,
95-
secure: env.SMTP_SECURE === 'true',
96-
user: env.SMTP_USER,
97-
pass: env.SMTP_PASS,
98-
from: env.NOTIFICATION_FROM_EMAIL,
99-
},
10078
scheduler: {
10179
scanIntervalMinutes: parseInt(env.SCAN_INTERVAL_MINUTES, 10),
10280
},

backend/src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { apiLimiter, authLimiter, scanLimiter } from './middleware/rateLimiter.j
1717
import { authRoutes } from './routes/auth.routes.js';
1818
import { dashboardRoutes } from './routes/dashboard.routes.js';
1919
import { dependencyRoutes } from './routes/dependency.routes.js';
20-
import { notificationRoutes } from './routes/notification.routes.js';
2120
import { repositoryRoutes } from './routes/repository.routes.js';
2221
import { settingsRoutes } from './routes/settings.routes.js';
2322
import { SchedulerService } from './services/scheduler.service.js';
@@ -63,7 +62,7 @@ if (shouldUseRedis) {
6362
logger.info('Redis disabled in development mode. Set USE_REDIS=true to enable.');
6463
}
6564

66-
// Socket.io setup for real-time notifications
65+
// Socket.io setup for real-time updates (e.g. scan progress)
6766
const io = new Server(httpServer, {
6867
cors: {
6968
origin: config.frontendUrl,
@@ -195,7 +194,6 @@ app.use('/api/repositories/scan', requireAuth, scanLimiter);
195194
app.use('/api/repositories', requireAuth, repositoryRoutes);
196195
app.use('/api/dependencies', requireAuth, dependencyRoutes);
197196
app.use('/api/dashboard', requireAuth, dashboardRoutes);
198-
app.use('/api/notifications', requireAuth, notificationRoutes);
199197
app.use('/api/settings', requireAuth, settingsRoutes);
200198

201199
// Error handling

backend/src/routes/notification.routes.ts

Lines changed: 0 additions & 162 deletions
This file was deleted.

0 commit comments

Comments
 (0)