Feat/setup postgress and type orm #11
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant updates to the project, including the migration to TypeORM for database management, enhancements to the development environment configuration, and updates to dependencies and linting configurations. The changes aim to improve scalability, maintainability, and developer experience.
Migration to TypeORM:
src/app.module.ts: Integrated TypeORM with PostgreSQL, configured database connection using environment variables, and addedTodoListentity for synchronization.src/todo_lists/todo_list.entity.ts: CreatedTodoListentity withidandnamecolumns to represent the database schema.src/todo_lists/todo_lists.module.ts: Registered theTodoListentity with TypeORM in theTodoListsModule.src/todo_lists/todo_lists.service.ts: Refactored the service to use TypeORM repository methods for CRUD operations instead of in-memory data structures.src/todo_lists/todo_lists.controller.spec.ts: Updated tests to mock the TypeORM repository for theTodoListentity.Development Environment Enhancements:
.devcontainer/devcontainer.json: Updated the devcontainer configuration to use Docker Compose for container orchestration and added comments for customization options..devcontainer/docker-compose.yml: Added Docker Compose configuration for the development container, enabling persistent volumes and debugging options.docker-compose.yml: Configured services for the application and PostgreSQL database, including environment variables and network settings.Dependency and Configuration Updates:
package.json: Upgraded NestJS and TypeScript-related dependencies to their latest versions and added TypeORM and PostgreSQL packages. Updated the lint script to include autofix functionality.eslint.config.mjs: Introduced a new ESLint configuration file with TypeScript and Prettier integration for improved code quality.Controller and Service Refactor:
src/todo_lists/todo_lists.controller.ts: Updated controller methods to return promises, aligning them with the asynchronous nature of TypeORM operations.These changes collectively enhance the project's database integration, streamline development workflows, and improve the overall codebase quality.