Closed pastelApe closed 1 week ago
Wow. It looks good. You do great work.
Thanks, Terence
On Nov 13, 2024, at 7:06 PM, xavier watson @.***> wrote:
@pastelApe https://github.com/pastelApe requested your review on: #22 https://github.com/CMSC495-Team1/Team1_TripPlanner/pull/22 Refactor/project structure.
— Reply to this email directly, view it on GitHub https://github.com/CMSC495-Team1/Team1_TripPlanner/pull/22#event-15290839095, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT2J3QZZIY3UWOMCMYMXTNT2APSJVAVCNFSM6AAAAABRXVM4ZCVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJVGI4TAOBTHEYDSNI. You are receiving this because your review was requested.
Thanks! Hopefully I can wrap up the rest today and have this ready for a merge. Also, I didn't add my personal token to .env and the GitHub checks past 🤷♂️ Never used CI/CD before.
Sorry team. I had it ready and then my imports got messed up somehow. Took 5 hrs to fix...
Team,
Spent some time refactoring our project to adopt the flask Blueprint model and app factory design. If we agree I can move forward with finishing up the refactor before rebasing main. Modularizing our code will make adding tests and new features easier. Check out the branch and let me know what you think!
Here is a brief on why the this app structure is beneficial for the team moving forward:
1. Modular Design
The app is organized into distinct modules (
main
,trip
,models
), each with its own responsibilities. This modular design promotes separation of concerns, making the codebase easier to manage, understand, and maintain. Each module can be developed, tested, and debugged independently, which enhances productivity and reduces the risk of introducing bugs.2. Scalability
The modular structure allows the application to scale efficiently. New features or modules can be added without affecting existing functionality. This is particularly important as the project grows and new requirements emerge.
3. Reusability
By organizing code into reusable components, such as models and blueprints, the app encourages code reuse. This reduces duplication and ensures consistency across the application. For example, the
models
module defines database models that can be reused across different parts of the application.4. Maintainability
The clear separation of different parts of the application makes it easier to maintain. Changes in one module are less likely to impact other modules, reducing the complexity of updates and bug fixes. The use of blueprints in Flask helps in organizing routes and views, making the codebase cleaner and more maintainable.
5. Collaboration
The structured organization of the app facilitates collaboration among team members. Each developer can work on different modules simultaneously without interfering with each other's work. This parallel development approach speeds up the development process and improves team efficiency.
6. Configuration Management
The use of configuration files like
config.py
andsetup.sh
helps in managing project dependencies and environment-specific settings. This ensures that the development, testing, and production environments are consistent, reducing the likelihood of environment-related issues.7. Best Practices
The app structure follows best practices for Flask applications, such as using blueprints for modularity, defining models in a separate
models.py
file, and initializing extensions in the__init__.py
file. Adhering to these best practices ensures that the application is built on a solid foundation and is easier to extend and maintain.Xavier