DontStopPrograming / DontStopPrograming/Backend_standard
Create: Implementation of a CRUD REST API with Express.js and MongoDB
- Ngôn ngữ chính
- TypeScript
- Star
- 0
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu bằng cách kiểm tra cấu trúc repository và cấu hình dự án hiện có trước khi lập kế hoạch triển khai. Issue xác định các lớp cần thiết—cấu hình, model, service, controller, route, validation và xử lý lỗi—đồng thời nêu .env, Postman và ThunderClient là các điểm bắt đầu liên quan. Được xem là hoàn thành khi các thao tác CRUD hoạt động cho resource đã chọn, MongoDB sử dụng cơ sở dữ liệu trong .env, và API được ghi tài liệu cũng như kiểm thử chức năng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- express, mongodb, nodejs, typescript
- Lĩnh vực
- api, backend, database
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100