Posts

Showing posts from 2017

Introduction to using ExpressJS with MongooseJS and NodeJS - Part 2

Image
This is a continuation of my previous blog on using express on NodeJS and MongooseJS. Please refer to that tutorial before continuing further in this tutorial. Here we gonna continue our previous applications CRUD functionalities, but first we gonna streamline our project by using nodemon package. Intializing Nodemon using following command, npm install nodemon --save-dev Here, Nodemon restarts the server automatically each time you save a file that the server uses. The reason for using it as only as a developing dependency is we only need it in development time. There are many ways to run the application using nodemon, but i will use a much simpler way, Here we gonna define nodemon in run script in package.json Now we need to enter the following command in terminal inorder to run the application, npm run dev So we are back to our main topic CRUD functionalities. We have already created GET-READ capability in previous tutorial. Let's start on POST-CREATE capabi...

Introduction to using ExpressJS with MongooseJS and NodeJS - Part 1

Image
First let's see what is this expressJS, According to their website, it's a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications. Creation of APIs is easy and provides a thin layer of fundamental web application features, without obscuring Node.js features that you know and love.  So without further delay let's start coding, Start by creating a folder for this project. Navigate to it and run this command to create package.json which helps you to manage your dependencies, npm init  Then install express on your project, npm install express -save  Now let's create a simple server using Express.First create server.js file inside the app directory.Inside the file type the following code,   Here, we are using express in server.js by requiring it.Then we have created the server using listen method. Now run the server using following command, node server.js  Na...

Generate a MeanJS App using Yeoman Generator

Image
First let's see what is MEANJS, then we gonna walk you through a simple tutorial on how to develop a meanjs app using yo generator.  What is MEAN.JS? MEAN.JS is a full-stack JavaScript solution that helps you build fast, robust, and maintainable production web applications using MongoDB, Express, AngularJS, and Node.js. Why MEAN.JS? MEAN.JS will help you getting started and avoid useless grunt work and common pitfalls, while keeping your application organized. Our goal is to create and maintain a simple and readable open-source solution that you can use and trust in your projects. One of the most frequently asked features from MEAN users is a way to scaffold their applications.So using yeoman generator, which includes a set of simple tools, can make your life easy as a developer. As the first step you have to install yo scaffolding tool, npm install -g yo This is only the tool, now we need to install a sub-generator which is the one we need in this tutorial. ...

Introduction to NodeJS Coding - Part 2

Image
Here we gonna create a simple HTTP server with REST capabilites. Hope you guys followed my previous introductory coding blog on NodeJS. If not click Here , First let's see what is a Web Server, A Web server is a program that uses HTTP (Hypertext Transfer Protocol) to serve the files that form Web pages to users, in response to their requests, which are forwarded by their computers' HTTP clients. Dedicated computers and appliances may be referred to as Web servers as well. [whatIs.com] So, let's create one, First create a JavaScript file as 'server.js'. Import the http module from the core libraries. const http = require('http'); Create a httpServer that listens to port 3000 and return HTML with Hello World text in h1 header upon GET request.  Check the output of the code by running the code and accessing http://localhost:3000 in browser.  So let's improve our server,  adding a POST request that accepts form field name and ...

Introduction to NodeJS Coding - Part1

Image
Here we gonna talk about main features of NodeJS runtime and JavaScript library. Hope you guys followed my previous introductory blog on NodeJS. If not click Here , As with any programming language, platform, or tool that doesn't come bundled with Windows, getting up and running with Node.js takes some initial setup before you can start hacking away. In my experience, though Node.js has a far better installation experience on Windows than virtually any other language, platform, or tool that I've tried to use - just run the installer, and you're good to go. First install node on your computer, Open the official page for Node.js downloads and download Node.js for Windows by clicking the "Windows Installer" option Run the downloaded Node.js .msi Installer - including accepting the license, selecting the destination, and authenticating for the install. This requires Administrator privileges, and you may need to authenticate To ensure Node.js has bee...

Intoduction to NodeJS

Image
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. [TutorialsPoint] Here's a few key point regarding NodeJS, Developed by Ryan Dahl.   Created with the aim of creating real-time websites with push capabilities (websockets). NodeJS is an open source, cross platform runtime environment for server-side and networking applications. Build on V8 engine, Chrome’s JavaScript engine. Uses event-driven, non-blocking I/O model which makes NodeJS lightweight and efficient. Ideal for data-intensive real-time applications that run across distributed devices. NodeJS comes with several JavaScript libraries that help basic programming. NodeJS eco-system ‘npm’ is the largest in the world for open source libraries.   Let's...

Machine Sharing And Enterpise Resource Planning System - Java (S.L.I.I.T 2nd Year ITP Project)

Image
This system is developed by me and 7 other team members for 2nd year module ITP,here you can check out our project from github GitHub Link  Summary  The aim of the project is to automate some aspects in production process. Vogue Tex is an apparel manufacturer which consists of 9 main factories all over Sri Lanka. We developed this system only for a branch hoping to expand it to other branches as well. I managed to develop a style planning and resource allocation module for this system. This module helps the user to enter a new style by checking with available resources and if the resources are not sufficient it will send a notification. This also helps the user to track the critical path of a style. In other modules we managed to perform employee, inventory, transport, sales and maintenance management.   Knowledge Covered in the project:  Experience gained working with a real client Agile software developing methodologies Database implementation and...