diff --git a/apps/backend/src/api/routes/analytics.controller.ts b/apps/backend/src/api/routes/analytics.controller.ts index 4bef90ca..c1f3aee9 100644 --- a/apps/backend/src/api/routes/analytics.controller.ts +++ b/apps/backend/src/api/routes/analytics.controller.ts @@ -23,18 +23,15 @@ export class AnalyticsController { @Get('/trending') async getTrending() { + const stars = await this._starsService.predictTrending(10); + const findFirst = stars.find(star => dayjs(star).isBefore(dayjs())); const trendings = (await this._starsService.getTrending('')).reverse(); const dates = trendings.map(result => dayjs(result.date).toDate()); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-expect-error - const intervals = dates.slice(1).map((date, i) => (date - dates[i]) / (1000 * 60 * 60 * 24)); - const nextInterval = intervals.length === 0 ? null : mean(intervals); const lastTrendingDate = dates[dates.length - 1]; - const nextTrendingDate = !nextInterval ? 'Not possible yet' : dayjs(new Date(lastTrendingDate.getTime() + nextInterval * 24 * 60 * 60 * 1000)).format('YYYY-MM-DD HH:mm:ss'); return { last: dayjs(lastTrendingDate).format('YYYY-MM-DD HH:mm:ss'), - predictions: nextTrendingDate + predictions: findFirst } } diff --git a/apps/docs/howitworks.mdx b/apps/docs/howitworks.mdx index 446052d5..83a69c54 100644 --- a/apps/docs/howitworks.mdx +++ b/apps/docs/howitworks.mdx @@ -3,7 +3,7 @@ title: How it works description: 'Learn the architecture of the project' --- -crosspublic is a tool to convert private communication into public knowledge.
+Gitroom is a tool to convert private communication into public knowledge.
The entire project is built under [NX](https://nx.dev/) to have a monorepo with multiple projects.

Unlike other NX project, this project has one `.env` file that is shared between all the apps.
It makes it easier to develop and deploy the project.

@@ -20,7 +20,7 @@ When deploying to websites like [Railway](https://railway.app) or [Heroku](https Architecture of crosspublic ## Architecture @@ -49,7 +49,7 @@ It's the website for the end-users to see the FAQ.
It contains a simple search bar and a list of questions.
The search bar uses [Algolia](https://www.algolia.com/) to search through the questions.
It uses the style from the control panel to customize the website.
-The tenants cache each pages on the `crosspublic.com/[domainName]` path, it uses a middleware to rewrite the Vercel apex domain or the custom domain to the route.
+The tenants cache each pages on the `Gitroom.com/[domainName]` path, it uses a middleware to rewrite the Vercel apex domain or the custom domain to the route.
### Discord The Discord bot is built with [Discord.JS](https://discord.js.org/) and [NestJS](https://nestjs.com/).
diff --git a/apps/docs/introduction.mdx b/apps/docs/introduction.mdx index b2fbd974..ddb8535f 100644 --- a/apps/docs/introduction.mdx +++ b/apps/docs/introduction.mdx @@ -1,6 +1,6 @@ --- title: Introduction -description: 'Welcome to crosspublic documentation' +description: 'Welcome to Gitroom documentation' ---
@@ -16,22 +16,25 @@ description: 'Welcome to crosspublic documentation' />
-## What is crosspublic? +## What is Gitroom? -crosspublic is a tool to convert private communication into public knowledge.
-Most of your users are not on your communication channels, and they are not aware of the questions that have already been asked and answered.
+Gitroom can help you launch your open-source tool every week
+ ## Architecture -crosspublic is an [NX monorepo](https://nx.dev) that contains the backend, control panel, discord bot, marketing website and the docs.

+Gitroom is an [NX monorepo](https://nx.dev) that contains a backend, a frontend, workers, cron jobs and the docs.

Unlike other NX project, this project has one `.env` file that is shared between all the apps.
It makes it easier to develop and deploy the project.

When deploying to websites like [Railway](https://railway.app) or [Heroku](https://heroku.com), you can use a shared environment variables for all the apps.
**It has four main components:** -- `Panel` - NextJS control panel to manage your FAQ, it also contains the public website of every user FAQ page. -- `Tenants` - NextJS website that contains the FAQ of every end-user. -- `Backend` - NestJS that operate as the server for both the bots and the website. -- `Discord` - Discord bot that listen to messages, and send them to the backend. +- `frontend` - NextJS control panel serving as the admin dashboard for the project. +- `backend` - NestJS backend that serves as the API for the frontend. +- `cron` - NestJS cron jobs that run every X to update the database with new trendings, In the future there will also be a bot of Slack, Intercom, Telegram, and more. diff --git a/apps/docs/logo/dark.png b/apps/docs/logo/dark.png index ee9a3d43..52ed5da2 100644 Binary files a/apps/docs/logo/dark.png and b/apps/docs/logo/dark.png differ diff --git a/apps/docs/logo/light.png b/apps/docs/logo/light.png index da52061a..041e2a8c 100644 Binary files a/apps/docs/logo/light.png and b/apps/docs/logo/light.png differ diff --git a/apps/docs/openapi.json b/apps/docs/openapi.json index ebdb91d7..81ddedfb 100644 --- a/apps/docs/openapi.json +++ b/apps/docs/openapi.json @@ -1 +1 @@ -{"openapi":"3.0.0","paths":{"/stripe":{"post":{"operationId":"StripeController_stripe","parameters":[],"responses":{"201":{"description":""}},"tags":["Stripe"]}},"/auth/register":{"post":{"operationId":"AuthController_register","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgUserDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/auth/login":{"post":{"operationId":"AuthController_login","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginUserDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/auth/forgot":{"post":{"operationId":"AuthController_forgot","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/auth/forgot-return":{"post":{"operationId":"AuthController_forgotReturn","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotReturnPasswordDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/user/self":{"get":{"operationId":"UsersController_getSelf","parameters":[],"responses":{"200":{"description":""}},"tags":["User"]}},"/user/subscription":{"get":{"operationId":"UsersController_getSubscription","parameters":[],"responses":{"200":{"description":""}},"tags":["User"]}},"/user/subscription/tiers":{"get":{"operationId":"UsersController_tiers","parameters":[],"responses":{"200":{"description":""}},"tags":["User"]}},"/user/join-org":{"post":{"operationId":"UsersController_joinOrg","parameters":[],"responses":{"201":{"description":""}},"tags":["User"]}},"/user/organizations":{"get":{"operationId":"UsersController_getOrgs","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"tags":["User"]}},"/user/change-org":{"post":{"operationId":"UsersController_changeOrg","parameters":[],"responses":{"201":{"description":""}},"tags":["User"]}},"/analytics":{"get":{"operationId":"AnalyticsController_getStars","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"tags":["Analytics"]}},"/analytics/trending":{"get":{"operationId":"AnalyticsController_getTrending","parameters":[],"responses":{"200":{"description":""}},"tags":["Analytics"]}},"/analytics/stars":{"post":{"operationId":"AnalyticsController_getStarsFilter","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StarsListDto"}}}},"responses":{"201":{"description":""}},"tags":["Analytics"]}},"/integrations":{"get":{"operationId":"IntegrationsController_getIntegration","parameters":[],"responses":{"200":{"description":""}},"tags":["Integrations"]},"delete":{"operationId":"IntegrationsController_deleteChannel","parameters":[],"responses":{"200":{"description":""}},"tags":["Integrations"]}},"/integrations/list":{"get":{"operationId":"IntegrationsController_getIntegrationList","parameters":[],"responses":{"200":{"description":""}},"tags":["Integrations"]}},"/integrations/social/{integration}":{"get":{"operationId":"IntegrationsController_getIntegrationUrl","parameters":[{"name":"integration","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Integrations"]}},"/integrations/function":{"post":{"operationId":"IntegrationsController_functionIntegration","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationFunctionDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Integrations"]}},"/integrations/article/{integration}/connect":{"post":{"operationId":"IntegrationsController_connectArticle","parameters":[{"name":"integration","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyDto"}}}},"responses":{"201":{"description":""}},"tags":["Integrations"]}},"/integrations/social/{integration}/connect":{"post":{"operationId":"IntegrationsController_connectSocialMedia","parameters":[{"name":"integration","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectIntegrationDto"}}}},"responses":{"201":{"description":""}},"tags":["Integrations"]}},"/integrations/disable":{"post":{"operationId":"IntegrationsController_disableChannel","parameters":[],"responses":{"201":{"description":""}},"tags":["Integrations"]}},"/integrations/enable":{"post":{"operationId":"IntegrationsController_enableChannel","parameters":[],"responses":{"201":{"description":""}},"tags":["Integrations"]}},"/settings/github":{"get":{"operationId":"SettingsController_getConnectedGithubAccounts","parameters":[],"responses":{"200":{"description":""}},"tags":["Settings"]},"post":{"operationId":"SettingsController_addGitHub","parameters":[],"responses":{"201":{"description":""}},"tags":["Settings"]}},"/settings/github/url":{"get":{"operationId":"SettingsController_authUrl","parameters":[],"responses":{"200":{"description":""}},"tags":["Settings"]}},"/settings/organizations/{id}":{"get":{"operationId":"SettingsController_getOrganizations","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Settings"]},"post":{"operationId":"SettingsController_updateGitHubLogin","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"tags":["Settings"]}},"/settings/organizations/{id}/{github}":{"get":{"operationId":"SettingsController_getRepositories","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"github","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Settings"]}},"/settings/repository/{id}":{"delete":{"operationId":"SettingsController_deleteRepository","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Settings"]}},"/settings/team":{"get":{"operationId":"SettingsController_getTeam","parameters":[],"responses":{"200":{"description":""}},"tags":["Settings"]},"post":{"operationId":"SettingsController_inviteTeamMember","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddTeamMemberDto"}}}},"responses":{"201":{"description":""}},"tags":["Settings"]}},"/settings/team/{id}":{"delete":{"operationId":"SettingsController_deleteTeamMember","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Settings"]}},"/posts":{"get":{"operationId":"PostsController_getPosts","parameters":[{"name":"week","required":true,"in":"query","schema":{"minimum":1,"maximum":52,"type":"number"}},{"name":"year","required":true,"in":"query","schema":{"minimum":2022,"maximum":2034,"type":"number"}}],"responses":{"200":{"description":""}},"tags":["Posts"]},"post":{"operationId":"PostsController_createPost","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePostDto"}}}},"responses":{"201":{"description":""}},"tags":["Posts"]}},"/posts/predict-trending":{"get":{"operationId":"PostsController_predictTrending","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}},"tags":["Posts"]}},"/posts/old":{"get":{"operationId":"PostsController_oldPosts","parameters":[{"name":"date","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Posts"]}},"/posts/{id}":{"get":{"operationId":"PostsController_getPost","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Posts"]}},"/posts/{group}":{"delete":{"operationId":"PostsController_deletePost","parameters":[{"name":"group","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Posts"]}},"/posts/{id}/date":{"put":{"operationId":"PostsController_changeDate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Posts"]}},"/media":{"post":{"operationId":"MediaController_uploadFile","parameters":[],"responses":{"201":{"description":""}},"tags":["Media"]},"get":{"operationId":"MediaController_getMedia","parameters":[{"name":"page","required":true,"in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":""}},"tags":["Media"]}},"/comments":{"post":{"operationId":"CommentsController_addComment","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCommentDto"}}}},"responses":{"201":{"description":""}},"tags":["Comments"]}},"/comments/{id}":{"post":{"operationId":"CommentsController_addCommentTocComment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCommentDto"}}}},"responses":{"201":{"description":""}},"tags":["Comments"]},"put":{"operationId":"CommentsController_editComment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCommentDto"}}}},"responses":{"200":{"description":""}},"tags":["Comments"]},"delete":{"operationId":"CommentsController_deleteComment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Comments"]}},"/comments/{date}":{"get":{"operationId":"CommentsController_loadAllCommentsAndSubCommentsForADate","parameters":[{"name":"date","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Comments"]}},"/billing/check/{id}":{"get":{"operationId":"BillingController_checkId","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Billing"]}},"/billing/subscribe":{"post":{"operationId":"BillingController_subscribe","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSubscribeDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Billing"]}},"/billing/portal":{"get":{"operationId":"BillingController_modifyPayment","parameters":[],"responses":{"200":{"description":""}},"tags":["Billing"]}},"/billing":{"get":{"operationId":"BillingController_getCurrentBilling","parameters":[],"responses":{"200":{"description":""}},"tags":["Billing"]}},"/billing/cancel":{"post":{"operationId":"BillingController_cancel","parameters":[],"responses":{"201":{"description":""}},"tags":["Billing"]}},"/billing/prorate":{"post":{"operationId":"BillingController_prorate","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSubscribeDto"}}}},"responses":{"201":{"description":""}},"tags":["Billing"]}},"/notifications":{"get":{"operationId":"NotificationsController_mainPageList","parameters":[],"responses":{"200":{"description":""}},"tags":["Notifications"]}},"/notifications/list":{"get":{"operationId":"NotificationsController_notifications","parameters":[],"responses":{"200":{"description":""}},"tags":["Notifications"]}}},"info":{"title":"crosspublic Swagger file","description":"API description","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"schemas":{"CreateOrgUserDto":{"type":"object","properties":{"password":{"type":"string","minLength":3},"provider":{"type":"object"},"providerToken":{"type":"string"},"email":{"type":"string"},"company":{"type":"string","minLength":3}},"required":["password","provider","providerToken","email","company"]},"LoginUserDto":{"type":"object","properties":{"password":{"type":"string","minLength":3},"provider":{"type":"object"},"providerToken":{"type":"string"},"email":{"type":"string"}},"required":["password","provider","providerToken","email"]},"ForgotPasswordDto":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]},"ForgotReturnPasswordDto":{"type":"object","properties":{"password":{"type":"string","minLength":3},"repeatPassword":{"type":"string","enum":["zxKvwYYHO7"]},"token":{"type":"string","minLength":5}},"required":["password","repeatPassword","token"]},"StarsListDto":{"type":"object","properties":{"page":{"type":"number"},"key":{"type":"string","enum":["login","totalStars","stars","date","forks","totalForks"]},"state":{"type":"string","enum":["desc","asc"]}},"required":["page","key","state"]},"IntegrationFunctionDto":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"string"},"data":{"type":"object"}},"required":["name","id","data"]},"ApiKeyDto":{"type":"object","properties":{"api":{"type":"string","minLength":4}},"required":["api"]},"ConnectIntegrationDto":{"type":"object","properties":{"state":{"type":"string"},"code":{"type":"string"}},"required":["state","code"]},"AddTeamMemberDto":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string","enum":["USER","ADMIN"]},"sendEmail":{"type":"boolean"}},"required":["email","role","sendEmail"]},"Integration":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"MediaDto":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"}},"required":["id","path"]},"PostContent":{"type":"object","properties":{"content":{"type":"string","minLength":6},"id":{"type":"string"},"image":{"type":"array","items":{"$ref":"#/components/schemas/MediaDto"}}},"required":["content","id","image"]},"Post":{"type":"object","properties":{"integration":{"$ref":"#/components/schemas/Integration"},"value":{"type":"array","items":{"$ref":"#/components/schemas/PostContent"}},"group":{"type":"string"},"settings":{"type":"object"}},"required":["integration","value","group","settings"]},"CreatePostDto":{"type":"object","properties":{"type":{"type":"string","enum":["draft","schedule","now"]},"date":{"type":"string"},"posts":{"type":"array","items":{"$ref":"#/components/schemas/Post"}}},"required":["type","date","posts"]},"AddCommentDto":{"type":"object","properties":{"content":{"type":"string"},"date":{"type":"string"}},"required":["content","date"]},"BillingSubscribeDto":{"type":"object","properties":{"total":{"type":"number","minimum":1,"maximum":60},"period":{"type":"string","enum":["MONTHLY","YEARLY"]},"billing":{"type":"string","enum":["STANDARD","PRO"]}},"required":["total","period","billing"]}}}} \ No newline at end of file +{"openapi":"3.0.0","paths":{"/stripe":{"post":{"operationId":"StripeController_stripe","parameters":[],"responses":{"201":{"description":""}},"tags":["Stripe"]}},"/auth/register":{"post":{"operationId":"AuthController_register","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgUserDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/auth/login":{"post":{"operationId":"AuthController_login","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginUserDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/auth/forgot":{"post":{"operationId":"AuthController_forgot","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/auth/forgot-return":{"post":{"operationId":"AuthController_forgotReturn","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotReturnPasswordDto"}}}},"responses":{"201":{"description":""}},"tags":["Auth"]}},"/user/self":{"get":{"operationId":"UsersController_getSelf","parameters":[],"responses":{"200":{"description":""}},"tags":["User"]}},"/user/subscription":{"get":{"operationId":"UsersController_getSubscription","parameters":[],"responses":{"200":{"description":""}},"tags":["User"]}},"/user/subscription/tiers":{"get":{"operationId":"UsersController_tiers","parameters":[],"responses":{"200":{"description":""}},"tags":["User"]}},"/user/join-org":{"post":{"operationId":"UsersController_joinOrg","parameters":[],"responses":{"201":{"description":""}},"tags":["User"]}},"/user/organizations":{"get":{"operationId":"UsersController_getOrgs","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"tags":["User"]}},"/user/change-org":{"post":{"operationId":"UsersController_changeOrg","parameters":[],"responses":{"201":{"description":""}},"tags":["User"]}},"/analytics":{"get":{"operationId":"AnalyticsController_getStars","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}},"tags":["Analytics"]}},"/analytics/trending":{"get":{"operationId":"AnalyticsController_getTrending","parameters":[],"responses":{"200":{"description":""}},"tags":["Analytics"]}},"/analytics/stars":{"post":{"operationId":"AnalyticsController_getStarsFilter","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StarsListDto"}}}},"responses":{"201":{"description":""}},"tags":["Analytics"]}},"/integrations":{"get":{"operationId":"IntegrationsController_getIntegration","parameters":[],"responses":{"200":{"description":""}},"tags":["Integrations"]},"delete":{"operationId":"IntegrationsController_deleteChannel","parameters":[],"responses":{"200":{"description":""}},"tags":["Integrations"]}},"/integrations/list":{"get":{"operationId":"IntegrationsController_getIntegrationList","parameters":[],"responses":{"200":{"description":""}},"tags":["Integrations"]}},"/integrations/social/{integration}":{"get":{"operationId":"IntegrationsController_getIntegrationUrl","parameters":[{"name":"integration","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Integrations"]}},"/integrations/function":{"post":{"operationId":"IntegrationsController_functionIntegration","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationFunctionDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Integrations"]}},"/integrations/article/{integration}/connect":{"post":{"operationId":"IntegrationsController_connectArticle","parameters":[{"name":"integration","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyDto"}}}},"responses":{"201":{"description":""}},"tags":["Integrations"]}},"/integrations/social/{integration}/connect":{"post":{"operationId":"IntegrationsController_connectSocialMedia","parameters":[{"name":"integration","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectIntegrationDto"}}}},"responses":{"201":{"description":""}},"tags":["Integrations"]}},"/integrations/disable":{"post":{"operationId":"IntegrationsController_disableChannel","parameters":[],"responses":{"201":{"description":""}},"tags":["Integrations"]}},"/integrations/enable":{"post":{"operationId":"IntegrationsController_enableChannel","parameters":[],"responses":{"201":{"description":""}},"tags":["Integrations"]}},"/settings/github":{"get":{"operationId":"SettingsController_getConnectedGithubAccounts","parameters":[],"responses":{"200":{"description":""}},"tags":["Settings"]},"post":{"operationId":"SettingsController_addGitHub","parameters":[],"responses":{"201":{"description":""}},"tags":["Settings"]}},"/settings/github/url":{"get":{"operationId":"SettingsController_authUrl","parameters":[],"responses":{"200":{"description":""}},"tags":["Settings"]}},"/settings/organizations/{id}":{"get":{"operationId":"SettingsController_getOrganizations","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Settings"]},"post":{"operationId":"SettingsController_updateGitHubLogin","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"tags":["Settings"]}},"/settings/organizations/{id}/{github}":{"get":{"operationId":"SettingsController_getRepositories","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"github","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Settings"]}},"/settings/repository/{id}":{"delete":{"operationId":"SettingsController_deleteRepository","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Settings"]}},"/settings/team":{"get":{"operationId":"SettingsController_getTeam","parameters":[],"responses":{"200":{"description":""}},"tags":["Settings"]},"post":{"operationId":"SettingsController_inviteTeamMember","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddTeamMemberDto"}}}},"responses":{"201":{"description":""}},"tags":["Settings"]}},"/settings/team/{id}":{"delete":{"operationId":"SettingsController_deleteTeamMember","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Settings"]}},"/posts":{"get":{"operationId":"PostsController_getPosts","parameters":[{"name":"week","required":true,"in":"query","schema":{"minimum":1,"maximum":52,"type":"number"}},{"name":"year","required":true,"in":"query","schema":{"minimum":2022,"maximum":2034,"type":"number"}}],"responses":{"200":{"description":""}},"tags":["Posts"]},"post":{"operationId":"PostsController_createPost","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePostDto"}}}},"responses":{"201":{"description":""}},"tags":["Posts"]}},"/posts/predict-trending":{"get":{"operationId":"PostsController_predictTrending","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}},"tags":["Posts"]}},"/posts/old":{"get":{"operationId":"PostsController_oldPosts","parameters":[{"name":"date","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Posts"]}},"/posts/{id}":{"get":{"operationId":"PostsController_getPost","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Posts"]}},"/posts/{group}":{"delete":{"operationId":"PostsController_deletePost","parameters":[{"name":"group","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Posts"]}},"/posts/{id}/date":{"put":{"operationId":"PostsController_changeDate","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Posts"]}},"/media":{"post":{"operationId":"MediaController_uploadFile","parameters":[],"responses":{"201":{"description":""}},"tags":["Media"]},"get":{"operationId":"MediaController_getMedia","parameters":[{"name":"page","required":true,"in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":""}},"tags":["Media"]}},"/comments":{"post":{"operationId":"CommentsController_addComment","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCommentDto"}}}},"responses":{"201":{"description":""}},"tags":["Comments"]}},"/comments/{id}":{"post":{"operationId":"CommentsController_addCommentTocComment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCommentDto"}}}},"responses":{"201":{"description":""}},"tags":["Comments"]},"put":{"operationId":"CommentsController_editComment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCommentDto"}}}},"responses":{"200":{"description":""}},"tags":["Comments"]},"delete":{"operationId":"CommentsController_deleteComment","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Comments"]}},"/comments/{date}":{"get":{"operationId":"CommentsController_loadAllCommentsAndSubCommentsForADate","parameters":[{"name":"date","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Comments"]}},"/billing/check/{id}":{"get":{"operationId":"BillingController_checkId","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["Billing"]}},"/billing/subscribe":{"post":{"operationId":"BillingController_subscribe","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSubscribeDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"tags":["Billing"]}},"/billing/portal":{"get":{"operationId":"BillingController_modifyPayment","parameters":[],"responses":{"200":{"description":""}},"tags":["Billing"]}},"/billing":{"get":{"operationId":"BillingController_getCurrentBilling","parameters":[],"responses":{"200":{"description":""}},"tags":["Billing"]}},"/billing/cancel":{"post":{"operationId":"BillingController_cancel","parameters":[],"responses":{"201":{"description":""}},"tags":["Billing"]}},"/billing/prorate":{"post":{"operationId":"BillingController_prorate","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSubscribeDto"}}}},"responses":{"201":{"description":""}},"tags":["Billing"]}},"/notifications":{"get":{"operationId":"NotificationsController_mainPageList","parameters":[],"responses":{"200":{"description":""}},"tags":["Notifications"]}},"/notifications/list":{"get":{"operationId":"NotificationsController_notifications","parameters":[],"responses":{"200":{"description":""}},"tags":["Notifications"]}}},"info":{"title":"Gitroom Swagger file","description":"API description","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"schemas":{"CreateOrgUserDto":{"type":"object","properties":{"password":{"type":"string","minLength":3},"provider":{"type":"object"},"providerToken":{"type":"string"},"email":{"type":"string"},"company":{"type":"string","minLength":3}},"required":["password","provider","providerToken","email","company"]},"LoginUserDto":{"type":"object","properties":{"password":{"type":"string","minLength":3},"provider":{"type":"object"},"providerToken":{"type":"string"},"email":{"type":"string"}},"required":["password","provider","providerToken","email"]},"ForgotPasswordDto":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]},"ForgotReturnPasswordDto":{"type":"object","properties":{"password":{"type":"string","minLength":3},"repeatPassword":{"type":"string","enum":["zxKvwYYHO7"]},"token":{"type":"string","minLength":5}},"required":["password","repeatPassword","token"]},"StarsListDto":{"type":"object","properties":{"page":{"type":"number"},"key":{"type":"string","enum":["login","totalStars","stars","date","forks","totalForks"]},"state":{"type":"string","enum":["desc","asc"]}},"required":["page","key","state"]},"IntegrationFunctionDto":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"string"},"data":{"type":"object"}},"required":["name","id","data"]},"ApiKeyDto":{"type":"object","properties":{"api":{"type":"string","minLength":4}},"required":["api"]},"ConnectIntegrationDto":{"type":"object","properties":{"state":{"type":"string"},"code":{"type":"string"}},"required":["state","code"]},"AddTeamMemberDto":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string","enum":["USER","ADMIN"]},"sendEmail":{"type":"boolean"}},"required":["email","role","sendEmail"]},"Integration":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"MediaDto":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"string"}},"required":["id","path"]},"PostContent":{"type":"object","properties":{"content":{"type":"string","minLength":6},"id":{"type":"string"},"image":{"type":"array","items":{"$ref":"#/components/schemas/MediaDto"}}},"required":["content","id","image"]},"Post":{"type":"object","properties":{"integration":{"$ref":"#/components/schemas/Integration"},"value":{"type":"array","items":{"$ref":"#/components/schemas/PostContent"}},"group":{"type":"string"},"settings":{"type":"object"}},"required":["integration","value","group","settings"]},"CreatePostDto":{"type":"object","properties":{"type":{"type":"string","enum":["draft","schedule","now"]},"date":{"type":"string"},"posts":{"type":"array","items":{"$ref":"#/components/schemas/Post"}}},"required":["type","date","posts"]},"AddCommentDto":{"type":"object","properties":{"content":{"type":"string"},"date":{"type":"string"}},"required":["content","date"]},"BillingSubscribeDto":{"type":"object","properties":{"total":{"type":"number","minimum":1,"maximum":60},"period":{"type":"string","enum":["MONTHLY","YEARLY"]},"billing":{"type":"string","enum":["STANDARD","PRO"]}},"required":["total","period","billing"]}}}} \ No newline at end of file diff --git a/apps/docs/quickstart.mdx b/apps/docs/quickstart.mdx index 9002eca0..1aaa04eb 100644 --- a/apps/docs/quickstart.mdx +++ b/apps/docs/quickstart.mdx @@ -60,7 +60,7 @@ Create a new [Algolia](https://www.algolia.com/) account, head over to the [API ### Clone the repository ```bash -git clone https://github.com/github-20k/crosspublic +git clone https://github.com/github-20k/Gitroom ``` ### Copy environment variables @@ -69,7 +69,7 @@ Copy the `.env.example` file to `.env` and fill in the values ```bash DISCORD_CLIENT= DISCORD_TOKEN= -DATABASE_URL=postgres://root:your_password@localhost:5432/crosspublic +DATABASE_URL=postgres://root:your_password@localhost:5432/Gitroom BACKEND_URL=http://localhost:3000 NEXT_PUBLIC_BACKEND_URL=http://localhost:3000 BACKEND_TOKEN_PROTECTOR=