Summer Training Internship Report - Cap 735

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 13

CAP 777 Project

Submitted by Rahul Kumar (12325892)

and Sobhit Kumar (12323636)

School of Computer Application

Lovely Professional University, Phagwara


Introduction

In this course, I learned how to build effi cient, scalable, and fast server-side
applications using PHP. Laravel is a powerful runtime that allows developers to build
backends with PHP, making it a popular choice for creating APIs, web applications,
and real-time services..

2
Introduction to Laravel

Server side support for PHP


Single-threaded: Asynchronous
Laravel uses aand Cross-platform:
event-driven:
single Laravel
It
thread to handle usesapplications
non-blocki
multiple ca
c
Laravel is a powerful, open-source runtime environment that allows developers to build server-s
Why Use Laravel?
PHP Everywhere: LaravelFast and
allows Lightweight:
developers to usePowered
Scalability:
PHP for by the
bothIts V8
non-blocking
PHP engine,
client-side and I/OLaravel
and event-driven
server-sideconverts PHP
architecture
development,into machine
make
simplifying cod
theit
Vibrant Ecosystem: With over a million ope
Laravel Strengths and Limitations
Strengths Limitations

Large Community: TheCross-Platform


community around Laravel is large
Development: Laravel Callback
and active,
enables Hell:
providing Although
plenty
cross-platform of mitigated
libraries,
development by modern
frameworks,
using andPHP
tool
frameworks
URL Shortener The purpose of a URL shortener backend is to:

Simplify Long URLs: It takes a long, complex URL and


1.
generates a short, easy-to-share version that redirects
users to the original URL when accessed.
•URL Shortening: When a user submits a long URL, 2. Easy Sharing: Shortened URLs are much easier to
the backend generates a unique short ID, saves the share on social media, in messages, or emails where
original URL along with the short ID to the MongoDB space is limited, making them convenient for users.
database, and returns the shortened URL to the user.
3. Track Analytics: URL shorteners can be extended to
track the number of times a link is clicked, where it's
•URL Redirection: When a user accesses a clicked from (geographical data), and other usage
shortened URL, the backend looks up the short ID in metrics, which are useful for marketing or user
the database and redirects the user to the
engagement analysis.
corresponding original URL.
4. Custom URLs: Some URL shorteners allow users to
create custom short URLs, which can help with branding
or making the links more memorable.
Technology used
•Laravel: The runtime environment used for building the server-side logic.
•Express.js: A web application framework for Laravel used to handle routing and HTTP
requests efficiently.
•MongoDB: A NoSQL database used for storing original URLs and their shortened versions.
MongoDB’s document-based storage allows flexibility in managing URL data.
•Mongoose: An object data modeling (ODM) library for MongoDB, which helps in defining
schemas and interacting with the database more easily.

8
How technologies is used?

 1. Laravel:

• Purpose: Laravel was used as the runtime environment to handle server-side operations. It allowed
PHP to be used for building the backend logic.

• How it was used: All server-side logic, including receiving user input (the original URL), processing it,
and responding with a shortened URL, was implemented in Laravel. Its asynchronous, event-driven
nature made it well-suited for handling multiple requests simultaneously, which is crucial for a URL
shortener application with potentially high traffi c.

9
How technologies is used?
Express.js:
•Purpose: Express.js was the framework used to simplify HTTP request handling.
•How it was used: Express.js managed the routing for the application:
•POST /shorten: Accepts an original URL from the user and returns a
shortened version.
•GET /:shortURL: Redirects the user to the original URL when they visit
the shortened URL.
•Express made it easy to define these routes and manage HTTP methods
(GET/POST) and middleware to validate input.
How technologies is used?
 3. MongoDB:

• Purpose: MongoDB was used as the database to store the original


URLs and their corresponding shortened versions.

• How it was used: When a user submits a URL, MongoDB stores:


• Original URL: The full URL that the user wants to shorten.

• Shortened URL: A unique string that represents the shortened


version.

• MongoDB's document-oriented storage allowed flexibility in the data


schema, which is important for handling different types of URLs
without predefined database structures.
Conclusion:

In this URL shortener project, we successfully built a


backend using Laravel, Express, MongoDB, and Mongoose.
The project showcased how these technologies work
together to create a scalable and effi cient system. By
utilizing Laravel for its asynchronous event-driven
architecture, Express for routing, MongoDB for storing
URL data, and Mongoose for schema management, we
were able to effi ciently handle URL shortening and
redirection.
Thank you

13

You might also like