Spaces:
Sleeping

File size: 3,454 Bytes
4e83772
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import UserRepo from "./repositories/user.repository.js";
import ProjectRepo from "./repositories/project.repository.js";
import DeploymentRepo from "./repositories/deployment.repository.js";
import LogRepo from "./repositories/log.repository.js";
import AnalyticsRepo from "./repositories/analytics.repository.js";
import ProjectBandwidthRepository from "./repositories/projectBandwidth.repository.js";

import UserService from "./services/user.service.js";
import ProjectService from "./services/project.service.js";
import DeploymentService from "./services/deployment.service.js";
import LogsService from "./services/logs.service.js";
import AnalyticsService from "./services/analytics.service.js";

import ProjectController from "./controllers/projectController.js";
import DeploymentController from "./controllers/deploymentController.js";
import LogsController from "./controllers/logsController.js";
import AnalyticsController from "./controllers/analyticsController.js";

import { client } from "./config/clickhouse.config.js";
import PaymentService from "./services/payment.service.js";
import PaymentController from "./controllers/paymentController.js";
import RedisService from "./cache/redisCache.js";
import { redisClient } from "./config/redis.config.js";
import OtpRepository from "./repositories/otpVerify.repository.js";
import OtpService from "./services/otpVerify.service.js";
import WebhookController from "./controllers/webhookController.js";
import WebhookService from "./services/webhook.service.js";
import GithubService from "./services/github.service.js";
import IntervalManager from "./utils/intervalService.js";

export const userRepo = new UserRepo();
export const projectRepo = new ProjectRepo();
export const deploymentRepo = new DeploymentRepo();
export const projectBandwidthRepo = new ProjectBandwidthRepository();
export const otpRepo = new OtpRepository();

export const logRepo = new LogRepo(client);
export const analyticsRepo = new AnalyticsRepo(client);

export const redisCacheService = new RedisService(redisClient);

export const logsService = new LogsService(logRepo, deploymentRepo);
export const otpService = new OtpService(otpRepo);
export const projectService = new ProjectService(projectRepo, userRepo, projectBandwidthRepo, deploymentRepo, logsService, redisCacheService);
export const analyticsService = new AnalyticsService(analyticsRepo, projectBandwidthRepo);
export const userService = new UserService(userRepo, projectService, otpService);
export const githubService = new GithubService(userService, redisCacheService);
export const deploymentService = new DeploymentService(deploymentRepo, projectRepo, userService, logsService, redisCacheService, githubService);
export const paymentService = new PaymentService(userRepo);

export const webhookService = new WebhookService(userService, projectService, deploymentService, githubService);

export const projectController = new ProjectController(projectService);
export const deploymentController = new DeploymentController(deploymentService);
export const logsController = new LogsController(logsService, deploymentService);
export const analyticsController = new AnalyticsController(analyticsService);
export const paymentController = new PaymentController(paymentService);

export const webhookController = new WebhookController(webhookService, githubService);

export const intervalManager = new IntervalManager(logsService, analyticsService);