How adhithya7/is601-007 works
Project Type and Purpose
• The projects are full-stack web applications built in Python with Flask. They include common web application components such as templates for the frontend, views/routes for HTTP endpoints, business logic, and database interaction via SQL scripts.
• The “Project” folder – likely the “Shop Project” – includes modules for authentication (auth), role management (roles), common utility functions, and SQL setups. It contains a clear separation of concerns that suggests an MVC-like pattern (views and templates in different folders, with business logic in auth, roles, and common).
• The “BusinessManagement” project also follows a similar structure with routes (under views), templates for the UI, and database interaction scripts.
File Structure for Architectural Clues
• Top-Level Directories and Files:
• .github: Contains workflow definitions (especially for Heroku deploys), indicating continuous deployment integration.
• BusinessManagement: Contains its own Dockerfile, main.py, templates for various pages (company/employee management), SQL folder for database scripts, and a dedicated test folder.
• Project: Holds a Dockerfile, main.py, separate modules for auth and roles (each with models, forms, templates), common utilities, SQL scripts for setting up tables, and test directories.
• Additional directories (flask_sample, M2, MP1_ICM, etc.) seem to be supplementary exercises or demonstration samples.
• Architectural Choices:
• There is a defined separation between modules that handle user-interface rendering (“templates”), the application logic (inside the “views”, “auth”, “roles”, “common”), and database operations (SQL scripts and db/init_db.py files).
• Use of Docker (presence of Dockerfile) and CI/CD configuration (GitHub workflows) indicate a modern deployment pipeline.
a. For the “Shop Project” (Project directory):
• Web Layer (Frontend):
– Templates (found in Project/templates, Project/auth/templates, Project/roles/templates): These render the HTML pages such as login, registration, landing page, item views, cart, order, payment, etc.
• Application Layer (Backend):
– Main entry point (Project/main.py) which initializes the app.
– Authentication Module (Project/auth): Contains auth.py, forms.py, models.py for user management.
– Role Management Module (Project/roles): Manages user roles, permissions, and provides templates for role assignment.
– Common Utilities (Project/common): Provides helper functions used across modules.
– Views (Project/views): Handles additional endpoints like admin panels, items, and static pages.
• Data Layer:
– SQL Scripts (Project/sql): Contains versioned SQL scripts to create and initialize tables (users, roles, items, orders, etc.), along with database access and initialization code (db.py and init_db.py).
• Data flow:
• Docker container (using the provided Dockerfile) that encapsulates the application.
b. For the “BusinessManagement” Project:
• Frontend with templates (add/edit company and employee views, etc.).
• Backend with views modules (company.py, employee.py, admin.py, forms.py, geography.py, index.py).
• Data Layer containing SQL scripts for company and employee tables, along with CSV data handling.
• Testing components (the test directory, containing tests for add, edit, upload, and search operations).
• Simplicity of design but note that the separation of concerns is analogous to the shop project.
c. For the “flask_sample” (and other smaller scripts):
• These can be represented as “Example/Supporting Projects” that follow similar Flask conventions. Their role may be to illustrate base patterns without full business logic.