feat: remove broken redis
This commit is contained in:
parent
1f80390850
commit
ae7dfa2a09
|
|
@ -1,14 +1,13 @@
|
|||
import {Global, Module} from '@nestjs/common';
|
||||
|
||||
import {DatabaseModule} from "@gitroom/nestjs-libraries/database/prisma/database.module";
|
||||
import {RedisModule} from "@gitroom/nestjs-libraries/redis/redis.module";
|
||||
import {ApiModule} from "@gitroom/backend/api/api.module";
|
||||
import {APP_GUARD} from "@nestjs/core";
|
||||
import {PoliciesGuard} from "@gitroom/backend/services/auth/permissions/permissions.guard";
|
||||
|
||||
@Global()
|
||||
@Module({
|
||||
imports: [DatabaseModule, RedisModule, ApiModule],
|
||||
imports: [DatabaseModule, ApiModule],
|
||||
controllers: [],
|
||||
providers: [{
|
||||
provide: APP_GUARD,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { Module } from '@nestjs/common';
|
|||
import { CommandModule as ExternalCommandModule } from 'nestjs-command';
|
||||
import { CheckStars } from './tasks/check.stars';
|
||||
import { DatabaseModule } from '@gitroom/nestjs-libraries/database/prisma/database.module';
|
||||
import { RedisModule } from '@gitroom/nestjs-libraries/redis/redis.module';
|
||||
import { BullMqModule } from '@gitroom/nestjs-libraries/bull-mq-transport/bull-mq.module';
|
||||
import { ioRedis } from '@gitroom/nestjs-libraries/redis/redis.service';
|
||||
import {RefreshTokens} from "./tasks/refresh.tokens";
|
||||
|
|
@ -11,7 +10,6 @@ import {RefreshTokens} from "./tasks/refresh.tokens";
|
|||
imports: [
|
||||
ExternalCommandModule,
|
||||
DatabaseModule,
|
||||
RedisModule,
|
||||
BullMqModule.forRoot({
|
||||
connection: ioRedis,
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import { ScheduleModule } from '@nestjs/schedule';
|
|||
import { RefreshTokens } from '@gitroom/cron/tasks/refresh.tokens';
|
||||
import { CheckStars } from '@gitroom/cron/tasks/check.stars';
|
||||
import { DatabaseModule } from '@gitroom/nestjs-libraries/database/prisma/database.module';
|
||||
import { RedisModule } from '@gitroom/nestjs-libraries/redis/redis.module';
|
||||
import { BullMqModule } from '@gitroom/nestjs-libraries/bull-mq-transport/bull-mq.module';
|
||||
import { ioRedis } from '@gitroom/nestjs-libraries/redis/redis.service';
|
||||
import { SyncTrending } from '@gitroom/cron/tasks/sync.trending';
|
||||
|
|
@ -12,7 +11,6 @@ import { SyncTrending } from '@gitroom/cron/tasks/sync.trending';
|
|||
imports: [
|
||||
DatabaseModule,
|
||||
ScheduleModule.forRoot(),
|
||||
RedisModule,
|
||||
BullMqModule.forRoot({
|
||||
connection: ioRedis,
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -1,85 +0,0 @@
|
|||
exports.default = {
|
||||
"$schema": "https://mintlify.com/schema.json",
|
||||
"name": "Starter Kit",
|
||||
"logo": {
|
||||
"dark": "/logo/dark.png",
|
||||
"light": "/logo/light.png"
|
||||
},
|
||||
"favicon": "/favicon.png",
|
||||
"colors": {
|
||||
"primary": "#9333EA",
|
||||
"light": "#9333EA",
|
||||
"dark": "#9333EA",
|
||||
"anchors": {
|
||||
"from": "#9333EA",
|
||||
"to": "#9333EA"
|
||||
}
|
||||
},
|
||||
"openapi": "https://api.gitroom.com/docs-json",
|
||||
"api": {
|
||||
"baseUrl": "https://api.gitroom.com",
|
||||
},
|
||||
"topbarLinks": [
|
||||
{
|
||||
"name": "Support",
|
||||
"url": "mailto:nevo@gitroom.com"
|
||||
},
|
||||
{
|
||||
"name": "Cloud",
|
||||
"url": "https://platform.gitroom.com"
|
||||
}
|
||||
],
|
||||
"modeToggle": {
|
||||
"default": "light"
|
||||
},
|
||||
"topbarCtaButton": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/gitoomhq/gitroom"
|
||||
},
|
||||
"tabs": [
|
||||
{
|
||||
"name": "Public API Reference",
|
||||
"url": "public-api-reference"
|
||||
},
|
||||
{
|
||||
"name": "Internal API Reference (Self-Hosted)",
|
||||
"url": "api-reference"
|
||||
}
|
||||
],
|
||||
"anchors": [
|
||||
{
|
||||
"name": "Documentation",
|
||||
"icon": "book-open-cover",
|
||||
"url": "https://docs.gitroom.com"
|
||||
},
|
||||
{
|
||||
"name": "Community",
|
||||
"icon": "discord",
|
||||
"url": "https://discord.gitroom.com"
|
||||
},
|
||||
{
|
||||
"name": "Blog",
|
||||
"icon": "newspaper",
|
||||
"url": "https://gitroom.com/blog"
|
||||
}
|
||||
],
|
||||
"navigation": [
|
||||
{
|
||||
"group": "Get Started",
|
||||
"pages": ["introduction", "quickstart", "howitworks"]
|
||||
},
|
||||
{
|
||||
"group": "API Documentation",
|
||||
"pages": ["api-reference/introduction"]
|
||||
},
|
||||
{
|
||||
"group": "Public api Documentation",
|
||||
"pages": ["public-api-reference/introduction"]
|
||||
}
|
||||
],
|
||||
"footerSocials": {
|
||||
"twitter": "https://twitter.com/nevodavid",
|
||||
"github": "https://github.com/gitroomhq/gitroom",
|
||||
"linkedin": "https://www.linkedin.com/nevodavid"
|
||||
}
|
||||
};
|
||||
|
|
@ -7,12 +7,12 @@
|
|||
},
|
||||
"favicon": "/favicon.png",
|
||||
"colors": {
|
||||
"primary": "#9333EA",
|
||||
"light": "#9333EA",
|
||||
"dark": "#9333EA",
|
||||
"primary": "#000",
|
||||
"light": "#612ad5",
|
||||
"dark": "#000",
|
||||
"anchors": {
|
||||
"from": "#9333EA",
|
||||
"to": "#9333EA"
|
||||
"from": "#612ad5",
|
||||
"to": "#612ad5"
|
||||
}
|
||||
},
|
||||
"openapi": "https://api.gitroom.com/docs-json",
|
||||
|
|
@ -36,16 +36,6 @@
|
|||
"type": "github",
|
||||
"url": "https://github.com/gitoomhq/gitroom"
|
||||
},
|
||||
"tabs": [
|
||||
{
|
||||
"name": "Public API Reference",
|
||||
"url": "public-api-reference"
|
||||
},
|
||||
{
|
||||
"name": "Internal API Reference (Self-Hosted)",
|
||||
"url": "api-reference"
|
||||
}
|
||||
],
|
||||
"anchors": [
|
||||
{
|
||||
"name": "Documentation",
|
||||
|
|
@ -71,128 +61,6 @@
|
|||
"quickstart",
|
||||
"howitworks"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "API Documentation",
|
||||
"pages": [
|
||||
"api-reference/introduction"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Public api Documentation",
|
||||
"pages": [
|
||||
"public-api-reference/introduction"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Stripe",
|
||||
"pages": [
|
||||
"api-reference/custom/stripe/post-stripe"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Auth",
|
||||
"pages": [
|
||||
"api-reference/custom/auth/post-authregister",
|
||||
"api-reference/custom/auth/post-authlogin",
|
||||
"api-reference/custom/auth/post-authforgot",
|
||||
"api-reference/custom/auth/post-authforgot-return"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "User",
|
||||
"pages": [
|
||||
"api-reference/custom/user/get-userself",
|
||||
"api-reference/custom/user/get-usersubscription",
|
||||
"api-reference/custom/user/get-usersubscriptiontiers",
|
||||
"api-reference/custom/user/post-userjoin-org",
|
||||
"api-reference/custom/user/get-userorganizations",
|
||||
"api-reference/custom/user/post-userchange-org"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Analytics",
|
||||
"pages": [
|
||||
"api-reference/custom/analytics/get-analytics",
|
||||
"api-reference/custom/analytics/get-analyticstrending",
|
||||
"api-reference/custom/analytics/post-analyticsstars"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Integrations",
|
||||
"pages": [
|
||||
"api-reference/custom/integrations/get-integrations",
|
||||
"api-reference/custom/integrations/delete-integrations",
|
||||
"api-reference/custom/integrations/get-integrationslist",
|
||||
"api-reference/custom/integrations/get-integrationssocial",
|
||||
"api-reference/custom/integrations/post-integrationsfunction",
|
||||
"api-reference/custom/integrations/post-integrationsarticle-connect",
|
||||
"api-reference/custom/integrations/post-integrationssocial-connect",
|
||||
"api-reference/custom/integrations/post-integrationsdisable",
|
||||
"api-reference/custom/integrations/post-integrationsenable"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Settings",
|
||||
"pages": [
|
||||
"api-reference/custom/settings/get-settingsgithub",
|
||||
"api-reference/custom/settings/post-settingsgithub",
|
||||
"api-reference/custom/settings/get-settingsgithuburl",
|
||||
"api-reference/custom/settings/get-settingsorganizations",
|
||||
"api-reference/custom/settings/post-settingsorganizations",
|
||||
"api-reference/custom/settings/get-settingsorganizations-",
|
||||
"api-reference/custom/settings/delete-settingsrepository",
|
||||
"api-reference/custom/settings/get-settingsteam",
|
||||
"api-reference/custom/settings/post-settingsteam",
|
||||
"api-reference/custom/settings/delete-settingsteam"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Posts",
|
||||
"pages": [
|
||||
"api-reference/custom/posts/get-posts",
|
||||
"api-reference/custom/posts/post-posts",
|
||||
"api-reference/custom/posts/get-postspredict-trending",
|
||||
"api-reference/custom/posts/get-postsold",
|
||||
"api-reference/custom/posts/get-posts-1",
|
||||
"api-reference/custom/posts/delete-posts",
|
||||
"api-reference/custom/posts/put-posts-date"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Media",
|
||||
"pages": [
|
||||
"api-reference/custom/media/get-media",
|
||||
"api-reference/custom/media/post-media"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Comments",
|
||||
"pages": [
|
||||
"api-reference/custom/comments/post-comments",
|
||||
"api-reference/custom/comments/put-comments",
|
||||
"api-reference/custom/comments/post-comments-1",
|
||||
"api-reference/custom/comments/delete-comments",
|
||||
"api-reference/custom/comments/get-comments"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Billing",
|
||||
"pages": [
|
||||
"api-reference/custom/billing/get-billingcheck",
|
||||
"api-reference/custom/billing/post-billingsubscribe",
|
||||
"api-reference/custom/billing/get-billingportal",
|
||||
"api-reference/custom/billing/get-billing",
|
||||
"api-reference/custom/billing/post-billingcancel",
|
||||
"api-reference/custom/billing/post-billingprorate"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Notifications",
|
||||
"pages": [
|
||||
"api-reference/custom/notifications/get-notifications",
|
||||
"api-reference/custom/notifications/get-notificationslist"
|
||||
]
|
||||
}
|
||||
],
|
||||
"footerSocials": {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -5,7 +5,7 @@
|
|||
"projectType": "application",
|
||||
"targets": {
|
||||
"build": {
|
||||
"command": "node apps/docs/test.js",
|
||||
"command": "node apps/docs/generate-refrences.js",
|
||||
"options": {
|
||||
"type": "module"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
const process = require('process')
|
||||
process.chdir(__dirname);
|
||||
const {writeFileSync, renameSync, rmdirSync, mkdirSync} = require("fs");
|
||||
const { config } = require('dotenv');
|
||||
const prod = require('./mint.js').default;
|
||||
config();
|
||||
(async () => {
|
||||
const {generateOpenApiPages} = await import("@mintlify/scraping");
|
||||
|
||||
try {
|
||||
rmdirSync('./api-reference/custom', { recursive: true });
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000));
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
await generateOpenApiPages('https://api.gitroom.com/docs-json', true, 'api-reference/custom');
|
||||
const generate = await generateOpenApiPages('https://api.gitroom.com/docs-json');
|
||||
await new Promise((resolve) => setTimeout(resolve, 3000));
|
||||
|
||||
mkdirSync('./api-reference/custom', { recursive: true });
|
||||
|
||||
prod.navigation.push(...generate.nav.map((item) => ({
|
||||
...item,
|
||||
pages: item.pages.map((page) => 'api-reference/custom/' + page)
|
||||
})));
|
||||
|
||||
writeFileSync('./mint.json', JSON.stringify(prod, null, 2));
|
||||
const text = await (await fetch('https://api.gitroom.com/docs-json')).text();
|
||||
writeFileSync('./openapi.json', text);
|
||||
})();
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
|
||||
import { StarsController } from './stars.controller';
|
||||
import {RedisModule} from "@gitroom/nestjs-libraries/redis/redis.module";
|
||||
import {DatabaseModule} from "@gitroom/nestjs-libraries/database/prisma/database.module";
|
||||
import {BullMqModule} from "@gitroom/nestjs-libraries/bull-mq-transport/bull-mq.module";
|
||||
import {ioRedis} from "@gitroom/nestjs-libraries/redis/redis.service";
|
||||
|
|
@ -9,7 +8,7 @@ import {TrendingService} from "@gitroom/nestjs-libraries/services/trending.servi
|
|||
import {PostsController} from "@gitroom/workers/app/posts.controller";
|
||||
|
||||
@Module({
|
||||
imports: [RedisModule, DatabaseModule, BullMqModule.forRoot({
|
||||
imports: [DatabaseModule, BullMqModule.forRoot({
|
||||
connection: ioRedis
|
||||
})],
|
||||
controllers: [StarsController, PostsController],
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
import { Global, Module } from '@nestjs/common';
|
||||
import { RedisService } from '@gitroom/nestjs-libraries/redis/redis.service';
|
||||
|
||||
@Global()
|
||||
@Module({
|
||||
imports: [],
|
||||
controllers: [],
|
||||
providers: [RedisService],
|
||||
get exports() {
|
||||
return this.providers;
|
||||
},
|
||||
})
|
||||
export class RedisModule {}
|
||||
|
|
@ -1,34 +1,5 @@
|
|||
import { Injectable, OnModuleInit } from '@nestjs/common';
|
||||
import { createClient } from 'redis';
|
||||
import { Redis } from 'ioredis';
|
||||
|
||||
export const ioRedis = new Redis(process.env.REDIS_URL!, {
|
||||
maxRetriesPerRequest: null,
|
||||
});
|
||||
|
||||
const client = createClient({
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
url: process.env.REDIS_URL,
|
||||
});
|
||||
|
||||
client.on('error', (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
const pubSub = client.duplicate();
|
||||
|
||||
@Injectable()
|
||||
export class RedisService implements OnModuleInit {
|
||||
async onModuleInit() {
|
||||
await client.connect();
|
||||
}
|
||||
|
||||
client() {
|
||||
return client;
|
||||
}
|
||||
|
||||
pubSub() {
|
||||
return pubSub;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -7,8 +7,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"dev": "concurrently \"stripe listen --forward-to localhost:3000/stripe\" \"nx run-many --target=serve --projects=frontend,backend,workers --parallel=4\"",
|
||||
"docs-build": "nx run docs:build:development",
|
||||
"docs-dev": "nx run docs:serve:development",
|
||||
"docs": "nx run docs:serve:development",
|
||||
"workers": "nx run workers:serve:development",
|
||||
"cron": "nx run cron:serve:development",
|
||||
"command": "nx run commands:build && nx run commands:command",
|
||||
|
|
|
|||
Loading…
Reference in New Issue