Skip to content

Let's use AI to Earn!

feat: contributing (#371)

nevin789ff92b5e7f
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e40fdf2f..3981cd1e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,21 +1,61 @@
-# Contribution Guide
+# CONTRIBUTING
-Thank you for your interest in the AiToEarn project! We welcome all forms of contributions, including but not limited to bug reports, feature requests, code improvements, and documentation enhancements.
+So you're looking to contribute to AiToEarn - that's awesome! We can't wait to see what you do. We have grand ambitions to build the best platform for AI-driven earning. Any help from the community counts, truly.
-## Table of Contents
+We need to be nimble and ship fast, but we also want to make sure that contributors like you get as smooth an experience as possible. We've assembled this contribution guide for that purpose, aiming at getting you familiarized with the codebase & how we work with contributors, so you could quickly jump to the fun part.
-- [Contribution Guide](#contribution-guide)
- - [Table of Contents](#table-of-contents)
- - [Code of Conduct](#code-of-conduct)
- - [Development Environment Setup](#development-environment-setup)
- - [Submitting Pull Requests](#submitting-pull-requests)
- - [Reporting Bugs](#reporting-bugs)
- - [Suggesting New Features](#suggesting-new-features)
- - [Code Review](#code-review)
+This guide is a constant work in progress. We highly appreciate your understanding if at times it lags behind the actual project, and welcome any feedback for us to improve.
-## Code of Conduct
+## Before you jump in
-Please follow our code of conduct to ensure all participants can communicate in an open and friendly environment.
+Looking for something to tackle? Browse our [issues](https://github.com/AiToEarn/AiToEarn/issues) and pick one to get started!
+
+### Good first issue
+
+Issues with titles containing **【good frist】** are issues we provide for new contributors. If you want to join our team, please submit a PR linked to such an issue.
+
+Join us, contribute code, and let's build something awesome together! 💡✨
+
+Don't forget to link an existing issue in the PR's description.
+
+### Bug reports
+
+> [!IMPORTANT]
+> Please make sure to include the following information when submitting a bug report:
+
+- A clear and descriptive title
+- A detailed description of the bug, including any error messages
+- Steps to reproduce the bug
+- Expected behavior
+- **Logs**, if available (really important for backend issues)
+- Screenshots or videos, if applicable
+
+How we prioritize:
+
+| Issue Type | Priority |
+| ------------------------------------------------------------ | --------------- |
+| Bugs in core functions (cannot login, applications not working, security loopholes) | Critical |
+| Non-critical bugs, performance boosts | Medium Priority |
+| Minor fixes (typos, confusing but working UI) | Low Priority |
+
+### Feature requests
+
+> [!NOTE]
+> Please make sure to include the following information when submitting a feature request:
+
+- A clear and descriptive title
+- A detailed description of the feature
+- A use case for the feature
+- Any other context or screenshots about the feature request
+
+How we prioritize:
+
+| Feature Type | Priority |
+| ------------------------------------------------------------ | --------------- |
+| High-Priority Features as being labeled by a team member | High Priority |
+| Popular feature requests from our community | Medium Priority |
+| Non-core features and minor enhancements | Low Priority |
+| Valuable but not immediate | Future-Feature |
## Development Environment Setup
@@ -26,7 +66,7 @@ Please follow our code of conduct to ensure all participants can communicate in
```
3. Commit your changes:
```bash
- git add .
+ git add .
git commit -m "feat: add new feature"
```
4. Push to your forked repository:
@@ -35,23 +75,28 @@ Please follow our code of conduct to ensure all participants can communicate in
```
5. Create a Pull Request on GitHub
-## Reporting Bugs
-1. Ensure the bug has not been reported in other issues
-2. Create a new issue and include the following information:
- - Title describing the bug
- - Detailed description of the bug
- - Steps to reproduce the bug
- - Screenshots (if available)
- - Other information (such as error logs, stack traces, etc.)
-## Suggesting New Features
-1. Ensure the feature has not been requested in other issues
-2. Create a new issue and include the following information:
- - Title describing the new feature
- - Detailed description of the new feature
- - Screenshots (if available)
-## Code Review
-1. Create a pull request
-2. Wait for other contributors to review the code
-3. Modify the code and commit the new changes
-4. Push the new commits to your forked repository
-5. Ensure the pull request is merged into the main repository
+## Submitting your PR
+
+### Pull Request Process
+
+1. Fork the repository
+2. Before you draft a PR, please create an issue to discuss the changes you want to make
+3. Create a new branch for your changes
+4. Please add tests for your changes accordingly
+5. Ensure your code passes the existing tests
+6. Please link the issue in the PR description, `fixes #<issue_number>`
+7. Get merged!
+
+### Setup the project
+
+#### Backend
+
+For setting up the backend service, kindly refer to our detailed instructions in [project/backend/DEVELOPER_GUIDE.md](./project/backend/DEVELOPER_GUIDE.md). This document contains step-by-step guidance to help you get the backend up and running smoothly.
+
+#### Other things to note
+
+We recommend reviewing these documents carefully before proceeding with the setup.
+
+## Getting Help
+
+If you ever get stuck or get a burning question while contributing, simply shoot your queries our way via the related GitHub issue.
diff --git a/CONTRIBUTING_CN.md b/CONTRIBUTING_CN.md
new file mode 100644
index 00000000..dc629801
--- /dev/null
+++ b/CONTRIBUTING_CN.md
@@ -0,0 +1,102 @@
+# 贡献指南
+
+很高兴你有兴趣为 AiToEarn 做出贡献——这太棒了!我们迫不及待想看到你的成果。我们致力于构建最佳的 AI 赚钱平台。来自社区的任何帮助都非常宝贵。
+
+我们需要快速迭代,但也希望确保像你一样的贡献者能获得尽可能顺畅的体验。我们编写这份贡献指南正是为了这个目的,旨在让你熟悉代码库以及我们与贡献者的合作方式,以便你可以快速进入正题。
+
+本指南是一个持续完善的过程。如果有时它滞后于实际项目,我们非常感谢你的理解,并欢迎提出任何改进反馈。
+
+## 在开始之前
+
+正在寻找可以解决的问题?浏览我们的 [issues](https://github.com/AiToEarn/AiToEarn/issues) 并挑选一个开始吧!
+
+### 友好的第一次开始
+
+标题包含 **【good frist】** 的 issues,是我们为新的贡献者提供的issues。如果想加入我们的团队,请提交关联该 issues 的 PR。
+
+加入我们,通过贡献代码,让我们一起构建一些很棒的东西!💡✨
+
+别忘了在 PR 描述中链接现有的 issue
+
+### 错误报告 (Bug Reports)
+
+> [!IMPORTANT]
+> 提交错误报告时,请务必包含以下信息:
+
+- 清晰且描述性的标题
+- 错误的详细描述,包括任何错误消息
+- 复现错误的步骤
+- 预期行为
+- **日志**(如果有),对于后端问题,这非常重要
+- 截图或视频(如果适用)
+
+我们的优先级排序方式:
+
+| 问题类型 | 优先级 |
+| ------------------------------------------------------------ | --------------- |
+| 核心功能错误(无法登录、应用无法工作、安全漏洞) | 严重 (Critical) |
+| 非严重错误、性能提升 | 中等优先级 (Medium Priority) |
+| 小修补(拼写错误、UI 令人困惑但可工作) | 低优先级 (Low Priority) |
+
+### 功能请求 (Feature Requests)
+
+> [!NOTE]
+> 提交功能请求时,请务必包含以下信息:
+
+- 清晰且描述性的标题
+- 功能的详细描述
+- 功能的使用场景
+- 关于功能请求的任何其他背景信息或截图
+
+我们的优先级排序方式:
+
+| 功能类型 | 优先级 |
+| ------------------------------------------------------------ | --------------- |
+| 团队成员标记为高优先级的功能 | 高优先级 (High Priority) |
+| 社区反馈中受欢迎的功能请求 | 中等优先级 (Medium Priority) |
+| 非核心功能和小幅增强 | 低优先级 (Low Priority) |
+| 有价值但不紧急 | 未来特性 (Future-Feature) |
+
+## 开发环境设置
+
+1. Fork 项目到你的 GitHub 账号
+2. 创建特性分支:
+ ```bash
+ git checkout -b feature/your-feature-name
+ ```
+3. 提交你的更改:
+ ```bash
+ git add .
+ git commit -m "feat: add new feature"
+ ```
+4. 推送到你的 Fork 仓库:
+ ```bash
+ git push origin feature/your-feature-name
+ ```
+5. 在 GitHub 上创建 Pull Request
+
+## 提交你的 PR
+
+### Pull Request 流程
+
+1. Fork 本仓库
+2. 在起草 PR 之前,请创建一个 issue 来讨论你想要进行的更改
+3. 为你的更改创建一个新分支
+4. 请相应地为你的更改添加测试
+5. 确保你的代码通过现有的测试
+6. 请在 PR 描述中链接该 issue,例如 `fixes #<issue_number>`
+7. 等待合并!
+
+### 项目设置
+
+#### 后端
+
+关于设置后端服务,请参考 [project/backend/README.md](./project/backend/README.md) 中的详细说明。该文档包含逐步指导,帮助你顺利运行后端。
+
+#### 其他注意事项
+
+我们建议在继续设置之前仔细阅读这些文档。
+
+## 获取帮助
+
+如果你在贡献过程中遇到困难或有紧急问题,只需通过相关的 GitHub issue 向我们提问即可。
diff --git a/project/backend/apps/aitoearn-channel/src/core/platforms/bilibili/bilibili.controller.ts b/project/backend/apps/aitoearn-channel/src/core/platforms/bilibili/bilibili.controller.ts
index 175eacaa..98f36493 100644
--- a/project/backend/apps/aitoearn-channel/src/core/platforms/bilibili/bilibili.controller.ts
+++ b/project/backend/apps/aitoearn-channel/src/core/platforms/bilibili/bilibili.controller.ts
@@ -25,8 +25,6 @@ export class BilibiliController {
return this.bilibiliService.getBilibiliConfig()
}
- // 创建授权任务
- // @NatsMessagePattern('plat.bilibili.auth')
@ApiDoc({
summary: 'Create Authorization Task',
body: GetAuthUrlDto.schema,
@@ -41,8 +39,6 @@ export class BilibiliController {
return res
}
- // 查询认证信息
- // @NatsMessagePattern('plat.bilibili.getAuthInfo')
@ApiDoc({
summary: 'Get Authorization Task Info',
body: GetAuthInfoDto.schema,
@@ -53,8 +49,6 @@ export class BilibiliController {
return res
}
- // 查询账号的认证信息
- // @NatsMessagePattern('plat.bilibili.getAccountAuthInfo')
@ApiDoc({
summary: 'Get Account Authorization Info',
body: AccountIdDto.schema,
@@ -65,8 +59,6 @@ export class BilibiliController {
return res
}
- // 获取鉴权头
- // @NatsMessagePattern('plat.bilibili.getHeader')
@ApiDoc({
summary: 'Generate Authorization Header',
body: GetHeaderDto.schema,
@@ -80,8 +72,6 @@ export class BilibiliController {
return res
}
- // 创建账号并设置授权Token
- // @NatsMessagePattern('plat.bilibili.createAccountAndSetAccessToken')
@ApiDoc({
summary: 'Create Account and Set Access Token',
body: CreateAccountAndSetAccessTokenDto.schema,
@@ -100,8 +90,6 @@ export class BilibiliController {
return res
}
- // 查询账号已授权权限列表
- // @NatsMessagePattern('bilibili.account.scopes')
@ApiDoc({
summary: 'Get Authorized Scopes',
body: AccountIdDto.schema,
@@ -112,8 +100,6 @@ export class BilibiliController {
return res
}
- // 获取分区列表
- // @NatsMessagePattern('plat.bilibili.archiveTypeList')
@ApiDoc({
summary: 'List Archive Categories',
body: AccountIdDto.schema,
@@ -123,7 +109,6 @@ export class BilibiliController {
return await this.bilibiliService.archiveTypeList(data.accountId)
}
- // @NatsMessagePattern('plat.bilibili.archiveList')
@ApiDoc({
summary: 'Get Archive List',
body: ArchiveListDto.schema,
@@ -137,7 +122,6 @@ export class BilibiliController {
})
}
- // @NatsMessagePattern('plat.bilibili.userStat')
@ApiDoc({
summary: 'Get User Statistics',
body: AccountIdDto.schema,
@@ -147,7 +131,6 @@ export class BilibiliController {
return await this.bilibiliService.getUserStat(data.accountId)
}
- // @NatsMessagePattern('plat.bilibili.arcStat')
@ApiDoc({
summary: 'Get Archive Statistics',
body: GetArcStatDto.schema,
@@ -160,7 +143,6 @@ export class BilibiliController {
)
}
- // @NatsMessagePattern('plat.bilibili.arcIncStat')
@ApiDoc({
summary: 'Get Archive Increment Stats',
body: AccountIdDto.schema,
@@ -170,7 +152,6 @@ export class BilibiliController {
return await this.bilibiliService.getArcIncStat(data.accountId)
}
- // @NatsMessagePattern('plat.bilibili.accessTokenStatus')
@ApiDoc({
summary: 'Get Access Token Status',
body: AccountIdDto.schema,
diff --git a/project/backend/apps/aitoearn-server/src/channel/publish.controller.ts b/project/backend/apps/aitoearn-server/src/channel/publish.controller.ts
index b775a31e..6510d943 100644
--- a/project/backend/apps/aitoearn-server/src/channel/publish.controller.ts
+++ b/project/backend/apps/aitoearn-server/src/channel/publish.controller.ts
@@ -10,8 +10,9 @@ import { ApiTags } from '@nestjs/swagger'
import { GetToken, TokenInfo } from '@yikart/aitoearn-auth'
import { ApiDoc, TableDto } from '@yikart/common'
import { plainToInstance } from 'class-transformer'
+import { PublishRecordService } from '../publishRecord/publishRecord.service'
import { PlatPublishNatsApi } from '../transports/channel/api/publish.natsApi'
-import { PostHistoryItemVo, PublishRecordItemVo } from './dto/publish-response.vo'
+import { PostHistoryItemVo } from './dto/publish-response.vo'
import {
CreatePublishDto,
CreatePublishRecordDto,
@@ -28,6 +29,8 @@ export class PublishController {
constructor(
private readonly publishService: PublishService,
private readonly platPublishNatsApi: PlatPublishNatsApi,
+ private readonly publishRecordService: PublishRecordService,
+
) {}
@ApiDoc({
@@ -53,19 +56,6 @@ export class PublishController {
})
}
- @ApiDoc({
- summary: 'Get Publish Records',
- body: PubRecordListFilterDto.schema,
- response: [PublishRecordItemVo],
- })
- @Post('getList')
- async getList(
- @GetToken() token: TokenInfo,
- @Body() data: PubRecordListFilterDto,
- ) {
- return this.publishService.getList(data, token.id)
- }
-
@ApiDoc({
summary: 'Get Platform Post Records',
body: PubRecordListFilterDto.schema,
@@ -126,10 +116,13 @@ export class PublishController {
})
@Delete('delete/:id')
async delete(@GetToken() token: TokenInfo, @Param('id') id: string) {
- return this.platPublishNatsApi.deletePublishRecord({
+ const res = await this.platPublishNatsApi.deletePublishRecord({
userId: token.id,
id,
})
+
+ this.publishRecordService.deletePublishRecordById(id)
+ return res
}
@ApiDoc({
diff --git a/project/backend/apps/aitoearn-server/src/channel/publish.service.ts b/project/backend/apps/aitoearn-server/src/channel/publish.service.ts
index d8ca7d4a..00380922 100644
--- a/project/backend/apps/aitoearn-server/src/channel/publish.service.ts
+++ b/project/backend/apps/aitoearn-server/src/channel/publish.service.ts
@@ -7,7 +7,6 @@ import { PublishRecordService } from '../publishRecord/publishRecord.service'
import { PostService } from '../statistics/post/post.service'
import { PlatPublishNatsApi } from '../transports/channel/api/publish.natsApi'
import { PublishTaskNatsApi } from '../transports/channel/api/publishTask.natsApi'
-import { ChannelApi } from '../transports/channel/channel.api'
import { PublishingChannel } from '../transports/channel/common'
import { NewPublishData, NewPublishRecordData, PlatOptions } from './common'
import { PostHistoryItemVoSchema } from './dto/publish-response.vo'
@@ -23,7 +22,6 @@ export class PublishService {
private readonly publishRecordService: PublishRecordService,
private readonly postService: PostService,
private readonly platPublishNatsApi: PlatPublishNatsApi,
- private readonly channelApi: ChannelApi,
) { }
async create(newData: NewPublishData<PlatOptions>) {
@@ -41,15 +39,6 @@ export class PublishService {
return res
}
- async getList(data: PubRecordListFilterDto, userId: string) {
- const list1 = await this.publishRecordService.getPublishRecordList({
- ...data,
- userId,
- })
- const list2 = await this.publishTaskNatsApi.getPublishTaskList(userId, data)
- return [...list1, ...list2]
- }
-
private mergePostHistory(publishRecords: PublishRecord[], publishTasks: any[], postsHistory: PostData[]) {
const result = new Map<string, PostHistoryItem>()
@@ -200,7 +189,7 @@ export class PublishService {
...data,
range,
userId,
- platform: data.accountType as any,
+ platform: data.accountType,
})
const posts = this.mergePostHistory(publishRecords, publishTasks, postsHistory.posts)
if (data.publishingChannel) {
diff --git a/project/web/README.md b/project/web/README.md
index 59e6b554..f9d71382 100644
--- a/project/web/README.md
+++ b/project/web/README.md
@@ -7,7 +7,3 @@ https://aitoearn.ai
## Test api fox
https://app.apifox.com/project/6987843
-
-
-
-