0% found this document useful (0 votes)
18 views8 pages

WEB II Introduction To Backend Development Lesson010

The document provides an overview of back-end development, detailing its role in server-side application logic, database management, and API creation. It discusses essential knowledge areas such as web servers, programming languages and frameworks, version control systems, web security, and the benefits of back-end development. Additionally, it includes a guide for setting up a Node.js server using Express.js, highlighting the steps for project initialization and server creation.

Uploaded by

BRIAN MUTURI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views8 pages

WEB II Introduction To Backend Development Lesson010

The document provides an overview of back-end development, detailing its role in server-side application logic, database management, and API creation. It discusses essential knowledge areas such as web servers, programming languages and frameworks, version control systems, web security, and the benefits of back-end development. Additionally, it includes a guide for setting up a Node.js server using Express.js, highlighting the steps for project initialization and server creation.

Uploaded by

BRIAN MUTURI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Back-End Development

Introduction to back-End development


Backend Development involves the logic, database, and other operations that are
built behind the scenes to run the web servers efficiently.
Backend Development refers to the server-side development of the web
application.
It is the part of the application where the server and database reside and the logics
is build to perform operations.
It includes the main features and functionalities of the application on the server.
Python), Spring (Java), etc.
Backend development involves:
 Writing server-side code that runs on web servers
 Creating and managing databases
 Building APIs (Application Programming Interfaces)
 Implementing business logic
 Handling data processing and storage
 Managing user authentication and authorization
 Ensuring security and data protection

1. Knowledge of Web Server


The web server runs websites, it stores, processes, and delivers (response) web
pages to the user’s request.
When the user makes a request by the web server, it is accepted by an HTTP server
which finds and sends back the content to the browser through HTTP.
Some examples of web servers are Apache and NGINX which are open-source
platforms used to deliver content as per requests made.
2. Programming Languages and Their Frameworks
Choose and learn any of the Programming languages and its frameworks.
 JS + NodeJS– With JavaScript being the most demanding programming
language, you can explore various new concepts and build a very amazing
website. It is used to build interactive and dynamic websites. For JS, we
have a runtime environment which is NodeJS, which allows you to run
JavaScript on the server. We also have a framework like express.JS built on
Node.JS.
 Python + Django – Python is the easiest of all programming languages and
with Django, it plays a perfect combination to build a website. With less
code, you can build better and more easy web applications. Python is most
commonly used for developing websites and it performs quicker
implementations. Django is the most secure and scalable framework one
should work with.
 PHP + Laravel – PHP (HyperText Preprocessor) is a general-purpose
scripting language well suited for web development. It is a fast, flexible, and
pragmatic language which powers everything from blogs to the most popular
websites. Laravel is an open-source framework used to build a wide range of
web applications. It is purely a server-side framework that manages data and
uses MVC (Model View Controller) to break an application’s back-end
architecture into logical parts making it easier to build.

3. Version Control System (Git)


Version Control System helps in maintaining and tracking changes in code
changes to be used for future implementations. They are software tools that help in
managing changes in source code over time. Git which is free and open-source can
be the best choice as a version control system because of its secure, flexible, and
easy-to-edit features.
Why Git?
 It is the most commonly used version control system
 It tracks changes made in files.
 Git branches are cheap and easy to merge.
 You can move to specific versions whenever you want to
4. Knowledge of Web Security
Various threats can attack a website which could result in its poor performance.
Web security refers to the protective measures and protocols developers should
follow to build an optimized and effective website. It includes scanning a website
for vulnerabilities to defend against thefts or loss that occurs due to digital hackers.
Types of Risks developers face could be malware, backlisting, buffer overflow, and
sensitive data exposure. Various techniques can be followed to avoid such issues:
Using HTTPS: HTTPS is a secured HTTP. When data is sent using HTTPS, it is
protected via the Transport Layer Security protocol, which has three layers of
protection:
1. Encryption: Way of securing data along with a password or “key” which is
used to decrypt the information.
2. Data Integrity: When data integrity is secure, information stored in a
database is complete, accurate, and reliable for a lifetime.
3. Authentication: This method protects against attacks and builds user trust
which response to business growth.
Implementing secure backup and recovery: Data loss could be the major threat
that could lead to security breaches. To avoid this, make sure to implement a
backup process. This could be implemented in many ways:
 Protecting media and content from theft or destruction.
 Periodically testing the backups.
 Apply a two-person rule so that one person cannot access the content or
media without the permission of another article.
and various other methods include XSS Attacks, Software updates, and SQL
Injection.
5. APIs (Application Programming Interface)
An API is a set of functions that perform accessing data and interacting with
external software components, microservices, and OS.
In short, it delivers users’ responses to the system and sends responses back to the
user. It is because of APIs (which act as a software intermediary) that two
applications talk to each other.
APIs are used by backend developers to create connections between services or
applications to initiate communication to improve user experience.
Express is a good choice for a server to create and expose APIs to have client-
server communication.
 REST (Representational State Transfer)
 GraphQL
 SOAP (less common today)

Backend Development Frameworks/Technologies


 Laravel: Laravel is a PHP framework for web applications, created
by Taylor Otwell in 2011. It follows the Model-View-Controller (MVC)
architectural pattern.
 Node JS: Node JS is an open-source and cross-platform runtime
environment built on Chrome’s V8 JavaScript engine for executing
JavaScript code outside of a browser.
 Django: Django is a Python-based web framework that allows you to
quickly create efficient web applications. It provides built-in features for
everything including Django Admin Interface, default database – SQLlite3,
etc.
 Spring Boot: Spring Boot is a Java framework that makes it easier to create
and run Java applications. It simplifies the configuration and setup process,
allowing developers to focus more on writing code for their applications.
 Flask: Flask is an API of Python that allows us to build up web-applications.
It was developed by Armin Ronacher. Flask is based on WSGI(Web Server
Gateway Interface) toolkit and Jinja2 template engine.
 Express: Express is a minimal and flexible Node.js web application
framework that provides a robust set of features for web and mobile
applications. It was developed by TJ Holowaychuk. Express is based on the
Node.js runtime and simplifies the process of building server-side
applications by offering a powerful routing system, middleware support, and
a variety of HTTP utility methods.
 Ruby on Rails: Ruby on Rails or also known as rails is a server-side web
application development framework that is written in the Ruby programming
language, and it is developed by David Heinemeier Hansson under the MIT
License. It supports MVC architecture.
Benefits of Back-End Development
 Data Management: Backend handles data storage, retrieval, and
management in databases. This ensures organized and efficient handling of
large volumes of data.
 Business Logic: Backend is responsible for implementing the business logic
of an application. It processes data, performs calculations, and enforces
business rules to ensure proper application functionality.
 Server-Side Processing: Backend code runs on the server, allowing for
server-side processing. This reduces the load on the client's device and
enhances the overall performance of the application.
 API Development: Backend is responsible for creating APIs (Application
Programming Interfaces) that allow communication between different
components of a system. APIs enable integration with third-party services
and ensure a seamless user experience.
 Scalability: Backend architecture plays a key role in the scalability of an
application. Well-designed backend systems can easily scale to handle
increased loads and user traffic.
 Database Management: Backend developers design and manage databases,
ensuring efficient data storage, retrieval, and maintenance. This is critical for
applications that deal with a large amount of dynamic content.
 Support for Multiple Platforms: Backend logic ensures consistency and
compatibility across various platforms and devices. This allows users to
access the application from different devices without compromising the user
experience.
 Updates and Maintenance: Backend development facilitates easier updates
and maintenance of applications. Changes to the application logic can be
implemented on the server without requiring updates to individual client
devices.
 Optimization: Backend developers optimize code and databases to improve
application performance. This includes optimizing queries, implementing
caching strategies, and reducing response times.
 Data Validation: Backend is responsible for validating data before it is
stored in the database. This ensures data integrity and prevents the storage of
incorrect or inconsistent data.
 Consistent User Experience: Backend development contributes to a
consistent user experience by ensuring that all users, regardless of the device
or platform they are using, receive the same data and functionality.
 Compliance and Regulations: Backend developers implement features and
processes to ensure that applications comply with legal regulations and
industry standards, such as data protection laws.

Setting up a node.JS server.


First-Time Setup (Run these once)
Set Up the Project
Install Node.js and npm: Download and install Node.js from the websites. It comes
with npm (Node Package Manager), which helps you manage packages.
Initialize Your Project: Inside the folder, set up a new Node.js project by typing:
# Initialize your project (if you haven't already)
npm init -y
Install Express.js: Express.js is a framework that makes building a backend easier.
Install it by typing:
# Install Express (if not already installed)
npm install express
# Install Nodemon for development (if not already installed)
npm install --save-dev nodemon
Create the server.js File
1. Create the File: Inside your project folder, create a file named server.js. This
will be the entry point of your app.
2. Write Your First Node.js Server:
const express = require('express'); // Importing express
const app = express(); // Creating an express app

// Create a route that sends a response when visiting the homepage


app.get('/', (req, res) => {
res.send('<h1>Hello, Express.js Server!</h1>');
});

// Set up the server to listen on port 3000


const port = 3000;
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});

Test It: Run your server by typing:


npm run dev
Now, open your web browser and go to http://localhost:3000. You should see
“Hello, Express.js Server!” on the screen!

You might also like