LEARN | CODE | INSPIRE | TEACH
I am Jade Danial
Welcome to Code Hub blog!
A blog dedicated to people with programming passion. Here you will find posts about things I have learned, problems that I have solved in programming and projects that I developed.
Code Hub blog is my own personal wiki of learnings, failures, and successes about programming.
I'm A Nice Guy
Jade Danial is a passionate programmer and creator of Code Hub blog. He is fueled by his passion for learning. He is fascinated by the idea of discovering the world of programming.
Meanwhile, he is developing desktop and web applications using his skills in programming.
Code Hub Blog
A blog dedicated to people with programming passion. Here you will find posts about things I have learned, problems that I have solved in programming and projects that I developed. Code Hub blog is my own personal wiki of leanings, failures, and successes about programming.
An inventory system for small to mid-size businesses to handle sales, purchasing, and inventory management and control. It can help track available stocks, add and purchase from vendors, add and take customers' orders, reorder stocks, add products, and generate reports.
Adding SQLite In Flutter
I add the SQLite database to my mobile app Milk Tea Shop to store the data inside the Cart which the user added. These data include the menu id, menu name, menu image, menu price, and menu quantity.
Adding Screen In Flutter
I add a new screen to my mobile app Milk Tea Shop to display the details of the menu. I use Stream builder to retrieve data from Firebase Firestore and display these data using the Card widget. By adding the Inkwell widget inside the Card the user will able to tap the Card and view the details.
Flutter Setting State
I attempt to change the state of the stateful widget from another class after pressing the button but it didn't work. In my second attempt, I merge two stateful widgets to a single class and change the state on the pressed button and it worked perfectly.
Creating My Flutter App
I start creating my first Flutter mobile app called Milk Tea Shop. This application will allow the user to browse menus for available milk tea, juice drinks, and combo meals. It has a cart that a user can fill and make an order. The order then will be sent to the owner of the milk tea shop.
Debugging My POS Project
Debugging is important to allow earlier detection of an error from the software. My project POS is ready for deployment and to make sure it will run smoothly free of errors, I run it many times and check for some bugs. Fortunately, I identified four bugs and fixed them immediately.
Adding Configuration Script
I add a configuration script in my project POS and name it "config.py". This script will parse the "database.ini" file to read the key-value pair and return the data to connect the database. This script is vital because this will serve as a bridge between the database and the main script.
Creating Database Setup UI
I work more than 3 hours to create a user interface that will set up the database of my project POS. This user interface consists of 4 QLineEdit widgets for the host, name, user, and password. The values of these widgets will be saved in a file "database.ini" for the initialization of the database.
Fetching Data For Charts
A chart is not functional without data. I need to fetch data from the database of my project POS and feed those data to the charts on the dashboard for a user to easily visualize the data. Using some python methods I was able to fetch data from the database and display it to charts in the dashboard.
I add a donut chart in the dashboard of my POS project to visualize the different product categories and their quantity. I use the PyQtChart module and it gives me better and accurate results. PyQtChart is a set of Python bindings for The Qt Company's Qt Charts library.
Creating Graph For Sales Order
I create a graph for the Sales Order that shows the number of sales by month or by year. I use the PyQtGraph module to plot the graph and QWidget as the canvass. It is my first time using this module which I found very useful because it is PyQt5 native and it gives a better drawing performance.
Finishing Report Module
I finish the Report module of my project POS. It consists of 16 reports that a user may choose to generate. These reports can be export as a PDF file or an Excel file so that the user can print. I use HTML tags and QWebpage to display the contents of the report to a single page.
Adding Database To My Project
I add a function to my POS project to check if a database exists. If exists it will direct to a function that will connect to the database and if not it will direct to another function to create the PostgreSQL database. After checking the database it will create tables needed to store data.
Redirect To 'message.html'
I encounter a problem on how to redirect to 'message.html' after a visitor submits feedback from my post. My first approach is to add a URL in action in the form 'Submit' to redirect and it is not successful, then I come up with a solution to add redirect function in views.py.
Using Bootstrap Jumbotron
I use the Bootstrap Jumbotron for page 'message.html' to display a message after a visitor submits feedback from my post. At the bottom of the page, I put a section that will show a maximum of three featured posts that a visitor can read without going back to the previous page.
Revamping My Code Hub Blog
These recent days someone is feeding my blog with spam messages in comments. To solve this problem, I remove the Comment form and change it to the Feedback form and add the 'Approved' field set to False to hide feedbacks and will be visible only after I review it and set it to True.
Adding Custom Domain Name
08 02, 2020 11:17 AM
A customized domain name helps you to establish your blog as a professional brand. It also ensures a blog’s success in multiple areas, search engine rankings, quality traffic, Google Adsense approval, community building and more. Every blog is special, but it needs to be discovered first.
Deploying Code Hub Blog
08 01, 2020 9:26 PM
There are a lot of cloud platforms that provide great services but I chose the Heroku cloud platform because it is easy to use and they offer free and I do not need to add my credit card for payment at the early stage. It is also the cheapest option for a low traffic site like my blog site.
Get In Touch With Me