📅  最后修改于: 2023-12-03 14:54:25.269000             🧑  作者: Mango
我的假设是一个以问题和解决方案为基础的创意启发平台。该平台旨在帮助创意者解决创意难题,提供优秀的创意启发,促进创意交流。
$ git clone https://github.com/your-name/your-repo.git
$ cd your-repo
$ npm install
新建一个名为.env
的文件,并添加以下配置信息:
PORT=3000
DATABASE_URL=mongodb://localhost:27017/my-hypothesis
$ npm start
POST /api/users/register
Request Body:
{
"name": "your-name",
"email": "your-email",
"password": "your-password"
}
POST /api/users/login
Request Body:
{
"email": "your-email",
"password": "your-password"
}
返回的响应将包含用户的Token,该Token应在每个请求的Header中发送:
Authorization: Bearer your-token
GET /api/questions
POST /api/questions
Request Body:
{
"title": "问题标题",
"description": "问题描述",
"tags": ["标签1", "标签2"],
"solutions": [
{
"name": "解决方案名称",
"description": "解决方案描述",
"votes": 0
}
]
}
PUT /api/questions/:id
Request Body:
{
"title": "新问题标题",
"description": "新问题描述",
"tags": ["标签1", "标签2"],
"solutions": [
{
"name": "解决方案名称",
"description": "解决方案描述",
"votes": 0
},
{
"name": "新解决方案名称",
"description": "新解决方案描述",
"votes": 0
}
]
}
DELETE /api/questions/:id
PUT /api/questions/:questionId/solutions/:solutionId/vote
GET /api/inspirations
POST /api/inspirations
Request Body:
{
"title": "启发标题",
"description": "启发描述",
"image": "启发图片URL",
"tags": ["标签1", "标签2"]
}
PUT /api/inspirations/:id
Request Body:
{
"title": "新启发标题",
"description": "新启发描述",
"image": "新启发图片URL",
"tags": ["标签1", "标签2"]
}
DELETE /api/inspirations/:id
我的假设是一个可扩展、易维护的开源项目,旨在帮助创意者加速他们的创意过程。通过对问题和解决方案进行建模,以及提供优秀的创意启发,我们相信这个平台可以推动创意的交流和发展。如果你对这个项目感兴趣,请随时参与其中并向我们的代码库贡献代码。