Posts

Building web app using Firebase - Part 2 (Create API and Read Write DB)

Image
Our First Web App Using Firebase Continuing from the previous post, which is only just one time only setup, let's further advance on doing the codes. After the Realtime database is ready and you have created a document, we need to develop the code. Just create a typical Node-js project as described below: Write our first Firebase function After you created the document you followed from the previous post, you already have the read and write API to your document. For example, you will be able to read your "user_detail" document using HTTP GET Request to "https://[PROJECT_ID].firebaseio.com/user_detail.json" . More on using Rest API can be read here https://firebase.google.com/docs/reference/rest/database . Although Firebase RealtimeDB has its Rest API implementations, sometimes, When we need some underlying logic for our app, we need to create an API. But here's just an example of how to create a simple API using firebase functions. 1. On your project, initia

Building web app using Firebase - Part 1 (Create Firebase Project)

Image
Google Firebase In the following example, We will develop the most efficient way to build a website. Unfortunately, people tend to over-engineer a website by using more and more tech stacks; yes, it will boost productivity later, but sure, the learning curve if you are not familiar with the stack; it just drains your energy and wastes your remaining precious time living on this planet Earth (which you only have once), which is very beautiful to explore rather than if you are just sitting there doing something about human-invented technology. The solution is Firebase; this gonna be a cheat sheet for whenever you want to start building a new project or if you are just a beginner using Google firebase. This will guide you through creating a website from scratch. No server setup required; no dev-ops skills needed, with NoSQL database to not be bothered by the SQL and its slowness and many problems with locking, foreign keys, maximum column size, and so on. Let’s just start building a w

Intellij Spring Boot JSP Page not found or too many redirects

Image
Intellij IDEA - the leading Java IDE This is a bug in IntelliJ version 2021.3 probably gonna be fixed in the future release version of IntelliJ. So, if you have a similar problem, maybe this can fix it. The error usually shows up as page Not found or too many redirects, when you run spring boot code with JSP template using the Intellij run icon. Here’s a simple quick fix to solve it: - Go to the run Edit configuration - Select Modify option - Select a Working directory - And put this variable: $MODULE_DIR$   - Then run once again It is not something wrong with your code, JSP codes, if you debug it you will see that everything just works. Even if you are using the spring-boot maven plugin, like doing mvn spring-boot:run the program just works fine. Sometimes we need to debug our project using the IntelliJ debugging feature, which is impossible to do by just using the maven spring-boot plugin. So we need to run the program using the IDE. I hope this can fix and solve your

Commands To Remove Folder Using Windows Powershell

Image
Accidently removes an important document If you are a Unix person trying to operate Windows, you probably gonna typed RM -RF SOME-FOLDER in Powershell and expect it to remove a folder. But unfortunately, it won’t work on windows, even In the older versions of the windows terminal system. To delete a directory you’ll have to use rmdir /s /q the-folder-name.  But again it won't work anymore on Windows PowerShell. You have to learn lots of power shell commands.  Solutions To remove some folders on your computer using windows PowerShell, execute this command line below: remove-item -recurse -force THE_FOLDER_NAME The recurse is equivalent to “-r” in Linux. It forces the commands to remove the nested folder. And the -force is similar to ‘-f’ in Linux. To force delete the file if some other program is holding it. Those commands also can be applied to remove files. But without -recurse and -force options. That command is similar to the Unix rm -rf folder.  And in the older Windows command

Become An Efficient Programmer

Image
Work Efficiently - Photo by Alexandr Podvalny on Unsplash As all of the industry around the world digitizes their businesses, there’s a huge demand for more software developers. A very labor-intensive job that requires focus, sitting for hours and staring at the LCD screens, sometimes overlaps with the weekends, not that it’s wanted but because the task requires an excessive amount of time. Promises of a good salary and stable career path, people rush trying to school themselves and even their children to enter the Tech world, which is still not too late yet may be on the brink of decline, as AI now can perform to write their own codes, and Developers are in danger of being replaced. I remembered not so long ago, about 8 years ago, my first professional job as a software coder began. Not a pleasant year being very junior, in any industry. I had to have a big brave face to not only face very mad clients but also my coworkers and myself, my inner thoughts telling me that I should've

How to Permanently Disable Windows Defender Home Edition

Image
Windows Defender Task Manager Unlike the pro version, the Windows Home edition doesn’t have a group policy editor (gpedit) preinstalled. So it’s a bit tricky to disable the antimalware service executable permanently. Follow these steps to disable Windows defender antivirus on Windows home. 1. Open Windows Security > Virus and Threat Protection > Turn off real-time protection 2. Turn off all the available options like Tamper Protection  3. Download the gpedit-enabler.bat here [ https://gist.github.com/mudiadamz/9a7809dafc13a85a47eccbaa04dcbc8c ] 4. Right-click on the file and Run as an administrator 5. After it’s finished installing, use Windows Key + R 6. When the dialog opens, type gpedit.msc and press enter 7. Navigate to : Computer Configuration > Administrative Templates > Windows Components > Windows Defender Antivirus 8. Navigate to Turn off Windows Defender Antivirus policy, double click on it 9. Then, Turn off windows defender antivirus, select Enabled 10. Click

Get started Oracle DB Express for development

Image
Oracle database is a Relational database developed by Oracle, Oracle DB provides high performance with failure recovery features, easy to manage the database, and has a good reputation for supporting Enterprise level applications. For you database admin or software developer that are newly using Oracle database, you can follow this simple get started guide. Follow each one of the instructions from installation to launch and create a new database table. Download and install Oracle DB Download the oracle database express edition from the following link : https://www.oracle.com/database/technologies/xe-downloads.html When the installation process is running, then you should set the default password that you will use for login. Login using SqlPlus Open terminal or command prompt and type "sqlplus”. Then enter the username SYSTEM and password you choose on the installation step earlier. Create new user Before the SYSTEM user can create new user, you have to execute this command: alter

Upload and Download Rest API using Spring Boot Reactive WebFlux

Image
Reactive Spring Logo This is maybe a very simple task, but for those of you that may not be familiar with WebFlux found it difficult to create a Rest API that handles upload and download in Reactive spring application. Create the skeleton Spring project Create a new project, go to start.spring.io , on the dependencies section, add Spring Reactive Web. Generate and extract it into your desired project location. Instead of using spring-boot-starter-web, use spring-boot-starter-webflux instead in your pom.xml. Here’s the pom.xml for our Reactive Rest API project. Create our Rest controller Now that you have set to use WebFlux instead of the usual web, we have to change a little bit in the Controller class that handles the API endpoints. It doesn’t change much but you have to wrap the Response in Mono and the request parameter to FilePart. So our upload and download file controller will look like this. Create utility to handle file upload We need to structure our project better, so we cr

Spring Kafka - how to use ReplyingKafkaTemplate send and reply synchronously

Image
Microservice Spring with Apache Kafka Kafka is an asynchronous messaging queuing system, but when you have a case in your project that you need to have the result immediately from another service you can do that quite easily. Kafka from the client side produces a message to the server side, then waiting for the server to return back the message exactly what the client wants. It’s identified in the kafka header request named KafkaHeaders.CORRELATION_ID and a topic where the server should send. If the server side produces the same correlation id to the same topic in the request, then the client side will catch that message as its reply. Although you can work with kafka from a different framework and language other than Java and Spring. Here’s in this example i just specifically giving the example of sending and replying kafka messages using Spring Boot. The Project Overview The client-project will send a string message to the server-project over kafka, then the server-project wil

Start small! You don’t have to solve world most difficult problem

Image
Start up meeting - Image by StartupStockPhotos from Pixabay You don’t have to create new business or solve the world's most difficult problem. You can just start a small doable business by following other businesses that already exist, as long as you have better product, packaging and marketing. People are too ambitious and think too far, it’s okay if you are Elon Musk, but if you just some random guy creating your own business, although it is possible to compete in space race, its chance is very slow compared to already exist doable business that you can just start So, start small, don’t overthink things. Only when your capital is significantly larger, only then you can start to think about expanding your business. Most businesses will fail before 1 year, so be careful, you have to manage your resources carefully. I read the book Atomic Habits, which can be summarized the following: Atomic Habits by James clear is a definitive guide for breaking bad behaviors, showing you how sma

Popular posts from this blog

ERROR 1348 Column Password Is Not Updatable When Updating MySQL Root Password

Flutter Button With Left Align Text and Icon

How To Use React Ckeditor Upload File Image With Demo and Example Codes

Spring Kafka - how to use ReplyingKafkaTemplate send and reply synchronously

How To Create Spring Boot Project Using Netbeans