Python REST APIs with Flask, Docker, MongoDB and AWS DevOps.

I mentioned in my last post that I had concerns over compatibilty with different devices for my mobile apps, web-apps and websites and I came across a course that was offered by Udemy called Python REST APIs with Flask, Docker, MongoDB and AWS DevOps. It was the Docker bit that interested me the most. I had been having conversations about Docker and how it allows you to build your project into containers – basically, it holds all of the dependencies that you used to build your project on your machine so that the end user will also have them when they come to access them on their machine when they use your project – no matter how their machine is set up. I have played with Python but wanted to know more and I heard lots of terms bandied about but had no understanding of what they meant or did. Job ads will often ask for knowledge of Flask, MongoDB (I knew that it was a database but little else about it). I had heard of AWS (Amazon Web Services) but didn’t know how to access it but it sounded complicatied – they all sounded complicated (they weren’t!).

I mentioned last time that I had been trying to get my Medical Emergencies/Resuscitation app published on the Play Store – I still haven’t managed it. One of the problems was incompatibility with a testers mobile phone make/model/Android version – I never did get to the bottom of it and since the app would ultimately have only a niche appeal, I decided to go for lower hanging fruit in the first instance – the medical calculations app is officially on the back burner (I called it lots of different things but I am talking about the same app). This led me to consider “web-apps” and containers (Docker in particular).

I started the course, and to my surprise, I found it easier than I had imagined – most things are, so it is always worth giving it a try but this really did surprise me. The course was well laid out in a logical manner. It wasn’t without it’s frustrations but by the end I had created web servers using Python, created Application Programming Interfaces (APIs), created databases for user registration. The projects included and image recognition API, a simple Banking API and a variety of other basic but useful projects that I can expand on. It was a very interesting course that I would recommend to anyone interested in building NoSQL databases, Web applications and creating and interacting with APIs. I now have Docker accounts, an AWS free account for a year – you don’t get long to do things on your server/cloud before it grinds to a halt but that is all part of the learning process.

I completed the course on the 12th November 2023 and I am going to put it to good use in connection with my HTML, CSS and Javascript stuff as well as my Android/Flutter stuff. I might even start to write simple iOS/Swift apps within which I can embed my projects as web apps. I’ll try to keep you posted…

My certificate!

HTML, CSS and Javascript.

You may have read that I develop mobile applications – Android and Flutter mostly but the world of mobile development has changed considerably since I started and I must confess to have been a bit slow to keep up and there always seems to be something else that I need to learn to get me onto the next step – does that sound familiar? I was having a conversation with my son, who is an eminent software developer of some repute, about my progress (or lack of it!) and he said to me that I should be heading in the direction of creating web-apps; many mobile apps were “web-apps”. I was trying to get my Paediatric Medical app to fly and was having difficulty getting through getting it onto the “Play Store” – more about that another time – so I began to look at the merits of his suggestion and how much easier it would be to create a simple Android or Flutter app and then link to a server or cloud space that I maintain and let a web page that had functionality built in utilising Javascript.

I decided to get stuck into the Javascript bit first so picked up a book called “A Smarter Way To Learn Javascript” by Mark Myers – basically, 10 minute chapters followed by Free interactive exercises to make it stick – what’s not to like – experiental learning. The first chapter advised to get a grounding in HTML and CSS first, so I turned HTML, CSS and Javascript in Easy Steps.

It is a bit of a rarity, it would seem – more common are individual books on HTML or CSS or Javascript – mine was a “special edition”. After reading the book and going through the many interesting exercises, I decided to create a simple games app – free at the point of use which could be run as a stand-alone web page or as a mobile app with an Android/iOS or Flutter app with links to my server/cloud presence with the web page hosted on it. Eventually, it would be monetarised with adverts through Google.

My first solo project is Fun Quest:-

This is the start. I am just mapping out how I want it to look at the moment and even that will need a lot of styling. I have started to add some interactivity to it – all of the buttons are clickable although, they don’t do anything but give a speech bubble which I will change for something more useful. The page also adapts depending on whether it is being viewed on a traditional pc or laptop, a tablet or a smaller device such as a mobile phone. The mobile phone view shows the four games as a scroll in a vertical order, one after another.

Starting on this project has lead me to think of other things that could help with compatibility with all devices on the hosting server. More about that in the next post. I’ll see you back here soon, I promise…..

Things that I have repaired.

These are some of the things that I have repaired as part of Illumination Repairs since November 2021.

Shredder

This was the second shredder that I repaired – this one had a bent paper switch – the one that activates the shedder when you put paper in the feed. The first one had a broken switch and I re-wired and replced the switch.

Kettle

The one of the bi-metallic strips needed replacing – I had a spare lying around from a kettle that could not be repair due to a broken and non-replaceable element. This one went to a charity shop – it was an Asda basic range kettle and wasn’t worth much so we gave it away after extending it’s life.

Toaster

This toaster – the metal strips that holds the bread has come off it’s rails – it was given a new lease of life via the charity shop – it made nice toast – well, you have to try these things out (you do actually, more about that later) but wasn’t worth much but someone will have the use of it and it’s one less easily mended electrical in landfill.

Nespresso Coffee Machine.

It wasn’t puncturing the pods. It turned out that it did if you put the pods in at a certain angle. It wasn’t broken as such but perhaps a little worn and worked perfectly if you were careful. It went back to a very grateful client who gave a donation. Nice machine.

A “Flip-over clock” from Habitat

This clock wasn’t flipping over the days of the week due to a broken mechansim post and so the gears were not engaging. I replaced the post with a screw and it went back to it’s owner.

Sit in electric toy car.

After much investigation, it turns out that there is a switch in the charging point socket. When it is charging the circuit goes one way; when it is not charging i.e. when the charging plug is not inserted a switch closes enabling the battery to power the motors, lights, horn, radio and a host of other accessories. The problem was that the switch was stuck – it only needed to free the mechanism of the switch. The parent of the owner was very grateful and I have since heard that her children are getting a lot of use out of it again. We don’t usually repair things this big – it was sat in my sitting room for several weeks. We were sad and also pleased to see it go at the same time!

Morphy Richards Steam Generator Iron.

The steam was working but the iron was not getting hot – I replaced a relay that controlled the current to the iron element once I found the problem – it is always worth investigating – the obvious answer was that the element in the iron was defective but by a series of resistance measurements that was found not to be true and I was able to trace it back to the relay. The owner was very pleased and made a generous donation.

DeLonghi Eletta Coffee Machine

Despite the owners very thorough cleaning regime it turned out that the reason this coffee machine stopped brewing was a blockage in the hot water pipe.

Whenever we complete a repair on anything that uses mains electricity we have to ensure that it is safe and to that end we Portable Appliance Test (PAT) the items and record the results then apply a sticker to show that it has been done and the appliance is safe.

The first part of the test is a visual check of plugs for sound connections, that the cable is secure, that an appropriate value fuse is inserted and that it is in good condition (no tin foil, nails or other bodges), no signs of overheating or cracks and other damage to the plug. The cable is inspected to show that it is in good condition and we check for cracks and other damage on the appliance. We then determine what “Class” of electrical item we are dealing with and set the PAT Tester to check the appliance according to it’s class. Class I tests Earth Conductivity (Bonding) and Insulation resistance. Class II, just Insulation Resistance. We can also do a “cord test” which is generally detachable cables like “kettle leads”. All of the values should be (well) within the values set by the Institution of Engineering and Technology (IET) Code of Practice for “In-Service Inspection and Testing of Electrical Equipment” 5th Edition.

My Seaward Primetest 100 PAT tester

This is my PAT Tester. The smart ones amongst you might be thinking the top figure – Earth Conductivity – is a little high as we would prefer the figure to be <0.1 Ohms (the guidance is <0.2 Ohms usually and in special circumstances <0.5 Ohms) but it was down to the length and conductor cross surface area of the cable.

The last part of the test is that it functions as it should do which is why I enjoyed the toast with the toaster that I repaired as well as coffee from both coffee machines.

I also replaced the screen on a DAB radio, the aerial on another DAB radio and repaired an assortment of other things that I haven’t got photgraphs for…

I decided to create a Flutter based app on the theme of Illumination Repairs… More about that next time….