Skip to content

ndm621/Web-App-DevOps-Project

 
 

Repository files navigation

Web-App-DevOps-Project

Welcome to the Web App DevOps Project repo! This application allows you to efficiently manage and track orders for a potential business. It provides an intuitive user interface for viewing existing orders and adding new ones.

Table of Contents

Features

  • Order List: View a comprehensive list of orders including details like date UUID, user ID, card number, store code, product code, product quantity, order date, and shipping date.

Screenshot 2023-08-31 at 15 48 48

  • Pagination: Easily navigate through multiple pages of orders using the built-in pagination feature.

Screenshot 2023-08-31 at 15 49 08

  • Add New Order: Fill out a user-friendly form to add new orders to the system with necessary information.

Screenshot 2023-08-31 at 15 49 26

  • Data Validation: Ensure data accuracy and completeness with required fields, date restrictions, and card number validation.

Getting Started

Prerequisites

For the application to succesfully run, you need to install the following packages:

  • flask (version 2.2.2)
  • pyodbc (version 4.0.39)
  • SQLAlchemy (version 2.0.21)
  • werkzeug (version 2.2.3)
  • azure-identity
  • azure-keyvault-secrets

Usage

To run the application, you simply need to run the app.py script in this repository. Once the application starts you should be able to access it locally at http://127.0.0.1:5000. Here you will be meet with the following two pages:

  1. Order List Page: Navigate to the "Order List" page to view all existing orders. Use the pagination controls to navigate between pages.

  2. Add New Order Page: Click on the "Add New Order" tab to access the order form. Complete all required fields and ensure that your entries meet the specified criteria.

Technology Stack

  • Backend: Flask is used to build the backend of the application, handling routing, data processing, and interactions with the database.

  • Frontend: The user interface is designed using HTML, CSS, and JavaScript to ensure a smooth and intuitive user experience.

  • Database: The application employs an Azure SQL Database as its database system to store order-related data.

Developer Information

  • Future Modifications: Any new feature to be added in future will need to modify code in both the app.py and orders.html files. For example, Delivery Date feature can be added by by modifying the order class, @app_route and new_order sections in the app.py. Also Delivery Date will need to be added to the order.html in the table and form elements.

  • Containerization Process: Containerization involves:

  1. Creating a Docker File where base image, work directory, required libraries and dependencies and necessary commands are listed
  2. Building Docker Image using the Docker File docker build -t
  3. Run the Docker Image to test all the features docker run -p 5000:5000
  4. Tag and Push the image to the Docker Hub docker tag docker-user-name>/:tag
  5. Verify the Docker Hub Image by pulling it from the hub
  6. Cleanup
  • Romove Containers

  • docker ps -a

  • docker rm

  • Remove Images

  • docker images -a

  • docker rmi

  • Infrastructure as Code IaC: The folder aka-terraform has all the necessary files to provision the resources on the Kubernetes and then to AKS. These details include the following:

  • Terraform Modules

  • Cluster Module

  • Networking Modules

  • Input and Output Variables

Contributors

  • Maya Iuga
  • Muhammad Nadeem Khan

License

This project is licensed under the MIT License. For more details, refer to the LICENSE file.

About

This repo contains the code for a Python Flask Web App that can be used to build a DevOps pipeline where you containerise, deploy and manage a web app.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • HCL 35.1%
  • Python 18.6%
  • HTML 17.3%
  • CSS 14.2%
  • JavaScript 9.3%
  • Dockerfile 5.5%