DontStopPrograming / DontStopPrograming/Backend_standard
Create: Implementation of a CRUD REST API with Express.js and MongoDB
- Langage dominant
- TypeScript
- Étoiles
- 0
- Forks
- 0
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par inspecter la structure du dépôt et la configuration existante du projet avant de planifier l’implémentation. L’issue identifie les couches nécessaires —configuration, modèles, services, contrôleurs, routes, validation et gestion des erreurs— et cite .env, Postman et ThunderClient comme points d’entrée pertinents. Le travail est considéré comme terminé lorsque les opérations CRUD fonctionnent pour la ressource choisie, que MongoDB utilise la base de données de .env et que l’API est documentée et testée fonctionnellement.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- express, mongodb, nodejs, typescript
- Domaine
- api, backend, database
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 25/100