Debugging Node.js application using Chrome DevTools

During the development of any software application, sometimes a developer may need to debug the code to understand the flow of execution or even to fix a bug. I have seen JavaScript developers prints the output/value on the console using console.log() to debug the node application.

This is definitely not an efficient way to debug the code. You have to log the values in various places, hence you need to repeat console.log() multiple times. Also, you need to take them off before committing your code. This would  slow down the development time and mess up the code.

Debugging your node application using Chrome DevTools is one of the simple and efficient ways.

Here are steps to debug your node application.

1. Run the application using --inspect flag.

Running-Node-Application

Once your server up and running…

2. Open this URL in your Chrome browser : about:inspect

about-inspect

3. Click on Open dedicated DevTools for Node

You will get a dialog box where you need to provide your application end-point and click on Add connection

DevTools-Dialog

You can click on the Sources tab and navigate to your application folder. You will be able to debug your code here.

In the below screenshot I have kept a breakpoint on line 8 where I’m finding out the parameter sent to the /number route which is 30.

sources-devtool.png

You can debug your server-side JavaScript code just like how you debug your client-side JavaScript code.

Mentoring for Google Code-in – WikiToLearn

Google Code-in

Google Code-in has just begun. I’ll be mentoring this time. 🙂

If you know any pre-university students who are interested in computers or open source please do inform them about this. Task varies from coding, documentation, training, outreach, research, quality assurance and user interface. Also, students earn prizes for their successful completion of tasks.

What is Google Code-in ?

Google Code-in is a contest by Google to introduce pre-university students (ages 13-17) to open source software development. Since 2010, over 3200 students from 99 countries have completed work in the contest.

What I’ll be doing ?

I’ll be mentoring for tasks under WikiToLearn, KDE organization.
I have published a task related to WikiToLearn community : What can I do for WikiToLearn

I’ll be helping students with code and design for this task.

I have few other tasks in my mind. I may publish them as we move on (based on our progress).

Why I’m doing this ?

Well, I just love open source and like helping others to get into FOSS. And WikiToLearn, KDE is a great community to work with.
I strongly believe in it’s philosophy – “Knowledge only grows if shared”. It feels good to help the younger generation to get into community so that our community grows big.

Join WikiToLearn now and contribute however you can. 🙂

SwiftCode at BNMIT

Firstly, check out our technology stack :

swift-code4
It is Play framework, REST API, Java, AngularJS, MySQL, we deploy our application on AWS, Heroku. All our development happens over Lubuntu, a lightweight and fast operating system. We make use of Git along with GitHub for version control.

What is SwiftCode ?

SwiftCode program is intended to show a modern age computer science graduate how to build scalable and robust applications using state of the art techniques and design methodologies that have shaped software today.

This blog post beautifully explains how we set up collaborative development environment for our workshop : How to Quickly Set Up Collaborative Software Development Environments

On August 20th, we hosted our first workshop at BNMIT engineering college, Bangalore. We had 25 students from Computer/Information Science department.

On the first and second day, Sandeep and Akshay took the session on Java Play framework, explaining how to build a RESTful application. They completed the backend side of the application. Students were often made to commit and push their code on Github. At the end of day 2, Shrita showed how to test our APIs using the Postman.

On the third day, Prarthana took a session on front-end development, talking about how responsive websites could be built using bootstrap, architecture of Model-View-Controller (MVC) and AngularJS.

At the end of the training, all students were able to build a social media (similar to facebook) application on their own. They had soo much fun and learned a lot.

You can see all the repositories created by them at our GitHub org : https://github.com/swift-code

This slideshow requires JavaScript.

Image source : SwiftCode

It’s a great start to our long journey. Keep waiting to know about our next stop! 🙂

One last step for completion of Google Summer of Code – KDE – WikiToLearn

One last step for completion of Google Summer of Code – KDE – WikiToLearn

Collaborative Editor Extension for MediaWiki
The Google Summer of Code 2016 is coming to an end, just couple of days left.

The good thing is that I’m also almost done with my project and enjoying my free time. 🙂

I have published the screencast of how my project (Collaborative editor extension) works on my laptop.

YouTube : https://youtu.be/lf1Kg0gVIWk

I had built the extension on normal MediaWiki.
I tested it on my local instance of WikiToLearn i.e http://tuttorotto.biz (URL is accessible only if you are running its local instance)
It works good and as smooth as it was on MediaWiki.

The things I’ve planned to work on these final days are :

* Write good documentation. Since my project was bit complicated, I do feel it requires a good documentation on how does it work, how to use it and configuring it.

* It may need some tweaking on UI so as to match with the current skin of WikiToLearn. It would be easy, we can do it anytime but my focus is on get the collaborative editing work good.

* I’m curious to know how it would perform when we deploy it on staging or production server. I know WikiToLearn will be used by the huge number of people every day and hence it will have high traffic.

I’m also looking for any good tool to write my documentation. Maybe GitHub wiki, ReadTheDocs or a blog post would be fine I think.

Hope all these goes well. 🙂

Cheers!

[Edit]
Testing Rich Elements.

YouTube : https://youtu.be/T3KyDwNi_VM

Weekend.py

On 23rd and 24th of April, 2016 our GLUG DSCE organised a basic Python and Django hands-on workshop.
python
On 23rd, Santosh from HackerEarth taught the students about basic python programming. The duration of this workshop was around 3 hours. Most of the basics concepts were covered. Most of the students who attend this workshop were from 4th-semester. They knew about C programming and Object oriented programming language like C++ which helped them to learn python quickly.

They all were amazed at the flexibility provided  by the python. Santhosh’s talk was impressive enough for students to fall in love with python. 🙂
T-shirts were awarded to students who solved the bounty questions quickly.

django

On 24th, we had Ramaseshan from Fractalio Data Pvt Ltd who took a hands-on workshop on Django. Firstly, he explained about the MVC, MTV architecture to make them understand how architecture plays an important role in building an application.

The duration of this workshop was around 5 hours (excluding 1-hour lunch break). We worked on a building a basic Django app – writing notes something like Evernote. It was taught very well.

At last, we had an hour for open discussion. Students were made to as any question related to Django or anything related to technology. I and Farhaan spoke about our GSoC project ideas and motivated them to contribute to Free and Open source software projects.

Ramaseshan spoke about Free Software philosophy, mesh network, censorship, privacy, free software communities and lot other things. His talk was very much impressive, many students wanted to join GLUG as core members and contribute in whichever field they are interested in. 🙂

A meeting was conducted soon after the workshop with the newly joined GLUG members.

Google Summer of Code 2016 – KDE – WikiToLearn

gsoc-2016

Something I’ve wanted to say for more than a year. Yes! I am a GSoCer now!
This was one among my biggest dreams. 🙂

GSoC – Google Summer of Code is an annual program, in which Google awards healthy stipends to students for contributing to Open Source projects.

All these days, I was spending most of my time fixing bugs on different open source projects. Now I have got the opportunity to work with WikiToLearn,  a proud member of KDE community, for a long period of time, implementing a new feature to wiki editor.

I would like to tell a bit about our WikiToLearnWikiToLearn wants to provide free, collaborative and accessible textbooks to the whole world.
Our philosophy is synthesized in the sentence: “knowledge only grows if shared”. We provide a platform where learners and teachers can together complete, refine and re-assemble notes, lecture notes in order to create textbooks, tailored precisely to their needs so that you can “stand on the shoulders of giants”.

I should thank my mentors Cristian Baldi, Gianluca Rigoletti  and other community members for helping me in reviewing and getting a great project proposal done. I’m really excited to work with them this summer. 🙂

Looking at previous GSOCers like Sayan, Sagar, Vignesh, Parth was always motivating me to contribute to open source and become a GSoCer.
I thank F.S.M.K, DGPLUG, and our GLUG-DSCE which taught me a lot about free/open source technologies.

More love to WikiToLearn  folks for giving me this opportunity to work with them. 🙂

 

You can have a look at my proposal abstract here.
Soon I’ll push my complete project proposal on GitHub.

The real fun begins now. 🙂

Why git ?

Why git ?

Hey people,

This post is dedicated for my friends who are new to FOSS  world or would like to get started with git.

Every time I start to explain about git to my friends I give them this problem statement and ask them to give me the solution :

You are in a project team which consist of 5 people and each of them stay in 5 different countries. Your project is to build some application where all 5 of you have to do some code contribution to it. Now, how this work can do done collaboratively ?

(I know that people usually share the code via storage devices like USB drives. 😀 That’s the reason I said your team mates are in different countries.)

Do you think you can share the code snippets over email ?
Or by using any cloud platforms like dropbox, google drive, etc ?

Well, these approaches are possible too but they are not very much efficient. Management of the code becomes hectic.

This is where the git comes for the rescue.

Git is a popular version control system (VCS) used for software development. As I have seen, most of the open source projects development are done with this VCS. Git has been beautifully designed with graph theory tree model.
Git provides lots of features like code tracking, reverting, keeping the development of new features separately from the main code base using branches.

$ man git

Documentation of git on man page is not much helpful. One has to look for stack overflow for most problems he usually faces.  For instance, three of the top five highest voted questions on Stack Overflow are questions about how to carry out relatively simple tasks on git.

Steve Bennett explains about 10 things he about git.
Some of his points are true.
It may be complex, lengthy process, new technology to learn, but it will keep developers life simpler. 🙂

git
So, no more sharing code via storage drives, emails, dropbox or google drives. You can use git, push the code onto some server like gitlab, github or bitbucket and work collaboratively. 🙂

In my next post, I’ll write about how to work collaboratively using git. 🙂