Wednesday, April 25, 2018

Food Ordering System with SpringBoot

Hello Everyone,

From this post I will present you the API plan which was created to make a new application.

This system provides functionalities for customers to place their orders and “Cater for You Service” restaurant will fulfill the need.

Execution Order
First, when the customer visits the website of the restaurant he/she need to log in to place any order. For that login screen will be provided. If the customer is not a registered customer, he/she need to register with the system. Every component is loosely coupled to each other. 

After a successful login, customers will be prompted with the food list, which is generated through the REST API service.


Customers can choose the food item and quantity. To place the order customer need to provide the relevant personal details for a successful delivery. Meanwhile system updates and notifies the kitchen and stock.


Customers can choose their own payment method from credit card or via the phone. That request will be transferred to the ESB Enterprise integrator and through that, relevant dummy services will be invoked from the abstract layer service.


After a successful response from the service, customers can select their preferred payment confirmation receiving method out of receiving SMS or an email.


For each Rs.100, one loyalty point is added to their total tally and they can use them when it reaches more than 100 points to buy food.


Additionally another dummy service is implemented for the admin to select a customer on weekly basis, to be awarded as a winner in receiving priceless experience.



Functionalities for the Customer
o   Create an account
o   Log in to their account
o   Navigate through the restaurant’s menu
o   Select items from the menu
o   Add items to their current order
o   Review their current order
o   Provide payment details
o   Receive confirmation in the form of order number
o   View order placed
Functionalities for the Admin
o   Add/Update/Delete food item from the menu
o   Update price for a given food item
o   Update additional information(photo, description)
o   Select a winner on weekly basis


Let's meet again with drug management coding part.Happy coding :)



©Copyright Viraj Wickramasinghe.


Sunday, April 15, 2018

Pharmacy With MERN I

Hello Everyone,

From this post I will start a series of posts talking about the project that we have to do for our AF module.

For our team topic assigned was to make a pharmacy module with MERN(MongoDB, ExpressJS, ReactJS and NodeJS).




First of all we divided our topic vertically into 4 main parts...

  • Stock Management
  • Drug Management
  • Patient Management
  • Sales Management

I was assigned to make the drug management sub module and from this series I will talk about how I started to make it and difficulties that I faced in making it.

Project Initiation

First we decided to use either visual code or webstorm as our IDE.After installing one of them I open an ide of my choice(visual code) and created a folder in the workspace as pharmacy module to initiate our project.

Next, through the integrated terminal I navigated to the project folder and installed nodejs and npm from below site.

                                                             https://nodejs.org/en/

Then I checked whether it's installed properly from below commands.






 Next we want to create the package.json file to hold the meta data of the  project.It can be created from the following command.





Next we have to create a app.js file and index.html file to render our project. As we have decided to create our project using MVC architecture I created separate 3 folders namely models, controllers and views to hold our project files.

Finally required dependencies are installed using npm.

npm install --save react 
npm install --save react react-dom
npm install --save express 
npm install --save mongoose 
npm install --save mongodb 
npm install --save babel-core 

As the required dependencies initially.Later on more and more dependencies will be added to the project. All these dependency versions can be found in the package.json file.

Let's meet again with drug management coding part.Happy coding :)



©Copyright Viraj Wickramasinghe.

Wednesday, April 4, 2018

Rest Services and ExpressJS

Hello Everyone,

By this post I will introduce you about Rest Services.

REST is the acronym for REpresentational State Transfer.It is used to develop wide variety of application used over the different types of networks.


HTTP verbs

Below are the HTTP methods which are used in REST architecture
  • GET − Used to fetch resources
  • POST − Used to insert a new resource.
  • DELETE − Used to remove a resource.
  • PUT − Used to replace a new resource.
  • OPTIONS − Used to get all options that are allowed.
  • HEAD − Used to get the requested header

What is RESTful service?

REST architecture based web services which identified by their URIs. Client applications uses HTTP GET and POST methods.These methods will invoke Restful services called upon.
This is reflected as a subsititution which came over SOAP web services.Main advantage of this was, it is light weighted and no strict standards to follow. 
Both JSON and XML data types used for requests and responses.

Below is an example of creating RESTful web service

POST
  • http://www.afsliit.com/students 
This POST request is used to create a new resource student in the system.


GET
  • http://www.afsliit.com/students/1234 
This GET request is used to get the data of student of ID 1234.

PUT
  • http://www.afsliit.com/students/2312
This PUT request is used to update the data of student of ID 2312.

DELETE
  • http://www.afsliit.com/lecturer/eT45w2
This DELETE request is used to delete the data of lecturer of code eT45w2.




Let's meet again with another exiting post.Happy coding :)



©Copyright Viraj Wickramasinghe.