Day 1 of Spring Boot + React Mastery: Web, APIs & JavaScript Basics Simplified


Author: Ravindranath Porandla

Welcome to Day 1 of my Spring Boot + React Full-Stack Journey πŸš€

In today’s blog, I’ll provide beginner-friendly explanations of the core web concepts every full-stack developer should know. Whether you’re building REST APIs with Spring Boot or using them in React, this foundation is essential.


🌐 How the Web Works

The web operates on a request-response model, where a client (usually a browser) makes requests to a server, which processes and returns a response.

πŸ“ Simple Example:

Ordering food online:

  • You place an order β†’ client sends a request

  • Restaurant confirms & delivers β†’ server sends a response

πŸ’‘ Tip:

Always think of the internet like a conversation β€” the browser speaks first, the server responds.


πŸ§‘β€πŸ’» What is Client-Server?

Client-server architecture separates concerns between front-end (client) and back-end (server). Clients initiate communication and servers provide requested services or data.

πŸ“ Example:

A student (client) asks a teacher (server) for notes. The teacher gives the right material.

πŸ’‘ Tip:

Client = Asks, Server = Answers. They work together.


πŸ”Œ What is an API?

An API (Application Programming Interface) is a set of rules that allow different software systems to communicate and exchange data.

πŸ“ Example:

Think of an API as a waiter:

  • You tell the waiter (API) your order

  • The waiter talks to the kitchen (server)

  • Your food (response) is served

πŸ’‘ Tip:

APIs are the middlemen that connect frontend and backend.


πŸ“₯ HTTP Methods (Types of API Requests)

MethodActionπŸ“ Example
GETReadView order status on app
POSTCreatePlace a new pizza order
PUTUpdateChange your address
DELETERemoveCancel a placed order

πŸ’‘ Tip:

Just remember: CRUD = Create, Read, Update, Delete β†’ POST, GET, PUT, DELETE


πŸ“‘ What is a REST API?

REST (Representational State Transfer) is an architectural style that uses standard HTTP methods to access and manipulate resources. It is stateless and scalable.

πŸ“ Example:

GET /books β†’ list all books
GET /books/1 β†’ book with ID 1
POST /books β†’ create a new book

πŸ’‘ Tip:

REST is like organized shelves in a library β€” you ask for a book using its location.


πŸ” HTTP vs HTTPS

ProtocolSecurity StatusπŸ“ Example
HTTPNot SecureLike shouting a password in public
HTTPSSecure (Encrypted)Like whispering in private

πŸ’‘ Tip:

Always use HTTPS for login, payments, or personal data. It's your online seatbelt.


πŸ”’ HTTP Status Codes

CategoryCode RangeMeaningπŸ“ Example
1XX100–199Informational"Processing your request"
2XX200–299Success"Here's your data!"
3XX300–399Redirection"Page moved"
4XX400–499Client Error"Page not found (404)"
5XX500-599Server Error"Server crashed (500)"

πŸ’‘ Tip:

If you get 404 β†’ You made a mistake. If it’s 500 β†’ Server made the mistake.


πŸ”— URI, URL, URN – What’s the Difference?

πŸ“˜ Definitions:

  • URI: A string that identifies a resource

  • URL: A URI with access method and location (http://)

  • URN: A URI with a resource name (not its location)

TermDescriptionπŸ“ Example
URIGeneric resource ID/api/users/101
URLLocation to access URIhttps://app.com/api/users/101
URNResource name onlyurn:isbn:978-3-16-148410-0

πŸ“ Analogy:

  • URI: A contact in your phone

  • URL: Their full address

  • URN: Their Aadhaar or PAN number

πŸ’‘ Tip:

All URLs and URNs are URIs. An URI can be URN or it can be URL, but not both.


πŸ‘¨β€πŸ’» Setting up React + JavaScript

πŸ“˜ What is JavaScript?

JavaScript is a programming language that runs in browsers and makes websites interactive.

πŸ“ Example:

  • When you click "Add to Cart" and it instantly updates – that's JavaScript

πŸ’‘ Tip:

HTML builds the structure, CSS styles it, and JavaScript brings it to life.


πŸ› οΈ Engines that Run JS

EngineUsed In
V8Chrome, Node.js
SpiderMonkeyFirefox

βš™οΈ JavaScript in Action

Try this in browser console:

console.log("Hello World");
alert("Welcome!");
clear();

🧰 Tools for Frontend Dev

πŸ“˜ Why VS Code?

  • Lightweight, open-source, and highly customizable

  • Preferred by most frontend developers

❌ Why not IntelliJ / PyCharm (Community)?

  • Limited frontend features

  • Slower setup for React/JavaScript


πŸ’» First JS Program

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My First JS</title>
</head>
<body>
  <h1>Hello World!</h1>
</body>
<script>
  console.log("Hello World from JS");
</script>
</html>

πŸ“‚ Structure of a JavaScript File

πŸ“˜ Explanation:

  • JavaScript files contain statements, not HTML tags

  • JS is written inside <script> tags

  • Scripts can be placed in <head> or after <body>.

πŸ“ Difference:

  • If placed in <head>, the script runs before the DOM(Document Object Model, as of now think this a HTML) is loaded, which can cause errors if it tries to access elements that aren’t loaded yet

  • If placed after <body>, it ensures the HTML is fully loaded before JS runs

βœ… Best Practice:

Always place your script just before the closing </html> tag or use defer in <script> tag in <head>

<script src="index.js" defer></script>

πŸ’‘ Tip:

Let HTML load first β†’ then run JavaScript


πŸ”Œ External vs Inline JS

πŸ“˜ Explanation:

  • Inline JS is written directly in HTML

  • External JS is in a .js file and linked via <script src="">

πŸ’‘ Tip:

Keep logic in external files to separate concerns and keep code clean.


πŸ“ JS Comments

// Single-line comment
/* Multi-line comment */
/**
 * Doc-style comment
 * Use jsdoc.app for documentation
 * Refer web to learn more about Doc-style comments
 */

βœ… Summary

Today we covered:

  • How the web works

  • Client-server architecture

  • APIs and REST principles

  • HTTP methods and status codes

  • Differences between URI, URL, and URN

  • JavaScript setup and first steps with React

Stay tuned for Day 2 as we dive deeper into real coding with Spring Boot and build our first RESTful endpoint!

🧠 Follow more at: Ravindranath Porandla Blog

β€” Ravindranath Porandla πŸ§‘β€πŸ’»

11
Subscribe to my newsletter

Read articles from Ravindranath Porandla directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ravindranath Porandla
Ravindranath Porandla