DontStopPrograming / DontStopPrograming/Backend_standard

Create: Implementation of a CRUD REST API with Express.js and MongoDB

未关闭
#3 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

Implement a REST API that allows performing CRUD (Create, Read, Update, Delete) operations on a specific resource using Express.js, MongoDB, and Mongoose. The implementation should follow principles of separation if concerns, Clean Architecture, and best practices in managing routes, controllers, services, and models.

Task to complete:

1.Develop the project structure:

- Set up a Node.js project with TypeScript
- Organize the folder and file structure to reflect the separation of concerns

2.Configure MongoDB connection:

- Create a configuration file for connecting to MongoDB using Mongoose.
- Ensure the connection correctly uses the database specified in the .env file

3.Define the resource model and interface:

- Create the resource interface(e.g. Vehicle) that reflects the required properties.
- Implemente the Mongoose Schema and Model based on the interface

4.Implement CRUD services:

- Develop service functions to handle CRUD operations for the resource
- Ensure that service functions are decoupled from the controllers

5.Create controllers and routes:

- Implement controllers that manage HTTP request for CRUD operations
- Define and set up the corresponding REST routes in Express.js

6.Add validations and error handling:

- Implement data validations in the controllers or models
- Create an error-handling middleware to capture and manage exceptions in the API

7.Document the API:

- Provice clear and concise documentation

8.Perform functional testing:

- Use tools like Postman, ThunderClient to test and validate CRUD operations
- Ensure that data is correctly stored, update and deleted in MongoDB

Criteria:

- The API should allow performing all CRUD operations on the defined resource.
- The database connection should be stable and use the database specified in the .env file
- The project structure should follow Clean Architecture principles and coding best practices

贡献指南

这个仓库没有索引到贡献指南

调研方向

在规划实现之前,先检查仓库结构和现有项目配置。Issue 确定了所需的层——配置、模型、服务、控制器、路由、验证和错误处理——并将 .env、Postman 和 ThunderClient 列为相关入口。完成的标准是:所选资源的 CRUD 操作能够正常工作,MongoDB 使用 .env 中的数据库,并且 API 已完成文档编写和功能测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
express, mongodb, nodejs, typescript
领域
api, backend, database
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。