Skip to content

DevOps monolithic application for celiac people to interact in a community where people can share gluten-free, vegan and sugar-free recipees, healthy lifestyle tips and their stories.

Notifications You must be signed in to change notification settings

rgulza01/Project

Repository files navigation

DevOps project for QA - GF FLASK

by: Radia Gulzan

A monolithic web application to help celiac people form a community where they can share gluten free recipes and stories about their gluten free life. Main technologies utilised include: Azure database, Azure virtual machine, Jenkins, Docker, Docker-compose, Docker-Swarm and NGINX.

Use cases:

In the following section I present the use case diagram based on the initial requirements identified. The diagram has been used to get a bird's eye view of GF FLASK and provide a visualisation of the external and internal factors influencing the system, in addition to requirement gathering purposes of successive iterations and optimisations of GF FLASK, following A/B testing. image

image

image

image

image

image

image

image

image

image

image

Application video

Below is the video describing the application. It's a 7 minutes video that starts with the app as it was in feature-2 but ends by introducing components of feature-3. It also includes mention about how the application has been deployed on the Jenkins pipeline and on Docker Swarm: https://drive.google.com/drive/folders/1gDfpDnDfW4baTHSugsVtHZDcIRwRToIk I have included a document with the console output from Jenkins. Docker images can be checked on hub: image

User stories

I have worked in various iterations to implement product features, based on their values, for a better understanding of why users might want a certain functionality.

image

Project Management

Ongoing for feature-3. image

Risk management

In the risk assessment table I first identify risks and consider whether they are event driven, evolving, technical or non-technical, on top of examining the risk triggers in advance. In the second column I assess the impacts of the risks following the equation:

  • Risk impact = risk likelihood x risk consequences

image

With the given numbers I derive a relative measure to be able to then rank the risks to focus on the ‘critical’ ones first, following RAG grading. The third column is a list of possible approaches to the risks: either by avoidance, by deflection (or transfer) or by contingency.

image

Technology Readiness Levels (TRL)

Software projects are challenging due to the complexity of the product, nonlinear scaling of resources, measurement of project and product, initial uncertainty in project and product scope, and knowledge gained as a project evolves. Technology Readiness Levels (TRL) are a type of measurement system used to assess the maturity level of a particular technology. By the completion of the project, GF FLASK is at TRL 4, see table below: image

ORM relationship: many-to-many

User will be used as reader as well. Therefore a post can have many readers and a user can post/read many posts. image

Refactoring

The code has been refactored in several occasions. Below are some of the examples:

- Refactoring the layout of the html template

  • from

image

  • to

image

- Refactoring database relationship from one-to-one to many-to-many

  • from this view till feature-2

image

* to this in feature-3

image

- Refactoring database relationship many-to-many

I had suddently started getting the warning: create.py:13: SAWarning: relationship 'Post.users' will copy column user.id to column user_post.user_id, which conflicts with relationship(s): 'Post.user' (copies user.id to user_post.user_id), 'User.posts' (copies user.id to user_post.user_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards. To silence this warning, add the parameter 'overlaps="posts,user"' to the 'Post.users' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx).

So I refactored the code from:

image

to:

image

- Refactoring nginx for the container that was not running despite the SUCCESS shown in the Jenkins pipeline

image

- Refactoring tests for higher unit testing coverage

  • from

image

  • to

image

- Refactoring Jenkins Pipeline from docker compose to adding docker swarm

  • from having the docker compose stage

image

  • to making a single step for swarm

image

The pipeline therefore ensures that the application setup is done including the configurations and necessariry installations from requirements.txt . The final step is to build the docker-compose, push the image on dockerhub and deploy the docker stack. The video includes more discussion and demonstration of the pipeline, among other things.

- Refactoring Dockerfile, docker-compose and Jenkinsfile after adding Jenkins credentials for implementing an Azure database

image

image

image

- Refactoring dashabord with search bar working and by adding the functionality to view the posts by each user

  • in feature-2

image

  • in feature-3

image

image

- Refactoring for hashing password, added now during registration, to ease the login functionality:

image

image

Acknowledgements

I would like to express my most sincere appreciation to Earl Gray - DevOps specialisation trainer - for pushing the boundaries of my capabilities, positively contributing to the project's growth since the idea's inception.

I would also like to mention that the beautiful teal coloured html templates have been adopted from Gurupreeth Singh.

I had the fortune of learning how to use opensource technologies such as Bootstrap to complete the rest of the application and creating UI templates with Flask-WTF by following lessons from Earl and from John from Codecademy.com

I would finally like to point out that the reddit flask community r/flask is a great platform to intereact with other Flask developers.

About

DevOps monolithic application for celiac people to interact in a community where people can share gluten-free, vegan and sugar-free recipees, healthy lifestyle tips and their stories.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published