Вы находитесь на странице: 1из 32

A Project Report On

“Web Based File Downloader using NodeJS”


Exploration and
Production Information Network (EPINET)
Oil and Natural Gas Corporation (ONGC), Dehradun Summer
Project Training Program

Under the guidance of:

Mr. Sanjay Kumar Gupta


Manager (Programming)

CEDC DDN, Dehradun

Submitted By:
Vivek Raj
B. Tech (Computer Science and Engineering) NIT, Uttarakhand
JULY 2019

1
DECLARATION

I hereby declare that the work presented in this project report entitled “Web
Based File Downloader using NodeJS” for the Award of Degree of Bachelor Of
Technology, submitted to the department of Computer Science and
Engineering, National Institute of Technology, Uttarakhand is an authentic
record of my work during the Summer Training from 24th June 2019 to 23rd
July 2019, under the knowledgeable guidance of Mr. Sanjay Kumar Gupta,
DGM(Programming), CEDC DDN, Dehradun.

Signature of the Student:


Vivek Raj

2
CERTIFICATE

This is to certify that Vivek Raj ,a student of B. Tech (CSE) of National


Institute of Technology , Uttarakhand has done his Summer Training at EPINET,
KDMIPE Campus, ONGC Dehradun. The project work entitled “Web Based File
Downloader using NodeJS” embodies the original work done by Vivek Raj during
summer training period from 24th June 2019 to 23rd July 2019.

Date : Mr. Sanjay Kumar Gupta


Place : Dehradun Manager (Programming)

CEDC DDN, Dehradun

3
ACKNOWLEDGEMENT

The internship opportunity we had with Oil and Natural Gas Corporation Ltd. was
a great chance for learning and towards professional development. Therefore, I
consider myself as a very lucky individual as I was provided with an opportunity to
be a part of it. I am also grateful for having a chance to meet so many wonderful
people and professionals who led me though this internship period.

I express my deepest thanks to Mr. Vivek Malaviya, Chief Engineer (Electrical)


ONGC Academy for giving me the opportunity to gain experience and be part of
this esteemed organization.

I am thankful to Mr. S. Banerjee, CGM-Head EPINET for giving me the


opportunity to gain experience and be the part of this esteemed organization.

I want express my deepest thanks to Mr. Sanjay Kumar Gupta


Manager(Programming) CEDC DDN, DEHRADUN, my mentor for giving
necessary advices and guidance. I choose this moment to acknowledge his
contribution gratefully.

I also acknowledge Mr. Jim Moses for advising and helping me in this project.

I perceive this opportunity as a big milestone in my career development. I will strive


to use gained skills and knowledge in the best possible way, and will continue to
work on their improvement, in order to attain desired career objectives. Hope to
continue cooperation with all of you in the future.

Finally, I would thank my parents for imparting me moral support and


motivation during this project.

Sincerely,
Vivek Raj

4
Contents

About-ONGC………………………………………………………………….…..6
About EPINET –An Introduction…………….……………………………7

Organization of EPINET

Software................................................................................8-11
Database Centers & Data Flow ............................................11-12

Development of reporting tool used for E & P data

Abstract………………………………………………………………..………....13-14
Scope & Objective of the project………………………………….…..14-15
Tools/Platform/Language used............................................16-19
Working of the Project………………………………………………..…….19-23
Coding and output snippets………….......................................23-32

Conclusion.........................................................................33

5
Introduction

About-ONGC

Oil and Natural Gas Corporation Limited (ONGC) is an Indian multinational oil
and gas company headquartered in Dehradun, India. It is a Public Sector
Undertaking (PSU) of the Government of India, under the administrative
control of the Ministry of Petroleum and Natural Gas. It is India's largest oil and
gas exploration and production company. It produces around 72% of India's
crude oil (equivalent to around 30% of the country's total demand) and around
48% of its natural gas.

Global Ranking

 ONGC received Dun & Bradstreet Award 2018 in the 'Oil and Gas
Exploration' category
 ONGC received 4 PSE Excellence Awards from Indian Chamber of Commerce
in 2016
 This Top Energy Company in India, ranked 11th globally as per Platts
Top 250 Global Energy Rankings, 2017

 Ranked 464 in the Newsweek Green Rankings World's Greenest
Companies 2016

 Ranked 14th among global Oil and Gas Operations industry in Forbes
Global 2000 list, 2017 of the World's biggest companies for 2017;
Ranked 443 in the overall list, 2017 - based on Sales (US$ 19.89 billion),
288 on Profits, 470 in Assets and 300 Market Value.

ONGC Videsh is a wholly owned subsidiary of Oil and Natural Gas Corporation
Limited (ONGC), the National Oil Company of India, and is India’s largest
international oil and gas Company. ONGC Videsh has participation in 41 projects
in 20 countries namely Azerbaijan, Bangladesh, Brazil, Colombia, Iraq, Israel,
Iran, Kazakhstan, Libya, Mozambique, Myanmar, Namibia, Russia, South Sudan,
Sudan, Syria, United Arab Emirates, Venezuela, Vietnam and New Zealand.

ONGC was founded on 14 August 1956 by Government of India, which


currently holds a 69.23% equity stake. It is involved in exploring for and exploiting
hydrocarbons in 26 sedimentary basins of India.
6
About EPINET –An Introduction

During past six decades of extensive hydrocarbon exploration over a vast


geographical area covering almost all the sedimentary basins in India, ONGC
has acquired enormous volume of geological, geophysical and engineering data.
In line with the global upstream oil majors, underlining the importance of
computerized data archival, ONGC also initiated data management activities way
back in 1976. A well information system on IBM-370 at KDMIPE was developed
in-house. Data management activities got a boost when VAX-3400 computer
system along with RDBMS software was commissioned at KDMIPE in
1991. Furthermore, other isolated systems also emerged at different work
centers of ONGC to cater to the data management needs. These in-house
database systems were developed using different types of formats and
platforms. Eventually, in-house database systems were felt inadequate and
required to be replaced with system matching international standards in the
industry. In late 1990's, ONGC decided to implement the recent advancements
of the web based E&P information technology into its upcoming data
management systems. The new implementation plan aimed to make available all
information pertaining to an area, including the work previously done by
archiving historical analysis, to business users. In the aforesaid background,
ONGC decided to implement Exploration and Production Information
Network (EPINET) project comprising of people, processes, tools, data and a
hierarchy of corporate, regional and working project database in a phased
manner. The project was intended to establish an organization wide dynamic
"Virtual" database having GIS features and Web capabilities, and also to
interconnect different data stores located at geographically diversified
locations. Having taken shape according to the vision, intention and need of
various work-centers of ONGC, today, EPINET is ONGC's full-fledged technical
data repository housing all technical data generated throughout ONGC. This
includes WCRs (Well Completion Reports), Log data, Seismic data, Geology
Data, Lab data, Drilling Data and Production Data.

7
Organization of EPINET

Software: Finder

Until 2013, EPINET housed all its data using software called “Finder”. Finder is
a product of Schlumberger Information Systems (SIS). Finder uses Oracle
Database and is built to run on the old Sun Operating system. A Sun server is
used to host the Finder software. Below is a screenshot of Finder user interface:

8
Three-tier setup

When Finder was in use, EPINET was organized in a three-tier model with
secondary and tertiary level data-centers spread across each basin. The
following Diagram shows the old three-tier setup:

Three-tier setup of EPINET under Finder

ProSource
After 2013, all data in EPINET was managed through a software package called
“ProSource”. ProSource has been in full use only since December 2013. It is
also a product of Schlumberger Information Systems (SIS). ProSource uses Oracle
Database to manage data and is built on the seabed Data Model. The User
Interface of ProSource is web-based and is built on Java. ProSource runs on Red
Hat Enterprise Linux 5.5. A product of Oracle called “Golden Gate” is

9
used to replicate data from all centers into the database at Dehradun
Corporate center. Migration from Finder to the new ProSource system took
places in several phases, covering one region at a time. The final phase
completed in December 2013 with the migration of data at Corporate EPINET
center, Dehradun. Below is a screenshot of the new ProSource interface:

Database Centers & Data Flow

Under ProSource, EPINET was organized into six data centers in a two-tier
model with the corporate center housed at KDMIPE, Dehradun. The data
centers and the regions covered are as follows:

10
Data from respective regions are populated and maintained at the respective
centers. Data from all centers are centrally replicated at the Corporate EPINET
Center, Dehradun via Golden Gate, a plugin of Oracle. The following diagram
shows the setup:

Development of In-house Data Management Software

During November 2012, it was decided that efforts would be made to maintain
EPINET system using in-house talent. Eventually, in-house maintenance began
in October 2014, saving ₹12 Crore annually since then. Leveraging in-house
talent across all EPINET sites and collaborating over a period of 2 years, the
Beta version of EPINET Portal & Loaders were ready and was rolled out

11
exclusively for in-house testing by EPINET members, at the Annual
Coordination Meeting held at EPINET Chennai. After extensive testing and
improvements, in July 2017, the tested and improved version of In-house
EPINET Software is rolled out across ONGC by Director (Exploration), Sh. A
K Dwivedi via video-conferencing and was jointly witnessed by various
offices across ONGC joining the live video conference. This In-house
software is currently in use, with new features being added consistently.

12
File Downloader using Node JS

Abstract:
The project enables the user to download server files. It displays the files, sorted
on an easy to view webpage.

Scope and objective:

Scope:

The scope of the proposed Project “Node JS” is to develop a user friendly
webpage to display all the files on a server. The objective of our project is to
enable end-user to save time while downloading the data from the server.

Objective of the project

The project aims at serving the data from EPINET Database System in the form of
a webpage. The proposed project has the following objectives:

1) Platform: -. The project aims at developing a web-based user interface for


serving server files. The data download software application works best
with the client machine to have latest versions of all popular browsers. With
this, the user interface the required data can be easily accessed .

13
2) Ease of Use: - The proposed project would be able to help the users to quickly
search files. The data can be stored in any other path which can also be
accessed. As the data keeps on piling up , the project helps in squeezing more
efficiency from a tedious task.

3) Implementation of New Technology: - ONGC’s old system was based on


the following technique
a) ASPX controller calls CMD scripts
b) CMD script use putty to connect with fileserver
c) Scripts on fileserver send the file to target machine.

On the other hand,


In Node.js all complications are moved to a single layer.

14
TOOLS/PLATFORM/LANGUAGE USED

Software requirements

SR.
NO SOFTWARE REQUIREMENTS

Operating System: Windows XP, Vista,


1.
Windows-7, Windows-8 or
Windows-10

Programming Sublime Text 3, Visual


2.
Environments: Studio Code as text editor,
Node JS for Server.

Languages Used: HTML, JavaScript, CSS,


3.

Modules Used: Express Java Script(EJS)


4.

15
Advantages of using JavaScript and NODE JS

Node.js is widely used because:

1. Node.js offers an Easy Scalability

One of the key advantages of Node.js is that developers find it easy to scale the
applications in horizontal as well as the vertical directions. The applications can be
scaled in horizontal manner by the addition of additional nodes to the existing
system.
Moreover, Node.js also offers you the option of adding extra resources to the
single nodes during the vertical scaling of the application. So, it is highly scalable
and provides better option than other JavaScript servers.

2. Easy to Learn

Since JavaScript is one of the most popular programming languages, most of the
front-end developers have a good grasp over it.
It becomes much easier for them to start using the Node.js at the backend. It is
easier to learn Node.js and consumes less time to work with it.

3. Node.js is used as a Single Programming Language

Node.js offers the developers the luxury of writing the server-side applications in
the JavaScript. This allows the Node.js developers to write both the front-end as
well as the back-end web application in JavaScript using a runtime environment. And
they don’t need to use any other server-side programming language. It also makes
the deployment of the web applications simpler because almost all the web
browsers support JavaScript.

4. The Benefit of Full stack JS

Node.js has been regarded as a full-stack JavaScript for serving both the client and
the server-side applications.
Therefore, the advantage is that you don’t have to hire separate developers for
backend as well as the front-end development. It saves both your valuable money
and time.

16
5. Known for Offering High Performance
It has been mentioned earlier that Node.js interprets the JavaScript code via
Google’s V8 JavaScript engine. This engine complies the JavaScript code directly
into the machine code. This makes it easier and faster to implement the code in a
effective manner. The speed of the code execution also enhanced by runtime
environment as it supports the non-blocking I/O operations.

6. The Support of Large and Active Community


Node.js is blessed to have a large and active community of developers who keep
on continuously contributing towards its further development and improvement.
In fact, the groups of developers are well supported by the JavaScript
programmers providing ready-made and easy solutions and codes in GitHub. It is
expected that the developers will initiate many further developers in the future.
7. The Advantage of Caching
The open-source runtime environment of the Node.js also provides the facility of
caching single modules. Whenever there is any request for the first module, it
gets cached in the application memory.
The developers don’t have to re-execute the codes as caching allows applications
to load the web pages faster and responds more swiftly to the user.

8. Offers the Freedom to Develop Apps


Another advantage that Node.js offers to the developers is the freedom to
develop the apps and software.
This is one essential feature, which remains absent in Ruby on Rails imposing
certain guidelines. You can begin everything from the scratch while developing
applications.

9. Getting Support for Commonly Used Tools


With Node.js, the developers can get an extended support for the various
commonly used tools. Let’s take an example. Suppose, you want to test the source
code of Node.js application; you can do so by using the Jasmin and other such unit-
testing tools. Similarly, if you want to identify and install the project dependencies,
you can make use of NPM, a powerful package manager. You
can use grunt for task running of the project.

17
10. Handles the Requests Simultaneously
Since the Node.js is providing the option of non-blocking I/O systems, it relatively
helps you to process several requests concurrently.
The system can handle the concurrent request handling efficiently better than
others including Ruby or Python. The incoming requests get lined up and are
executed quickly and systematically.

11. Node.js is Highly Extensible


The Node.js is known to be highly extensible, which means that you can
customize and further extend Node.js as per their requirements.
You can also make use of JSON to provide the scope for exchange of data
between the web server and the client. It also is facilitated with built-in APIs for
developing HTTP, TCP, and DNS etc. servers.

The merits of using JavaScript are:


 Less server interaction: You can validate user input before sending the
page off to the server. This saves server traffic, which means fewer loads on
your server.
 Immediate feedback to the visitors: They don't have to wait for a page
reload to see if they have forgotten to enter something.
 Increased interactivity: You can create interfaces that react when the user
hovers over them with a mouse or activates them via the keyboard.
 Richer interfaces: You can use JavaScript to include such items as drag-and-
drop components and sliders to give a Rich Interface to your site visitors.

Express.js

"Express is a fast, unopinionated minimalist web framework for Node.js" - official


web site.Express.js is a web application framework for Node.js. It provides various
features that make web application development fast and easy which otherwise
takes more time using only Node.js.

18
Express.js is based on the Node.js middleware module called connect which in
turn uses http module. So, any middleware which is based on connect will also
work with Express.js.

Advantages of Express.js
1. Makes Node.js web application development fast and easy.
2. Easy to configure and customize.
3. Allows you to define routes of your application based on HTTP methods
and URLs.
4. Includes various middleware modules which you can use to perform
additional tasks on request and response.
5. Easy to integrate with different template engines like Jade, Vash, EJS etc.
6. Allows you to define an error handling middleware.
7. Easy to serve static files and resources of your application.
8. Allows you to create REST API server.
9. Easy to connect with databases such as MongoDB, Redis, MySQL

19
Working of the project:
1. The user adds all the files to the server (here /Project/Public)

2. Open up the command window for Node

20
3. Server.js has a server now up and running at port 3000.

4. Open up a browser at “localhost:3000”

21
5. HTML page shows all the files on the server with an option to search/
download/enter a path on system.

6. Press Download Now and the file download starts immediately.

22
7. To test the Path option we try downloading a path on the system
“C:\Intel\Logs\dptf.log”
The file dptf.log downloads

23
Coding
Here are some snippets of the code –
1. Server.js (The JavaScript File)

const express = require('express')

var fs = require('fs'); const

app = express()

app.set('view engine', 'ejs')

app.use(express.static('public'));

var fs = require('fs');

var files = fs.readdirSync(__dirname+'/public');

var i,j;

for(var i=0;i<=files.length;i++)

{ var j=0;

(function(i)

app.get('/download/'+i, function(req, res){

const file = `${ dirname}/public/`+files[i-1];

res.download(file); // Set disposition and send it.

});

})(i); };

24
app.get('/download', function(req, res){

const file = `${ dirname}/public/testimage.jpg`;

res.download(file); // Set disposition and send it.

});

app.get('/', function (req, res) {

res.render('ind',{ filename:files});

})

app.listen(3000, function () {

console.log('Example app listening on port 3000!')

})

25
2. HTML file (Views) with CS

<!DOCTYPE html>

<html>

<title>ONGC Project</title>
<head>

<style>

img {

width: 30%;

.wrapper {

text-align: center;

}
.button {

position: absolute;

top: 50%;
}

.center { display:

block; margin-left:

auto; margin-right:

auto; width: 100%;

} div.ex2 { width:650px;

margin: auto;
26
margin-left:

auto;

margin-right: auto;

.parallax {

/* The image used */

background-image: url("rig.jpg");

width:100%;

/* Set a specific height */

min-height: 500px;

/* Create the parallax scrolling effect */

background-attachment: fixed;

background-position: center;

background-repeat: no-repeat;

background-size: cover;

27
</style>

</head>

<body background="/zz1.gif">

<div class="parallax"></div>

<div class="ex2">

<fieldset>

<img src="/ONGC1.PNG" alt="ONGC" class="center" >

</fieldset>

</div>

<tr>

<td>

<h1 style="font-size:300%;text-align:center;color: rgb(115, 112, 117);


font-family: Impact, Charcoal, sans-serif">Files on the Server</h1>

</td>

</tr>

</table>
<ul>

<% j=0;for(i=0;i<filename.length;i++) { %>

28
<p style = "font: bold 20px verdana; text-align:center; color: white">

<%= i+1 %>. <%=filename[i] %>

</p>

<div class="wrapper">

<button style="float: center;" onclick="window.location.href =


'/download/'+ <%= ++j %>;">Download Now</button>

</div>

<br>

<% } %>

</ul>
</body>
<footer>

<p style="font: italic 15px georgia;color: white" >

</footer>
</html>

29
3. Package .json file

"name": "ongc_proj",

"version": "1.0.0",

"description": "jeje",

"main": "server.js",

"scripts": {

"test": "npm ...",

"start": "node server.js"

},

"repository": {

"type": "git",

"url": "none"

},

"keywords": [

"none"

],

"author": "mishthi",

"license": "UNLICENSED",

"dependencies": {

"ejs": "^2.6.2",

"express": "^3.1.0",

31
30
SAMPLE WORKING OF THE PROJECT

31
Conclusion

The project aims at developing a web-based user interface that acts as a


downloader for the files being served on the server. It saves time as it allows users to
view and download the files on a page. The Summer Training has helped me to get
acquainted with all the on-going activities of Corporate EPINET Centre at ONGC,
Dehradun and various responsibilities of this group. Involvement in development
activities have also given me the opportunity to explore, learn and know various
technologies, languages and programming platforms. I would once again like to
express heartfelt gratitude to all those who contributed towards making my training
a rich experience and to the staff of ONGC for assisting me throughout the project.

32

Вам также может понравиться