forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.module.ts
More file actions
131 lines (123 loc) · 4.6 KB
/
Copy pathapp.module.ts
File metadata and controls
131 lines (123 loc) · 4.6 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// app.module.ts
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { BullModule } from '@nestjs/bull';
import { EventEmitterModule } from '@nestjs/event-emitter';
import * as dotenv from 'dotenv';
import * as path from 'path';
import databaseConfig from './config/database.config';
import appConfig from './config/app.config';
import { HealthModule } from './modules/health/health.module';
import { StellarModule } from './stellar/stellar.module';
import { PaymentsModule } from './payments/payments.module';
import { CurrencyModule } from './modules/currency/currency.module';
import { SplitsModule } from './modules/splits/splits.module';
import { ItemsModule } from './modules/items/items.module';
import { EmailModule } from './email/email.module';
import { RecurringSplitsModule } from './recurring-splits/recurring-splits.module';
import { ReceiptsModule } from './receipts/receipts.module';
import { SplitHistoryModule } from './split-history/split-history.module';
import { ActivitiesModule } from './modules/activities/activities.module';
import { SearchModule } from './search/search.module';
import { FriendshipModule } from './friendship/friendship.module';
import { MentionsModule } from './mentions/mentions.module';
import { SplitCommentsModule } from './split-comments/split-comments.module';
import { AnalyticsModule } from "./analytics/analytics.module";
import { ExportModule } from './export/export.module';
import { WebhooksModule } from "./webhooks/webhooks.module";
import { DisputesModule } from './disputes/disputes.module';
import { GovernanceModule } from './governance/governance.module';
import { ComplianceModule } from './compliance/compliance.module';
import { SettlementModule } from "./settlement/settlement.module";
import { TemplatesModule } from "./templates/templates.module";
import { PushNotificationsModule } from './push-notifications/push-notifications.module';
import { ArchivingModule } from './modules/archiving/archiving.module';
import { GatewayModule } from "./gateway/gateway.module";
import { SchedulerModule } from "./modules/scheduler/scheduler.module";
import { UploadModule } from "./uploads/upload.module";
import { ProfileModule } from "./profile/profile.module";
import { InvitationsModule } from "./invitations/invitations.module";
import { CommonModule } from "./common/common.module";
// Load environment variables
dotenv.config({
path: path.resolve(__dirname, '../.env'),
});
@Module({
imports: [
// ✅ Config
ConfigModule.forRoot({
isGlobal: true,
envFilePath: [".env", ".env.local"],
load: [appConfig, databaseConfig],
}),
// ✅ Event system (mentions, activity feed, etc.)
EventEmitterModule.forRoot(),
// ✅ Database
TypeOrmModule.forRootAsync({
inject: [ConfigService],
useFactory: (configService: ConfigService) => {
const dbConfig = configService.get("database");
return {
type: "postgres",
host: dbConfig.host,
port: dbConfig.port,
username: dbConfig.username,
password: dbConfig.password,
database: dbConfig.name,
entities: [path.join(__dirname, "**/*.entity{.ts,.js}")],
synchronize: dbConfig.synchronize,
logging: dbConfig.logging,
};
},
}),
// ✅ Queue / background jobs
BullModule.forRootAsync({
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
redis: {
host: configService.get("REDIS_HOST", "localhost"),
port: configService.get("REDIS_PORT", 6379),
},
}),
}),
// ✅ Feature modules
HealthModule,
StellarModule,
PaymentsModule,
CurrencyModule,
SplitsModule,
ItemsModule,
EmailModule,
RecurringSplitsModule,
ReceiptsModule,
SplitHistoryModule,
ActivitiesModule,
SearchModule,
FriendshipModule,
MentionsModule,
SplitCommentsModule,
// Analytics module for user spending & reports
AnalyticsModule,
ExportModule,
// Webhooks module for external event notifications
WebhooksModule,
// Dispute resolution system for split conflicts
DisputesModule,
// DAO Governance system for platform decisions
GovernanceModule,
// Compliance module for tax reporting and exports
ComplianceModule,
SettlementModule,
TemplatesModule,
PushNotificationsModule,
ArchivingModule,
GatewayModule,
SchedulerModule,
UploadModule,
ProfileModule,
InvitationsModule,
CommonModule,
],
})
export class AppModule { }