Closed Ren22 closed 1 month ago
[!CAUTION]
Review failed
The pull request is closed.
The changes introduce a significant transition from a PostgreSQL-based architecture to a MongoDB sharded cluster setup. Key updates include the addition of new environment variables for MongoDB configuration, restructuring of API routes, and the introduction of new models and schemas for handling posts and comments. The removal of obsolete files related to user data and movie ratings reflects a streamlined focus on the new data handling approach. Additionally, Docker configurations have been updated to support the new MongoDB services, enhancing the overall application architecture.
Files | Change Summary |
---|---|
.env.example |
Added new environment variables: BIGDATA_CONFIG__MONGO__MONGODB_DB_NAME and BIGDATA_CONFIG__MONGO__MONGODB_URI . |
README.md |
Removed lines related to sprint tasks and replaced with a link to "UGC Sprint 2." |
bigdata_service/requirements.txt |
Added dependencies: fastapi-pagination , beanie , and python-slugify . |
bigdata_service/src/api/__init__.py |
Restructured API router setup; added setup_routers function and renamed routers for better organization. |
bigdata_service/src/api/v1/__init__.py |
Renamed router to v1_router and added posts_router and comments_router . |
bigdata_service/src/api/v1/comments.py |
Introduced a new router for comments with endpoints for adding and retrieving comments. |
bigdata_service/src/api/v1/movies.py |
Updated import path for User model. |
bigdata_service/src/api/v1/posts.py |
Introduced a new router for managing posts with multiple endpoints for CRUD operations and analytics. |
bigdata_service/src/core/config.py |
Added MongoConfig class for MongoDB configuration settings in the Settings class. |
bigdata_service/src/core/pagination.py |
Introduced custom pagination parameters and a new PaginatedPage type alias. |
bigdata_service/src/db/init_db.py |
Added init function for initializing the Beanie ODM with MongoDB. |
bigdata_service/src/db/mongo.py |
Introduced mongo_client variable and get_mongo_client function for managing MongoDB client connections. |
bigdata_service/src/main.py |
Refactored application structure; added create_app function and modified lifespan function for MongoDB client initialization. |
bigdata_service/src/models/__init__.py |
Added gather_documents function for collecting document classes. |
bigdata_service/src/models/auth.py |
Changed User class to inherit from BaseModel instead of BaseOrjsonModel . |
bigdata_service/src/models/comment.py |
Introduced Comment class with attributes and methods for comment management. |
bigdata_service/src/models/post.py |
Introduced Post class with attributes and methods for post management. |
docker-compose.override.yml |
Removed bigdata_db service. |
docker-compose.yml |
Introduced MongoDB sharded cluster configuration; removed bigdata_db and added multiple MongoDB services. |
mongo_config/*.js |
Introduced scripts for managing MongoDB replica sets and sharded cluster setup. |
sequenceDiagram
participant User
participant API
participant MongoDB
User->>API: Create Post
API->>MongoDB: Insert Post Data
MongoDB-->>API: Confirmation
API-->>User: Post Created
sequenceDiagram
participant User
participant API
participant MongoDB
User->>API: Add Comment
API->>MongoDB: Insert Comment Data
MongoDB-->>API: Confirmation
API-->>User: Comment Added
🐰 In the garden of code, changes bloom bright,
MongoDB's sharded cluster takes flight.
Posts and comments dance in new ways,
With routers and models, they sing praise.
Hooray for the updates, let’s hop and cheer,
For a future of data that’s crystal clear! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Rebases https://github.com/Yandex-34-mpython-12/UGC_sprint_2/pull/7 onto main
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores