Skip to content

Commit

Permalink
Merge to crowd-linux
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspergrom committed Oct 9, 2023
2 parents 8b90ae8 + 7a66088 commit f8716fa
Show file tree
Hide file tree
Showing 311 changed files with 4,134 additions and 4,970 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
node-version: 16

- name: Install and build libraries
run: ../services/scripts/install_lib_packages.sh && ../services/scripts/build_libs.sh
run: ../services/scripts/install_lib_packages.sh

- name: Install root dependencies
run: npm ci
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
node-version: 16

- name: Install packages
run: ./scripts/install_all_packages.sh && ./scripts/build_libs.sh
run: ./scripts/install_all_packages.sh

- name: Check library linting, format and typescript
run: ./scripts/lint_libs.sh
Expand All @@ -80,7 +80,7 @@ jobs:
node-version: 16

- name: Install and build libraries
run: ../services/scripts/install_lib_packages.sh && ../services/scripts/build_libs.sh
run: ../services/scripts/install_lib_packages.sh

- name: Install root dependencies
run: npm ci
Expand All @@ -107,7 +107,7 @@ jobs:
node-version: 16

- name: Install and build libraries
run: ../services/scripts/install_lib_packages.sh && ../services/scripts/build_libs.sh
run: ../services/scripts/install_lib_packages.sh

- name: Install dependencies
run: npm ci
Expand Down
70 changes: 46 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,58 @@
<!-- PROJECT LOGO -->
<p align="center">
<a href="https://github.com/CrowdDotDev/crowd.dev">
<img src="https://user-images.githubusercontent.com/41432658/198395147-20caad79-6989-4827-bb0b-32a406770480.png" alt="Header Logo">
<a href="https://github.com/CrowdDotDev/crowd.dev"> </a>

</a>
<img src="https://github.com/CrowdDotDev/crowd.dev/assets/41432658/e5970c3a-095c-46ea-b93b-eb517bcd8a4f" alt="crowd.dev icon" width="120px">

<h2 align="center">Effortlessly centralize community, product, and customer data in one database</h2>

<h2 align="center">Effortlessly centralize community, product, and customer data</h2>

<p align="center">
<br>
<a href="https://crowd.dev/sign-up">Cloud Version (Beta)</a>
|
<a href="https://docs.crowd.dev">Docs</a>
|
<a href="https://crowd.dev/discord">Discord</a>
|
<a href="https://crowd.dev/twitter">Twitter</a>
|
<a href="https://crowd.dev/newsletter-sign-up">Newsletter</a>
|
<a href="https://crowd.dev/roadmap">Roadmap</a>
<a href="https://crowd.dev/sign-up">🌐 Cloud version (beta)</a>
·
<a href="https://docs.crowd.dev">📖 Docs</a>
·
<a href="https://crowd.dev/discord">❤️ Discord</a>
·
<a href="https://crowd.dev/newsletter-sign-up">📣 Newsletter</a>
·
<a href="https://crowd.dev/roadmap">🗺️ Roadmap</a>
</p>
</p>

<br>

<!-- BODY -->

## About crowd.dev
<img src="https://user-images.githubusercontent.com/41432658/198830271-cbe6d3c7-0c46-4539-98cc-b13c495ddedf.png" alt="UI Home screen">

crowd.dev is an open-source platform to centralize community, product, and customer data to understand who is engaging with your open source project.

More than 90% of companies use open-source software. Yet, most of these companies are unaware of the highly relevant commercial offerings of open-source projects. For open-source companies, tapping into this audience is the most significant opportunity for commercialization. What stands in the way? Go-To-Market teams lack needed data across community engagement, interaction with developer docs, and self-hosted deployments.
## Table of Contents
- [About crowd.dev](#about-crowddev)
- [Features](#✨-features)
- [Getting started](#🚀-getting-started)
- [Roadmap](#🗺️-roadmap)
- [Stay up-to-date](#🔔-stay-up-to-date)
- [Contribution](#✍️-contribution)
- [License](#⚖️-license)
- [Security](#🔒-security)
- [Book a call](#📞-book-a-call)

With crowd.dev, you get full visibility into all platforms and can take actions to strengthen and grow your company’s most valuable asset - your developer community. Self-hosted or hosted by us, with developers in mind, open to extensions, and with full control over your data.
## About crowd.dev
crowd.dev is the developer data platform (DDP) that lets companies centralize all touch points developers have with their product and brand - be it in community (e.g. Stack Overflow or Reddit), product (open-source or SaaS), or commercial channels (e.g. HubSpot). The platform pulls data from a variety of different sources, normalizes it, matches identities across platforms, and enriches it with 3rd party data. The result is a unified 360-view of who the developers are that engage with your product and community, which companies they work for, and where they stand in their personal customer journey.

<img src="https://user-images.githubusercontent.com/41432658/198830271-cbe6d3c7-0c46-4539-98cc-b13c495ddedf.png" alt="UI Home screen">
crowd.dev is open-source, built with developers in mind, available for both hosted and self-hosted deployments, open to extensions, and offers full control over your data.

**To our **users**:**
- You can get actively involved, contribute to our roadmap, and turn crowd.dev into the tool you always wanted.
- We are open regarding what we are building, allowing you to take a look inside, and making sure we handle your data in a privacy-preserving way.
- You will never be locked in by us. Our interests as a company are aligned with yours and we need to make sure that we always deliver enough value to your with our commercial offering in relation to our pricing.

**To our developer community:**
- You can self-host crowd.dev to centralize data for your community or company while keeping full control over your data.
- Our product is build for extensibilty. If you can think of any use cases that you want to build with the data we collect and store for you, please go ahead and build it! We will be here to help out if you need us.
- You can actively contribute to crowd.dev (e.g. integrations), and we will be supporting you along the journey. Just take a look at our [Contributing guide](https://github.com/CrowdDotDev/crowd.dev/blob/main/CONTRIBUTING.md).

## ✨ Features

Expand All @@ -47,15 +66,12 @@ With crowd.dev, you get full visibility into all platforms and can take actions
- **Sentiment analysis and conversation detection** to stay on top of what's going on in your open source community. [cloud only]
- **[Eagle Eye](https://www.crowd.dev/eagle-eye)**: Monitor dev-focussed community platforms to find relevant content to engage with, helping you to gain developers’ mindshare and grow your community organically [cloud only]

## 🔔 Stay up-to-date

crowd.dev is still in beta and we ship new features every week. To stay in the loop, leave us a star and subscribe to our <a href="https://crowd.dev/newsletter-sign-up">monthly newsletter</a>. Thanks a lot! ❤️

## 🚀 Getting started

### Cloud version

Our <a href="https://crowd.dev/#waitlist">cloud version</a> is a fast, easy and free way to get started with crowd.dev.
Our <a href="https://app.crowd.dev/">cloud version</a> is a fast, easy and free way to get started with crowd.dev.

### Self-hosted version

Expand Down Expand Up @@ -106,6 +122,12 @@ For more information on development, you can <a href="https://docs.crowd.dev/doc

You can find more features on our [public roadmap](https://crowd.dev/roadmap). Feel free to also [open an issue](https://crowd.dev/open-an-issue) for anything you're missing.


## 🔔 Stay up-to-date

crowd.dev is still in beta and we ship new features every week. To stay in the loop, leave us a star and subscribe to our <a href="https://crowd.dev/newsletter-sign-up">monthly newsletter</a>. Thanks a lot! ❤️


## ✍️ Contribution

There are many ways you can contribute to crowd.dev! Here are a few options:
Expand Down
23 changes: 20 additions & 3 deletions backend/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/* eslint-disable @typescript-eslint/no-var-requires */

const tsconfig = require('./tsconfig.json')

const fromPairs = (pairs) => pairs.reduce((res, [key, value]) => ({ ...res, [key]: value }), {})

/**
* tsconfig の paths の設定から moduleNameMapper を生成する
* {"@app/*": ["src/*"]} -> {"@app/(.*)": "<rootDir>/src/$1"}
*/
function moduleNameMapperFromTSPaths(tsconf) {
return fromPairs(
Object.entries(tsconf.compilerOptions.paths).map(([k, [v]]) => [
k.replace(/\*/, '(.*)'),
`<rootDir>/${tsconf.compilerOptions.baseUrl}/${v.replace(/\*/, '$1')}`,
]),
)
}

/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
Expand All @@ -17,8 +36,6 @@ module.exports = {
testRegex: ['__tests__/.*tests?.ts$'],
bail: false,
roots: ['<rootDir>'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
moduleNameMapper: moduleNameMapperFromTSPaths(tsconfig),
transformIgnorePatterns: ['node_modules/(?!(axios|@crowd/))/'],
}
9 changes: 5 additions & 4 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"description": "Backend",
"scripts": {
"start:api": "SERVICE=api TS_NODE_TRANSPILE_ONLY=true node -r tsconfig-paths/register -r ts-node/register src/bin/api.ts",
"start:api:dev": "nodemon --watch \"src/**/*.ts\" -e ts,json --exec \"npm run start:api\"",
"start:api:dev": "nodemon --watch \"src/**/*.ts\" --watch ../services/libs -e ts,json --exec \"npm run start:api\"",
"start:api:dev:local": "set -a && . ./.env.dist.local && . ./.env.override.local && set +a && npm run start:api:dev",
"start:job-generator": "SERVICE=job-generator TS_NODE_TRANSPILE_ONLY=true node -r tsconfig-paths/register -r ts-node/register src/bin/job-generator.ts",
"start:job-generator:dev": "nodemon --watch \"src/**/*.ts\" -e ts,json --exec \"npm run start:job-generator\"",
"start:job-generator:dev": "nodemon --watch \"src/**/*.ts\" --watch ../services/libs -e ts,json --exec \"npm run start:job-generator\"",
"start:job-generator:dev:local": "set -a && . ./.env.dist.local && . ./.env.override.local && set +a && npm run start:job-generator:dev",
"start:nodejs-worker": "SERVICE=nodejs-worker TS_NODE_TRANSPILE_ONLY=true node -r tsconfig-paths/register -r ts-node/register src/bin/nodejs-worker",
"start:nodejs-worker:dev": "nodemon --watch \"src/**/*.ts\" -e ts,json --exec \"npm run start:nodejs-worker\"",
"start:nodejs-worker:dev": "nodemon --watch \"src/**/*.ts\" --watch ../services/libs -e ts,json --exec \"npm run start:nodejs-worker\"",
"start:nodejs-worker:dev:local": "set -a && . ./.env.dist.local && . ./.env.override.local && set +a && npm run start:nodejs-worker:dev",
"start:discord-ws": "SERVICE=discord-ws TS_NODE_TRANSPILE_ONLY=true node -r tsconfig-paths/register -r ts-node/register src/bin/discord-ws.ts",
"start:discord-ws:dev": "nodemon --watch \"src/**/*.ts\" -e ts,json --exec \"npm run start:discord-ws\"",
"start:discord-ws:dev": "nodemon --watch \"src/**/*.ts\" --watch ../services/libs -e ts,json --exec \"npm run start:discord-ws\"",
"start:discord-ws:dev:local": "set -a && . ./.env.dist.local && . ./.env.override.local && set +a && npm run start:discord-ws:dev",
"build": "tsc && npm run build:documentation && cp package*json dist/ && cp .sequelizerc dist/.sequelizerc ",
"test": "../scripts/cli scaffold up-test && jest --clearCache && set -a && . ./.env.dist.local && . ./.env.test && set +a && NODE_ENV=test SERVICE=test jest --runInBand --verbose --forceExit",
Expand All @@ -36,6 +36,7 @@
"script:continue-run": "SERVICE=script TS_NODE_TRANSPILE_ONLY=true node -r tsconfig-paths/register -r ts-node/register src/bin/scripts/continue-run.ts",
"script:change-tenant-plan": "SERVICE=script TS_NODE_TRANSPILE_ONLY=true node -r tsconfig-paths/register -r ts-node/register src/bin/scripts/change-tenant-plan.ts",
"script:process-webhook": "SERVICE=script TS_NODE_TRANSPILE_ONLY=true node -r tsconfig-paths/register -r ts-node/register src/bin/scripts/process-webhook.ts",
"script:trigger-webhook": "SERVICE=script TS_NODE_TRANSPILE_ONLY=true node -r tsconfig-paths/register -r ts-node/register src/bin/scripts/trigger-webhook.ts",
"script:send-weekly-analytics-email": "SERVICE=script TS_NODE_TRANSPILE_ONLY=true node -r tsconfig-paths/register -r ts-node/register src/bin/scripts/send-weekly-analytics-email.ts",
"script:unleash-init": "SERVICE=script TS_NODE_TRANSPILE_ONLY=true node -r tsconfig-paths/register -r ts-node/register src/bin/scripts/unleash-init.ts",
"script:enrich-members-organizations": "SERVICE=script TS_NODE_TRANSPILE_ONLY=true node -r tsconfig-paths/register -r ts-node/register src/bin/scripts/enrich-members-and-organizations.ts",
Expand Down
4 changes: 1 addition & 3 deletions backend/src/api/conversation/conversationSettingsUpdate.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import Error403 from '../../errors/Error403'
import isFeatureEnabled from '../../feature-flags/isFeatureEnabled'
import Permissions from '../../security/permissions'
import ConversationService from '../../services/conversationService'
import PermissionChecker from '../../services/user/permissionChecker'
import { FeatureFlag } from '../../types/common'

export default async (req, res) => {
new PermissionChecker(req).validateHas(Permissions.values.conversationEdit)

if (req.body.customUrl && !(await isFeatureEnabled(FeatureFlag.COMMUNITY_HELP_CENTER_PRO, req))) {
if (req.body.customUrl) {
await req.responseHandler.error(
req,
res,
Expand Down
9 changes: 5 additions & 4 deletions backend/src/api/organization/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ export default (app) => {
`/tenant/:tenantId/organization/:organizationId/merge`,
safeWrap(require('./organizationMerge').default),
)
// app.put(
// `/tenant/:tenantId/organization/:organizationId/no-merge`,
// safeWrap(require('./organizationNoMerge').default),
// )

app.put(
`/tenant/:tenantId/organization/:organizationId/no-merge`,
safeWrap(require('./organizationNotMerge').default),
)
}
16 changes: 16 additions & 0 deletions backend/src/api/organization/organizationNotMerge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import OrganizationService from '@/services/organizationService'
import Permissions from '../../security/permissions'
import track from '../../segment/track'
import PermissionChecker from '../../services/user/permissionChecker'

export default async (req, res) => {
new PermissionChecker(req).validateHas(Permissions.values.organizationEdit)
await new OrganizationService(req).addToNoMerge(
req.params.organizationId,
req.body.organizationToNotMerge,
)

track('Ignore merge organizations', {}, { ...req })

await req.responseHandler.success(req, res, { status: 200 })
}
4 changes: 4 additions & 0 deletions backend/src/api/tenant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export default (app) => {
app.get(`/tenant/url`, safeWrap(require('./tenantFind').default))
app.get(`/tenant/:id`, safeWrap(require('./tenantFind').default))
app.get(`/tenant/:tenantId/membersToMerge`, safeWrap(require('./tenantMembersToMerge').default))
app.get(
`/tenant/:tenantId/organizationsToMerge`,
safeWrap(require('./tenantOrganizationsToMerge').default),
)
app.post(`/tenant/:tenantId/sampleData`, safeWrap(require('./tenantGenerateSampleData').default))
app.delete(`/tenant/:tenantId/sampleData`, safeWrap(require('./tenantDeleteSampleData').default))
}
3 changes: 1 addition & 2 deletions backend/src/api/tenant/tenantCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export default async (req, res) => {
{
id: payload.id,
name: payload.name,
integrationsRequired: payload.integrationsRequired.map((i) => i.toLowerCase()),
communitySize: payload.communitySize,
onboard: !!payload.onboard,
},
{ ...req },
)
Expand Down
12 changes: 12 additions & 0 deletions backend/src/api/tenant/tenantOrganizationsToMerge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Error403 from '../../errors/Error403'
import TenantService from '../../services/tenantService'

export default async (req, res) => {
if (!req.currentUser || !req.currentUser.id) {
throw new Error403(req.language)
}

const payload = await new TenantService(req).findOrganizationsToMerge(req.query)

await req.responseHandler.success(req, res, payload)
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (parameters.help || !parameters.tenant || !parameters.limit) {
const limit = parameters.limit

for (const tenantId of tenantIds) {
await BulkorganizationEnrichmentWorker(tenantId, limit, true)
await BulkorganizationEnrichmentWorker(tenantId, limit, true, true)
log.info(`Done for tenant ${tenantId}`)
}

Expand Down
Loading

0 comments on commit f8716fa

Please sign in to comment.