• Artificial Intelligence, Machine Learning, Python, Web Scraping: Feedbacks/Queries - e-contact

Programming for the World Wide Web

Table of Contents

Web Technology -|- PHP |-| Javascript [+] To-Do Application |*| MySQL |-| Mathematical Equations in HTML |=| PowerBI and Pivot Tables |+| Cursor AI {+} Video editing and streaming using OBS Studio [=] PHP vs. JavaScript [/] Web Scraping in Python |:| Job Description Templates |:| Flowchart to create User Interfaces for multiple Standalone Apps |:| Work-flow for International Travels |:| Checklist to Develop a Simple Web App |:| Software Architect |:| DevOps Engineer |:| Example User Stories for a Web App Development Projects

Good Scripting and Programming Practices |:| Testing Methods and Activities


Write Mathematical Equations in HTML Pages

MathJax is JavaScript display engine for mathematics that works in all browsers. MathML is an XML-based language for describing mathematical notation. AsciiMath is an easy-to-write markup language for mathematics. LaTeX and TeX are another notation system for mathematical equations in HTML pages. Some example scripts for MathML is given below. xmlns="http://www.w3.org/1998/Math/MathML" needs to be added to <math> tag.
  • <mfrac><mn>1</mn>mn>2</mn></mfrac> = 12
  • <math><msqrt><mo>(</mo><mfrac><mn>A</mn><mn>B</mn></mfrac><mo>)</mo></msqrt></math> = (AB)
Σn=1+ 1n2 : The html code for above expression is
 <mrow>
  <munderover>
   <mo>&Sigma;</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mrow><mo>+</mo><mn>&infin;</mn>
  </mrow></munderover>
  <mfrac><mn>1</mn><msup><mi>n</mi><mn>2</mn></msup></mfrac>
 </mrow>

f(x) dx : The HTML code is
  <mrow>
    <munderover><mi>&int;</mi><mn>-&pi;</mn><mn>+&pi;</mn></munderover>
    <mrow>
      <mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo> <mi>d</mi><mi>x</mi>
    </mrow>
  </mrow>

Web Technology

Web Technology, Full Stack Developer

Ref: aws.amazon.com/what-is/sdlc - "The software development lifecycle (SDLC) is the cost-effective and time-efficient process that development teams use to design and build high-quality software. The goal of SDLC is to minimize project risks through forward planning so that software meets customer expectations during production and beyond. This methodology outlines a series of steps that divide the software development process into tasks you can assign, complete, and measure."

Software Engineering Concepts, Idioms and Terms

Traditional software is native meaning it is compiled for and installed on a specific operating system like Windows or Linux. Web apps are hosted on a remote server and accessed through the internet. Web App: An application program on a server that is delivered or can be accessed only through browsers. Data Structures: Specialized formats, such as arrays, trees, and hash tables, used to organize, store, and manage data efficiently. Alpha testing: The testing that occurs within a software development team or company. Beta testing: The testing that happens using client or selected end users. Metric: The measure of whether a product feature or task is quantifiable or countable. Archival database: An historical copy of a database saved at a significant point in time for use in recovery or restoration of the database. Bootstrap: A short computer program that is permanently resident or easily loaded into a computer and whose execution brings a larger program, such an operating system or its loader, into memory. Truth table: A table that describes a logic function by listing all possible combinations of input values, and indicating, for each combination, the output value. Code audit, code inspection, code review and code walkthrough: testing and approval steps or process of codes.

A playbook is a standardized, step-by-step guide or blueprint for building, deploying, and/or operating the software. A rollback is the process of reverting an application, database, or system to a previous, stable state. Technical debt refers to the future costs associated with relying on shortcuts or suboptimal decisions made during software development. Refactoring in web app development means restructuring existing code to improve its readability, and maintainability without changing its external behaviour and features. Code smells refer to duplicated code, deep nesting, excessively long functions, long Parameter lists or overly complex logic - though it is not a bug or a syntax error - the app will likely still run and function as intended. Smoke testing is a quick check that confirms whether a new software build works well enough for extensive testing. In the context of AWS web app deployment, artifacts are the compiled code, packages, or configuration files produced during the build process that are then deployed to a runtime environment.

As per article paloaltonetworks.com/cyberpedia/sandboxing: "Sandboxing is a security control that isolates the execution of untrusted or potentially malicious code in a tightly controlled environment. It allows systems to evaluate, test, or execute files, scripts, or processes without exposing the host or network to compromise. The core principle is containment: any process running in the sandbox can’t interact with the underlying system or escape its designated boundaries. In cloud-native environments, sandboxing is not a security afterthought — it is foundational. Sandboxing provides the execution boundaries necessary to run untrusted or partially trusted code without compromising adjacent systems or infrastructure."

Monolithic architecture is a single, unified unit, making it ideal for small, simple applications with fast initial development. Microservices consist of small, independent services, offering high scalability, agility, and flexibility for complex, large-scale applications.


This article "aws.amazon.com/compare/the-difference-between-frontend-and-backend" gives good explanation about front-end and back-end technology.
Front-EndBack-endFull Stack
Topic dealing with user interface, what the end user see and interact with Deals with methods required to create, maintain and provide data needed for Front End Deals with both Front End and the Back End technologies
Mainly programmed in HTML, CSS, JavaScript, PHPDeals with databases and server-side scripting: PHP, ASPX, SQL, JSON, Angular, ReactJS In addition to Front End and Back-end, the developers have to deal with servers (ports, networks, web-hosting), data security and database management. MongoDB, NodeJS, PHP, Python

Reference figma.com/resource-library/what-is-wireframing: "Wireframe is the skeleton of your app, website, or other final product. Your wireframe shows the design team and stakeholders the bare-bones outlines of essential webpages, components, and features, including Screen layouts, Navigation bars, Components of UX and UI design and Interactive elements."

The wireframe can be just hand drawn or real-looking drawings created using Figma, Visily or many other drag and drop builders.

Output-from-UI-Designer

A UI designer creates static screens that represent the final look of the web application such as screen layouts, exact typography (font pairings, sizing, and line heights), colour palettes, iconography, and spacing. Iconography: Defines style for icons (e.g. flat or line art) and image guidelines. Layout / Grid System: Specifies the grid (typically a 12-column grid for web apps) and spacing/gutter rules. A sample UI Design Style Guide is attached here. Visual hierarchy in UI design is the strategy about design of elements such that users easily recognize their order of importance. Whitespace is part of visual hierarchy used to prevents cognitive overload, and improves readability.

Interview questions for UI designers:

  • How do you gather user requirements before starting a design?
  • What factors do you consider when selecting a color palette?
  • How do you design for different screen sizes?
  • What deliverables do you typically produce?
  • How do you document design decisions and hand off designs to developers?
  • How would you design role-based interfaces for different user types?
  • Which component libraries have you used?
  • How do you design for keyboard navigation?
  • How do you estimate design effort for a sprint?
  • What elements make an effective navigation system?

A simple approach could be to use PowerPoint with standard shapes which can be moved easily.

Web-UI-Wireframe

As per figma.com/resource-library/what-is-a-sequence-diagram: "A sequence diagram is a type of UML (Unified Modeling Language) diagram that maps out how users and systems interact over time. It is commonly used in interaction design and human-computer interaction studies to show what happens, when, and between which parts of a system."

Sequence-Diagram Example

As per developer.ibm.com/articles/the-sequence-diagram: "One of the primary uses of sequence diagrams is in the transition from requirements expressed as use cases to the next and more formal level of refinement. Use cases are often refined into one or more sequence diagrams."

UI-Mockup-Wireframe

Inputs Required

Input TypeDescription / What to CollectExample Artefacts
Project ObjectivesDefine the purpose and expected outcomesIncrease visitors, automate workflows
Stakeholder ListIdentify decision-makers, reviewers, and usersProduct owner, IT admin, End-users
User PersonasUnderstand user demographics, and needsPersona documents, empathy maps
Feature ListDefine core and optional featuresLogin, dashboard, reports, charts, user guides
User Stories / Use CasesDescribe user interactions with the systemUser can upload files, delete tasks
Device and Browser TargetsDefine supported devices and browsersChrome, Safari, mobile/tablet
Brand GuidelinesCollect visual identity assets and standardsLogos, colors, typography
Content InventoryGather required text, media, and documentsProduct descriptions, images
Accessibility StandardsDefine accessibility expectationsKeyboard navigation, colour-blindness support
Breakpoint RequirementsSpecify layouts for different screen sizesDesktop, tablet, mobile wireframes
Language / Regional NeedsDetermine multilingual or regional supportEnglish + Hindi support
Scalability ConsiderationsCapture future enhancements that may affect designMulti-tenant support, AI features

Typical Output

Output TypeDescription / What is generatedExamples Artefacts
Low-fidelity wireframes: Sitemap / Navigation StructureDefine page hierarchy and navigation flowSitemap diagrams
High-fidelity mock-ups: Workflow DefinitionsMap how users complete tasksLogin/onboarding flow, task creation
Design system / UI kit: Screen InventoryList all screens/pages to be designedHome, profile, settings, admin panel
Responsive layouts: UI Behaviour DetailsDefine animations, transitions, and interactionsHover states, modal behaviour

Summary of Technology Stacks

Node.js is a free, open-source, cross-platform asynchronous event-driven JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts. It is not a programming language or a framework. Node.js uses an event-driven architecture that can handle multiple tasks simultaneously without waiting for one to finish before starting the next. In other words, Node.js as an event-driven architecture handles multiple tasks (like reading files or network requests) at the same time without waiting for one to finish before starting the next. This makes it very efficient for data-intensive tasks. Angular uses TypeScript, a superset of JavaScript, as its primary language and contains a large suite of libraries to build full applications.

As per coursera.org/articles/angular-vs-react: "Angular is a comprehensive front-end framework for web applications, while React is a library that allows you to build interactive user interface (UI) components. Both use a component-based architecture, with self-contained, reusable pieces. React mainly deals with UI and client-side development. It is more lightweight and needs other frameworks for an application to complete functions like server-side rendering or data fetching. Angular comes with more pre-built functions, allowing a more structured framework to complete heavier and often more stable development projects."

While JavaScript was originally designed to run only in browsers (the 'client-side'), Node.js allows it to run on servers, making it possible to build full-stack applications using a single programming language. It is built on V8 JavaScript engine of Google Chrome, which compiles code directly into fast machine code.

REST stands for REpresentational State Transfer. It is a type of API (Application Programming Interface) that allows communication between different systems over the internet by sending requests and receiving responses typically in JSON format, between the client (user interface) and server (data and business logic). It is an architectural style for designing networked applications and uses standard HTTP methods (GET, POST, PUT, DELETE) to manipulate resources. REST APIs are stateless, meaning each request contains all the information needed to process it.

Django is a Full-stack web development framework that facilitates the creation and maintenance of high-quality dynamic pages and makes it easier to automate repeated operations. Middleware in the back-end is a software layer—often called "glue code" — that sits between the front-end (user interface) and back-end logic (database/server). Key examples include authentication, logging, data validation, and caching.

Containerization is a form of operating system virtualization where an application and all its necessary files (libraries, configuration files, and dependencies) are bundled together into a single, isolated, and executable unit called a container. Docker is a popular open-source platform used to create, deploy, and manage these containerized applications. Thus, Docker acts as an operating system for containers.


Some roles in Software Development

Back-End Developers create server-side logic, database management, and API integration, ensuring security and functionality using languages like PHP, Python, Java, or Node.js. Web Designers focus on the visual aspects, layout, and usability of the website, often handling graphic design and UI/UX elements.

As per aws.amazon.com/what-is/architecture-diagramming: "Architecture diagramming is the process of creating visual representations of software system components. In a software system, the term architecture refers to various functions, their implementations, and their interactions with each other. As software is inherently abstract, architecture diagrams visually illustrate the various data movements within the system. They also highlight how the software interacts with the environment around it."


Software Architect

For this role deep, hands-on coding in React.js and Node.js is not strictly necessary yet understanding their architectural patterns, ecosystems, and limitations is highly beneficial. Knowing React helps communicate effectively with frontend engineers, understand their constraints, and make realistic technology decisions. Software architects are senior developers or programmers with degree in either of "computer science or information systems or software engineering" who formulate the high-level structure of a software, manages technical teams, and enforces coding standards for software development projects.

Interview questions for Software Architects:

  • When would you choose a monolithic architecture over micro-services, and vice versa?
  • How do you decide database for a system say between SQL, NoSQL, MongoDB?
  • How involved should a Software Architect be in code generation, debugging and change management?
  • How would you architect a system for wind farm analytics that ingests real-time turbine data and provides predictive insights?
  • How do you design systems to handle large-scale data processing?
  • What trade-offs are required to design a system optimized for average load and that of peak load?
  • How do you handle authentication and authorization in a web app?
  • Tell me about a bug you faced recently and how you resolved it.
  • What inputs are required to design the dashboard and layout of a scalable and cross-browser compliant website?
  • How do you decide which method to chose: functional programming or object-oriented?
  • Explain us the methodology of front-end, back-end, database, and deployment through a real project you were part of?
  • How would you scale a system from just few users to 10,000 users?
  • What are common security risks in web applications and how do you prevent them?
  • How do you ensure long-term code quality in a fast-moving team due to both the rotations in different projects and attrition?
  • What coding standards (guidelines) did you follow in past projects?
  • How would you design a Continuous Integration / Continuous Delivery (Deployment) or CI/CD pipeline for a full-stack app?
  • Which AI/ML based tools and platforms have you used for code generation and debugging?
An architecture diagram is a visual representation of a system that shows its major components, how they interact, and how data flows between them. It helps understand the system design at a high level. Typical elements of an Architecture Diagram are System Components, Actors (Users, Admins, External Systems), Infrastructure, Data Stores, Communication and Integration (such as REST APIs and WebsSockets), Data Flow and Network Boundaries. For a React + Node.js web application, a good architecture diagram typically includes users, frontend, back-end services, databases, authentication, external integrations, deployment infrastructure, and data flows.

Web-App-Arch-Pattern

Many a time architecture diagram and High Level Design (HLD) are used interchangeably though they are not same. Architecture Diagram answers "What major systems exist and how they connect?" High-Level Design answers "How the application is organized and works internally?"

Architecture Diagram (Structural   |     High Level Design (Functional
````````````````````  Blueprint)   |     `````````````````  Blueprint)
Users                              |     User Management Module
  !                                |        !
Load Balancer                      |     Project Management Module
  !                                |        !
Web Server (React)                 |     Input Forms Module
  !                                |        !
API Gateway                        |     File Upload Module
  !                                |        !
Node.js (Backend)                  |     Dashboard Module
  !                                |        !
,---------------------,            |     Reporting Module
!                     !            |        !
Database         File Storage      |     Review Module
(PostgreSQL)      (AWS S3)         |        !
!                                  |     User Guide Module
External Services                  |        !
(Payment, Email)                   |     Tech Support Module

Low-Level Design (LLD) diagram describes implementation details of a single component whereas architecture diagram represents the macro-level representation of the entire web application. Architecture diagram represents the design of a multi-storied building, while the LLD diagram is the detailed blueprint for the electrical wiring and plumbings inside a single floor. Architecture diagram is used by Business Analysts and Product Managers whereas LLD is used by developers and QA engineers.

Choosing between centralized data storage and domain-specific databases, team structure, deployment pipelines, and ownership boundaries are activities under the HLD umbrella. Low-level design defines how a service validates input, interacts with its database, and what caching strategies to follow.

A cloud server is a virtualized server that runs in the cloud on infrastructure owned by a cloud service provider. A serverless architecture is a way to build and run applications and services without having to manage infrastructure. Your application still runs on servers, but all the server management is done by AWS. You no longer have to provision, scale, and maintain servers to run your applications, databases, and storage systems.

Swimlane Diagram: A type of flow chart which map out the entire process of creating a website, illustrating the sequential tasks and responsibilities of different teams involved.

Swimlane Diagram

A Mermaid diagram is a visual chart or diagram generated entirely from plain text. It is a JavaScript based diagramming and charting tool that uses Markdown-inspired text definitions and a renderer to create and modify complex diagrams. Instead of manually dragging and dropping shapes in a visual editor, you simply type the code, and a text editor or platform automatically renders it into a polished graphic.


Some of the questions to evaluate Software Architects on judgment, trade-offs, leadership, and real-world decision-making are listed below. The questions are intended to probe how they think under ambiguity and influence systems and people.
  • How do you approach designing of a system from vague or high-level programming?
  • How do you prevent over-engineering in architecture?
  • How do you design cloud-native systems?
  • How do you document and communicate architectural decisions?
  • How do you ensure architectural consistency across teams and projects?
  • How do you validate that an architecture actually works in production?
  • How do you evaluate build vs buy?
  • What are common vulnerabilities you encounter very often?
  • How do you ensure engineering teams follow architectural guidelines?
  • How do you communicate trade-offs to non-technical stakeholders?
Roles / Task performed by a Software Architect ↴

Flowchart-Sw-Architect

Sample Architecture Diagram for Deployment of a Web App on AWS ↴ is shown below. There are different types of architecture diagrams such as Application Architecture, Data Architecture Deployment Architecture, and Security Architecture.

Arch-Diagram-AWS

A logic diagram for a web application focuses on how the application works, without considering where it is deployed. It describes the business processes, user interactions, decision points, and data flow between components. A logic diagram answers the question: "What happens step-by-step when a user performs an action?" while an architecture diagram answers "What components make up the system and how are they connected?". A physical diagram (often called a deployment diagram) for a web app maps the software to the actual hardware. A logic diagram answers the question: "What does the system do?" while an architecture diagram answers "How is the system built?". A logical diagram is often created before an architecture diagram.

Web-Logic-Diagram

While a logical architecture focuses on what the application does, a physical diagram is essential for DevOps and IT teams to understand system capacity, scaling limitations, security vulnerabilities, and failover redundancies.

Web App Physical-Diagram

An interface is the point where a user or another system interacts with the application. There are mainly two types: User Interface (UI) - This is what users see and interact with, System Interface (API Interface) - This is how systems communicate with each other. Integration means connecting the web app with other systems, tools, or services so data and functionality can flow between them. Common Web App Integrations: Authentication Integration such as SSO, Cloud Storage Integration which connect with AWS S3, Reporting / Analytics Integration which may connect with Power BI / Tableau, External Tool Integration such as CAD software and Optimization engine.

Interface-Integration Diagram

Key responsibilities of an architect include selecting "technology stacks, appropriate frameworks, tools, and databases" to meet technical needs. Guide developers, conduct code and architecture reviews in order to ensure the final product meets established standards. Remain engaged in every step of the software development life cycle (SDLC) and performs regular code inspections to ensure the product meets quality standards within planned cost and schedule. High-Level Design (HLD): Defines system architecture, technology stack, database design, and major modules. Low-Level Design (LLD): Specifies component logic, APIs, data structures, and workflows. Reference architecture diagrams published by AWS is attached here.


Other roles include Solution architects, Enterprise architects, Data architects and Cloud architects. Front-End Developers create the user-facing, interactive, and visual elements of websites and applications using HTML, CSS, and JavaScript. They collaborate with designers and back-end engineers to ensure responsive, accessible, and high-performance interfaces utilizing modern frameworks like Bootstrap, React, Angular, or Vue. Write clean, maintainable, and well-documented code, integrate APIs and maintain web standards. Require to have basic graphic design skills such as Photoshop, Figma, or Sketch.

Job titles are based on overall relevant experience as well as size of the company: Junior Developer is designation for entry-level (0 ~ 3 years experience), Mid-Level Developer is used for practitioner level developers (2 ~ 5 years), Senior Developer (5 ~ 10 years) designation is given to those with high-level of expertise, mentoring, and architectural decisions - multitasking programmers who master many programming and scripting languages and familiar with Content Management Systems (CMS). Lead Developer / Architect (> 10 years) are responsible for the entire team or technical direction - convert the customer’s requirements into technical requirements.

AspectSoftware ArchitectFull-Stack DeveloperDevOps Engineer
Primary FocusSystem design and technical strategyBuilding application features end-to-endInfrastructure, automation, deployment, reliability
Main GoalCreate scalable, maintainable architectureDeliver functional software productsEnsure smooth CI/CD and operational stability
ScopeEnterprise/system-wideApplication/module-levelInfrastructure and deployment ecosystem
Works Closely WithBusiness leaders, engineering teams, product managersUI/UX, backend teams, QADevelopers, QA, cloud/platform teams
Key DeliverablesArchitecture diagrams, tech standards, solution designFrontend + backend codePipelines, cloud infrastructure, monitoring
Integrated development environments (IDE), such as GitHub or AWS CodeCommit, help developers create, maintain and track software packages. The most common open source CI/CD tool is Jenkins. DevSecOps practices include shift-left and shift-right testing. Shift-left testing involves integrating security testing and other critical development practices earlier in the software development lifecycle (SDLC). Shift-right security testing involves testing later in development, usually in production environments.

Few questions related to Full-stack developers.

  • What is the difference between GET and POST requests?
  • What are the advantages of using a framework like React, Angular, or Vue instead of using vanilla JavaScript?
  • What are the differences between client-side and server-side programming?
  • What is event bubbling and capturing in JavaScript?

Low-Level Design Diagram

Cross-browser compatibility: this is not a matter of testing task - it is a development discipline. Use web standard and not the browser specific features. Use feature detection and not browser detection. If workarounds are avoidable, isolate the browser specific fixes and comment clearly why the fix exists. Playwright: A fast, modern browser-automation library built for cross-browser visual and functional end-to-end checks.

Tasks performed by Full-stack Developers ↴

Flowchart-Full-Stack

Inputs required by Back-end Developers: An Entity-Relationship Diagram (ER Diagram or ERD) is a structural blueprint and visual flowchart used in database design to show how different data points, objects, or concepts relate to one another within a relational database.
Input RequiredDescription / What Backend Developers NeedExample Artefacts
Functional RequirementsCore application behavior and rulesPRD, user stories
Access / Permission MatrixDefine user types and allowed actionsAdmin vs customer permissions
Auth MechanismLogin, session, token, SSO requirementsJWT, OAuth2, SAML
Third-Party ServicesExternal APIs and service dependenciesPayment gateway, CRM APIs
Storage RequirementsDatabase types and file storage needsPostgreSQL, MongoDB, S3
Async Processing NeedsScheduled jobs and queue processingSLURM
Analytics & Reporting NeedsDashboard and export requirementsCSV/PDF exports
Upload/Download RequirementsFile handling constraints and limitsImage / PDF / CSV service

Security Architecture for Web App Deployment on AWS

Security-Architecture

The dictionary meaning of SCHEMA is a diagrammatic presentation (a drawing that represents an idea or theory and makes it easier to understand). A database schema is the structural framework or blueprint that defines how data is organized, how tables relate to one another, and what rules apply to the data.

DB-Schema Example


DevOps Engineer

As per learn.microsoft.com/en-us/devops/what-is-devops: "DevOps combines development (Dev) and operations (Ops) to unite people, process, and technology in application planning, development, delivery, and operations. Continuous Integration (CI) is the practice used by development teams to automate, merge, and test code. Continuous Delivery (CD) is a process by which code is built, tested, and deployed to one or more test and production environments."

Dev refers to the software development side: Writing code (features, bug fixes), Designing applications and APIs, Running unit tests, Building new releases. Ops refers to the IT operations and infrastructure side: Deploying applications to servers/cloud, Managing infrastructure (servers, containers, networks), Monitoring system health and uptime, Handling incidents and outages. DevOps is about bridging the gap between Dev and Ops so both work as one team instead of silos. Dev ≡ designing and building the car. Ops ≡ driving, maintaining, and fixing issues on the road. SonarQube is a DevOps tool that facilitates the static code analysis process.
  • What checks do you enforce before production deploys?
  • How do you design systems to be fault-tolerant?
  • How do you secure a CI/CD pipeline?
  • How do you manage multi-cluster deployments?
  • How do you enforce standards without slowing teams down?

Tasks performed by DevOps Engineers ↴

DevOps-Flowchart

Infrastructure: The underlying technical resources and platform components which focuses on hardware, cloud resources, networking, storage, compute. The foundational cloud resources EC2 instances, RDS databases, S3 buckets, IAM roles, EKS/ECS clusters and CloudFront CDN. Environment: A configured instance of the application setup used for a specific purpose which focuses on application lifecycle stage and configuration. Common environments on AWS are: Development (Dev) - Used by developers, Testing / QA - Used for functional testing, UAT - User acceptance testing, Staging - Mirrors production before release, Production (Prod) - Live customer-facing system. Each environment may use different databases, scaling settings, secrets / configurations and application versions.

Activities of CI/CD Pipeline on AWS ↴

CI-CD-Pipeline

DevOps Artifacts: These are referenced in a pipeline stage for automated deployment to the target environment. They are used to specify software package versions for deployment. They can be a container image, a generic artifact, helm chart, or they can be defined inline. The artifact source varies depending on the type of artifact.

Environment of CI/CD Pipeline on AWS ↴

CI-CD-AWS-Environment

Typical AWS Architecture Components

AWS-Code-Cycle

AWS-System-Flow


Testing Methods and Activities

Testing-flowchart

Testing Pyramid: Unit Tests (Catch logic bugs early) > Integration Tests (Ensure components work together) > End-to-End (E2E) Tests (Validate business-critical logics or flows). Regression tests (Prevent old bugs). Cross-Browser and Device Testing: BrowserStack, LambdaTest. Performance Testing (Ensure scalability under load): JMeter, Lighthouse.

Code Testing Activities and Environment on AWS ↴

Code-Testing-AWS

Unit testing is the process where the smallest functional unit of code is tested. In a web app, a unit is a specific function like a "file upload" and a data validation method like "checking password strength". It is not required to write explicit, fully customized unit tests for every single block of code. There are automated testing frameworks for every popular programming language. Integration testing checks that different parts of the software system that are designed to interact do so correctly. Acceptance testing is when the software is tested manually by stakeholders or user groups to check whether it is working as they anticipate. Smoke Testing is known as Build Verification Testing which acts as a gatekeeper in the development pipeline: if the build passes, it is moved to further functional or regression testing. If it fails, the build is sent back to the developers.

Excerpts from AWS website: "Smoke testing is a subset of testing that validates the most critical functions of an application work correctly after deployment. These tests focus on key workflows like user login, core navigation, and key transactions rather than exhaustive feature coverage. Smoke tests typically complete in minutes rather than hours, making them ideal for CI/CD pipelines where fast feedback on code changes is essential."

aws.amazon.com/what-is/continuous-testing: "Continuous testing is the process of testing your application at every stage of the software development process and every time that changes are made to application code or configurations. Continuous testing integrates testing in every stage of the software delivery pipeline to catch bugs early and maintain software quality. Software tests are maintained as code alongside the application code and frequently run as part of the continuous testing paradigm."

Static testing is a proactive method of assessing the quality of code without needing to run it. It can be used to test application source code, as well as other design artefacts, documentation, and infrastructure as code (IaC) files. Static testing allows teams to spot misconfigurations, security vulnerabilities, or non-compliance with organizational standards in these components before they get applied in a real environment.

User Acceptance Testing (UAT) is the final phase of testing in web application development where actual business users ( Product Owners, Subject Matter Experts, Customer representatives) and end users verify that the application meets their requirements and is ready for production use. Unlike technical testing (unit testing, integration testing, system testing), UAT focuses on business functionality and user workflows. It serves as the formal approval before the application can go live.

Test coverage is a software quality metric that measures how much of your application's code or functionality is exercised by automated tests. Coverage (%) = Total Testable Items / Items Tested * 100. Line Coverage = Percentage of code lines executed during tests, Statement Coverage = Percentage of executable statements tested, Branch Coverage = Percentage of decision paths (if/else, switch cases) tested and Function Coverage = Percentage of functions/methods called by tests.

Responsibilities of Software Test Engineers ↴

Functional Testing: Understand business and technical requirements. Create test scenarios, test cases, and test data. Execute manual and automated test cases. Functional testing checks whether the software system passes the software requirements outlined before building.

Bug / Defect Management: Identify, log, track, and retest software defects. Work with development teams to resolve issues. Perform root cause analysis for recurring defects.

Automation Testing: Develop and maintain automation scripts. Execute regression and smoke test suites. Improve test coverage using automation tools

Test Planning and Documentation: Prepare test plans and testing strategies. Document test results and quality metrics. Maintain QA documentation and reports.

QA Testing Output Summary Table ↴ is summarize below. A sample list of tests to be conducted on a web app can be found in this Excel file.

Test CategoryTotal Test CasesPassedFailedBlocked*Pass Rate
Functional Testing15141093.3%
UI/UX Testing12111091.7%
API Testing25205280.0%
Security Testing16124075.0%
Performance Testing20164180.0%
Compatibility Testing11101090.9%
Regression Testing22202090.9%
User Acceptance Testing14122085.7%
* Blocked status in QA testing indicates that a test case cannot be executed or completed because of an external dependency or prior blocking issue.

Compatibility Testing Output Summary ↴

Browsers TestedOS TestedScreen ResolutionResults / Observation
Chrome 144.0, FireFox 136.0, Edge, SafariWindow 11, Ubuntu 24.06, iOSLaptops and Desktops screen size 13", 15" and 24"Application compatible across all major browsers and platforms, no major UI rendering issue observed.

Web Application QA Test Case Table ↴ should be aligned to RTM (Requirement Traceability Matrix), this is sometime also known as Technical Testing. BR = Business Requirement, FR = Functional Requirement. Ensure that each FR has a corresponding development (dev) task and at least one test case. Ensure each feature maps to a deployable AWS/Azure component.

Test Case IDModule / FeatureTest ScenarioPreconditionsTest StepsExpected ResultStatusTester NameTest Date
TC-LOG-001AuthenticationVerify login with valid credentialsUser account existsEnter valid username / pw > Click LoginUser successfully logs inPass
TC-LOG-002AuthenticationVerify login with invalid passwordUser account existsEnter valid username & invalid pw > LoginError message displayedPass
TC-LOG-003AuthenticationVerify empty login fields validationLogin page accessibleLeave username or pw blank > LoginField validation message displayedPass
TC-REG-001RegistrationVerify new user registrationRegistration page accessibleEnter valid user details > SubmitAccount created successfullyPass
TC-REG-002RegistrationVerify duplicate email validationExisting email availableEnter registered email > SubmitDuplicate email error displayedFail
TC-FGT-001Password ResetVerify forgot pw functionalityRegistered email existsClick Forgot Password > Enter email > SubmitReset link sent to registered emailPass
TC-DSH-001DashboardVerify dashboard loads after loginValid login completedLogin successfullyDashboard page displayed correctlyPass
TC-PRF-001User ProfileVerify profile updateUser logged inOpen profile page > Update profile > SaveProfile updated successfullyPass
TC-PRF-002User ProfileVerify profile picture uploadUser logged inUpload valid image file > SavePicture uploaded successfullyPass
TC-DAT-001Data ManagementVerify create record operationUser has create permission Open create form > Enter valid data > SaveNew record created successfullyPass
TC-DAT-002Data ManagementVerify update record operationExisting record availableEdit existing record > Save changesRecord updated successfullyPass
TC-DAT-003Data ManagementVerify delete record operationExisting record available Select record > Click Delete > ConfirmRecord deleted successfullyPass
TC-API-001APIVerify API response status codeAPI endpoint availableSend GET request to APIStatus code 200 returnedPass
TC-API-002APIUnauthorized accessNo authentication tokenAccess secured API without tokenStatus code 401 returnedPass
TC-SEC-001SecurityVerify SQL Injection protectionLogin form accessibleEnter SQL query in input field > SubmitApplication rejects malicious inputPass
TC-SEC-002SecurityVerify XSS protectionForm input field availableEnter script tag in text field > SubmitScript execution blockedPass
TC-PRF-001PerformanceVerify application under heavy trafficPerformance env. configuredSimulate concurrent usersApplication remains stablePass
TC-CMP-001CompatibilityVerify application on ChromeChrome installedOpen application in ChromeUI and functionality work correctlyPass
TC-CMP-002CompatibilityVerify application on mobile deviceMobile device availableOpen application on mobile browserResponsive layout displayed correctlyPass
TC-LOG-001AuthenticationVerify logout functionalityUser logged inClick LogoutSession terminated successfullyFail

The test case column can be shortened by removing "Module / Feature" column as it is already built into the test case ID. Test cases for a dashboard module can be as shown below.

Test Case IDTest ScenarioPreconditionsExpected Result
TC-DSH-001Dashboard page loads successfullyUser logged inDashboard loads without errors within specified response time
TC-DSH-002Role-based dashboard accessUsers with Admin, Manager, and User roles existEach role sees only authorized dashboard sections and widgets
TC-DSH-003Verify dashboard widgets display correctlyDashboard configured with widgetsAll configured widgets display correctly with proper labels
TC-DSH-004Verify dashboard data accuracyDashboard connected to backend databaseValues match backend data
TC-DSH-005Verify charts and graphs render correctlyDashboard contains chartsCharts render correctly with accurate labels, legends, and values
TC-DSH-006Verify dashboard refresh functionalityDashboard contains dynamic dataLatest data displayed without page errors
TC-DSH-007Verify filtering optionsFilters availableData updates according to selected filter criteria
TC-DSH-008Verify breadcrumb navigationBreadcrumbs availableBreadcrumb path displayed correctly and links work
TC-DSH-009Verify sorting of dashboard dataSortable tables availableData sorted ascending/descending correctly
TC-DSH-010Verify responsive designApplication deployedLayout adjusts correctly without overlapping components
TC-DSH-011Verify dashboard loading performanceProduction-like environmentDashboard loads within SLA (e.g. < 5 seconds)
TC-DSH-012Verify export functionalityExport feature enabledFile generated successfully with accurate data
TC-DSH-013Verify error handling when data source unavailableAbility to simulate back-end outageUser-friendly error message displayed; application remains stable

Flowchart to identify Code Smells in a Web App Development project ↴

Code Smells

Final QA Sign-off ↴

ItemStatusReviewed ByApproved By
Functional ReadinessApprovedABCXYZ
Security ReadinessApproved with observationsABCXYZ
Performance ReadinessApproved with observationsABCXYZ
Production Deployment RecommendationYes, post-deployment smoke testingPQRLMN
User Training, Knowledge TransferCompletedPQRLMN
User and Coding DocumentationCompletedPQRLMN
Support Period3 monthsUVWEFG
Warranty Period6 monthsUVWRST
Agile/Scrum Project ClosureYesUVWRST
Go-Live Sign-offYesUVWRST

List of Phase-wise Handover Documents can be found in this file..


Agile Development Hierarchy

It is typically structured as Initiatives > Epics > User Stories > Tasks. Functional Team Structure: Product Owner (Defines the product vision, manages the backlog, and prioritizes work) > Scrum Master (Facilitates processes, removes impediments, and ensures Agile practices are followed) > Development Team (Cross-functional members namely designers, engineers, testers who build the product).

Product Manager: decides what product to build and why (strategy). Product Owner: ensures it gets built correctly (execution). Analogy: Product Manager ≡ Architect (designs the building), Product Owner ≡ Site Manager (ensures it is built correctly).

Comparative Flowchart for Waterfall vs Agile Approach for Web App Development ↴. An example scrum sprint can be found here.

Waterfall-vs-Agile

Scrum-Roles-Resp


Job Description Templates

Refer to this page for information to be put in a job description. The behavioural aspects of a candidate can be assessed though these questions. Use this page to create Job Description and save in CSV format. An spreadsheet template with appropriate drop-downs to create a summary of JD for hiring new members can be downloaded from here. It contains defined names for drop-downs in a separate sheet which can be updated / edited as per one's needs.

Click the tabs below to get sample job descriptions.

×
Job TitleSoftware ArchitectJob TypeFull-time
Cost CenterCC01Section NameSH01
Job CodeCC01_SH01_SAReports ToDelivery Head
Work LocationPatnaNumber of Openings2
Minimum Experience (years)5.0Maximum Experience (years)8.0
Education QualificationB. Tech.Engineering DisciplineComputer Science
Description of roleMake high-level design choices, set technical standards, present technical concepts, and define the overall structure of software systems. Act as a bridge between business requirements and technical solutions by deciding on tools, platforms, and architecture to ensure expected performance
ResponsibilitiesCreate the outline for software defining components, interfaces, and their interactions. Selecting tech stacks, define coding standards, and address non-functional requirements like security and performance. Mentor developers and conduct code reviews to ensure the architectural decisions are implemented. Identify potential technical issues early and plan mitigations.
Technical Skills Required with % weight(a) Experience in React front end programming - 25%, (b) Knowledge of concurrent execution, distributed computing and parallel processing - 25%, (c) Cloud-Native Architecture - 25% and (d) Security best practices - 25%
Domain Skills Required with % weight(i) Software development lifecycle (SDLC) - 25%, (ii) Knowledge of UI/UX principles - 25%, (iii) Expertise in system design and cloud platforms with strong coding and problem-solving skills - 50%
Communication and Office suites or Productivity softwareExtensive experience in preparing business proposal using MS-Word or LibreOffice Write with knowledge of advance formatting features, Hand-on experience in preparing high quality engaging presentations using MS PowerPoint or LibreOffice Impress, Know-how about advanced features in MS-Excel or LibreOffice Calc such as Filtering, Pivot Tables, Conditional Formatting, Data Validation and Scientific Charting
Keywords and Tool NamesSoftware Architecture, Python, React.js, Node.js, Automation Scripting, REST API, CI/CD - Jenkins, Flask, SQL, AWS hosting, Kubernetes/Docker, JIRA, SCRUM
×
Job TitleFull Stack DeveloperJob TypeFull-time
Cost CenterCC01Section NameSH02
Job CodeCC01_SH02_FSReports ToDelivery Head
Work LocationPatnaNumber of Openings3
Minimum Experience (years)6.0Maximum Experience (years)9.0
Education QualificationB. Tech.Engineering DisciplineComputer Science
Description of roleSoftware engineer proficient in both front-end (client-side) and back-end (server-side) development, managing the entire application lifecycle from user interface design to database management, APIs, and server configuration
ResponsibilitiesCreate user-friendly and responsive interfaces using HTML, CSS, and JavaScript frameworks. Write server-side logic, maintain application performance, and build robust APIs using languages like Node.js. Database Management: Designing, developing, and managing databases (SQL or NoSQL) to store and retrieve data efficiently. API Integration: Develop and integrate third-party services and APIs to enhance functionality. Collaborate with product managers, business analysts, and other stakeholders to gather requirements and translate them into technical specifications. erform unit testing, debugging, and troubleshooting to identify and resolve software defects and performance bottlenecks.
Technical Skills Required with % weight(a) Understanding of front-end frameworks, with a primary emphasis on React.js and knowledge of other libraries or frameworks such as Bootstrap, jQuery - 40%, (b) Familiarity with back-end frameworks and libraries, notably Node.js - 40%, (c) Experience deploying and managing applications using AWS Lambda and related server-less tools - 20%
Domain Skills Required with % weight(i) Software development lifecycle (SDLC) - 25%, (ii) Knowledge of UI/UX principles - 25%, (iii) Expertise in system design and cloud platforms with strong coding and problem-solving skills - 50%
Communication and Office suites or Productivity softwareExtensive experience in preparing business proposal using MS-Word or LibreOffice Write with knowledge of advance formatting features, Hand-on experience in preparing high quality engaging presentations using MS PowerPoint or LibreOffice Impress, Know-how about advanced features in MS-Excel or LibreOffice Calc such as Filtering, Pivot Tables, Conditional Formatting, Data Validation and Scientific Charting
Keywords and Tool NamesJavaScript (React.js, Node.js), Python, Java, PHP, HTML/CSS, MySQL, MongoDB, PostgreSQL, JIRA, SCRUM
×
Job TitleDevOps EngineerJob TypeFull-time
Cost CenterCC02Section NameSH03
Job CodeCC02_SH03_DOReports ToDelivery Head
Work LocationNoidaNumber of Openings1
Minimum Experience (years)5.0Maximum Experience (years)8.0
Education QualificationB. Tech.Engineering DisciplineComputer Science
Description of roleDevOps Engineer acts as a bridge between software development and IT operations to automate, streamline, and optimize software delivery.
ResponsibilitiesCreate the outline for software defining components, interfaces, and their interactions. Selecting tech stacks, define coding standards, and address non-functional requirements like security and performance. Mentor developers and conduct code reviews to ensure the architectural decisions are implemented. Identify potential technical issues early and plan mitigations.
Technical Skills Required with % weight(a) Experience with cloud platforms (AWS) - 25%, (b) CI/CD tools (Jenkins, GitHub Actions) - 25%, (c) Containerization (Docker, Kubernetes) - 25% and (d) Security best practices - 25%
Domain Skills Required with % weight(i) Software development lifecycle (SDLC) - 25%, (ii) Understanding of basic networking concepts - 25%, (iii) Familiarity with monitoring and logging tools - 25%, (iv) Web and Internet Technologies - 10%, (v) Experience with installing, configuring, and maintaining local services (daemons) - 15%
Communication and Office suites or Productivity softwareExtensive experience in preparing business proposal using MS-Word or LibreOffice Write with knowledge of advance formatting features, Hand-on experience in preparing high quality engaging presentations using MS PowerPoint or LibreOffice Impress, Know-how about advanced features in MS-Excel or LibreOffice Calc such as Filtering, Pivot Tables, Conditional Formatting, Data Validation and Scientific Charting
Keywords and Tool NamesPython, Automation Scripting, CI/CD - Jenkins, Flask, SQL, AWS hosting, Kubernetes/Docker, Linux/Bash, PowerShell, JIRA, SCRUM
×
Job TitleData ScientistJob TypeFull-time
Cost CenterCC03Section NameSH05
Job CodeCC03_SH05_DSReports ToDelivery Head
Work LocationGurgaonNumber of Openings2
Minimum Experience (years)5.0Maximum Experience (years)8.0
Education QualificationM. Sc.Engineering DisciplineApplied Maths
Description of roleAnalyse complex, structured, and unstructured data to extract actionable insights, building predictive models and machine learning algorithms to solve business problems.
ResponsibilitiesCollecting, cleaning, and preprocessing large datasets to ensure data quality, uniformity, and reliability. Translating data insights into actionable strategies for stakeholders. Utilizing programming languages (Python, R, SQL) and data frameworks (Hadoop, Spark) to analyse, visualize, and report data.
Technical Skills Required with % weight(a) Experience in R/Python programming - 25%, (b) Data science - 25%, (c) Data mining - 25% and (d) Machine Learning - 25%
Domain Skills Required with % weight(i) Machine learning frameworks - 50%, (ii) Data mining, predictive modeling, and algorithm development - 25%, (iii) Hands on experience in data visualization tools such as Power BI - 25%
Communication and Office suites or Productivity softwareExtensive experience in preparing business proposal using MS-Word or LibreOffice Write with knowledge of advance formatting features, Hand-on experience in preparing high quality engaging presentations using MS PowerPoint or LibreOffice Impress, Know-how about advanced features in MS-Excel or LibreOffice Calc such as Filtering, Pivot Tables, Conditional Formatting, Data Validation and Scientific Charting
Keywords and Tool NamesPowerBI, Python, Scikit-Learn, Numpy/Pandas, SQL, AWS hosting, JIRA, SCRUM
×
Job TitleUI DesignerJob TypeFull-time
Cost CenterCC01Section NameSH01
Job CodeCC01_SH01_SAReports ToDelivery Head
Work LocationNoidaNumber of Openings3
Minimum Experience (years)3.0Maximum Experience (years)8.0
Education QualificationB. Tech.Engineering DisciplineGraphic Design, IT Engg
Description of roleCreative and detail-oriented Web Application UI Designer to design intuitive, visually appealing, and user-centric web application interfaces. The role requires close collaboration with Product Owners, UX Designers, Developers, and Business Stakeholders to transform business requirements into engaging and functional user interfaces.
ResponsibilitiesCreate low-fidelity wireframes, high-fidelity mock-ups, design systems, and high-fidelity prototypes that deliver exceptional user experiences while maintaining consistency across the application. Translate business requirements and user needs into effective design solutions. Ensure designs align with usability and accessibility standards. Create user flows, journey maps, and screen navigation diagrams. Review implemented interfaces to ensure design accuracy. Support front-end teams during implementation and testing.
Technical Skills Required with % weight(a) Responsive web design, Visual hierarchy and layout design, Typography and colour theory - 25%, (b) Familiarity with front-end development constraints and best practices - 25%, (c) Data visualization and dashboard design - 25%, (d) Ability to handle multiple projects and deadlines - 15% and (d) Experience working in Agile/Scrum environments - 10%
Domain Skills Required with % weight(i) Software development lifecycle (SDLC) - 25%, (ii) Understanding user personas and user journey mapping - 25% (iii) Ability to understand business workflows and map business requirements to screens and interactions - 50%
Communication and Office suites or Productivity softwareExtensive experience in preparing business proposal using MS-Word or LibreOffice Write with knowledge of advance formatting features, Hand-on experience in preparing high quality engaging presentations using MS PowerPoint or LibreOffice Impress
Keywords and Tool NamesFigma, Sketch, Canva, SCRUM

Data Engineering is the discipline of designing, building, and maintaining systems that collect, process, and move data. Users are called Data Engineers. Data Warehousing is about storing structured data in a way that enables fast querying, reporting, and analytics. Users are called (Data) Analysts and BI (Business Intelligence) teams.

This Excel file can be used to track JD and hiring progress.

Example Swimlane Diagram for Ticketing: reference mockflow.com/blog/swimlane-diagram

Support Swimlane


WAMP stands for Windows, Apache, MySQL, and anyone of PHP, Perl, or Python. LAMP is equivalent set for Linux. WAMP server is a local web server for running the scripting language (PHP, Perl) and this is open source. XAMPP stands for Cross-Platform (X), Apache (A), Maria DB (M), PHP (P), and Perl (P). It is developed by Apache Friends. It includes Apache and MySQL, FileZilla, Mercury, Tomcat, and Maria DB.

  • Put files into the destination folder. Default folder is c:/xampp/htdocs, /var/www/html in Linux.
  • Type address "http://localhost" in web browser: Opens XAMPP dashboard
  • localhost/folderName/index.php: opens personalized page on localhost
  • Excertps from Apache2 Ubuntu Default Page: "By default, Ubuntu does not allow access through the web browser to any file apart of those located in /var/www, public_html directories (when enabled) and /usr/share (for web applications). If your site is using a web document root located elsewhere (such as in /srv) you may need to whitelist your document root directory in /etc/apache2/apache2.conf."

Javascript is loosely typed. A variable can contain all data types and a variable can change its data type. Strings created with single or double quotes work the same. Use quotes inside a string, as long as they don't match the quotes surrounding the string. Hoisting is JavaScript's default behavior of moving declarations to the top. In JavaScript, a variable can be declared after it has been used. JavaScript modules allows to break up code into separate file which makes it easier to maintain a code-base. Like Python, with the 'import' statement. 'modules' are imported from external files with the 'import' statement.

document.addEventListener("click", func_name);
function func_name() {
  document.getElementById("demo") .innerHTML = "Demo";
}
document. addEventListener("click", function(){
  document.getElementById("demo") .innerHTML = "Demo";
}

Select a column from a table on the webpage: No direct method exist though some add-on to web-browsers do exist. Select that table and paste in a text file or a spreadsheet. Use Python with CSV or Pandas modules. Paste the data in MS-Word which allows selecting particular column with mouse drag. For creating a table where columns can be selected, create a nested table. Outer table with only one 'tr' and 'td' tags. Each column as inner 'table' with single 'td' and desired number of 'tr' tags.

The Window object is the top level object in the JavaScript hierarchy and represents a browser window. It is created automatically with every instance of a 'body' or 'frameset' tag.

DOM ObjectEvent Handlers Available
Checkbox, Radio / Reset / Submit buttononClick
Button elementonClick, onMouseOver
Hypertext link, Clickable ImageMaponClick, onMouseOver, onMouseOut
DocumentonLoad, onUnload, onError
FormonSubmit, onReset
FramesetsonBlur, onFocus
Selection listonBlur, onFocus, onChange
ImageonLoad, onError, onAbort
Text and TextArea elementonBlur, onChange, onFocus, onSelect
WindowonLoad, onUnload, onBlur, onFocus

JavaScript Objects

PropertyDescription
closedReturns whether or not a window has been closed
defaultStatusSets or returns the default text in the statusbar of the window
documentReturns the entire HTML document
historya JavaScript object, not an HTML DOM object, part of the Window object and is accessed through the window.history property
lengthSets or returns the number of frames in the window
locationSee Location object
nameSets or returns the name of the window
openerReturns a reference to the window that created the window
outerHeightSets or returns the outer height of a window
outerWidthSets or returns the outer width of a window
pageXOffsetSets or returns the X position of the current page in relation to upper left corner of a window's display area
pageYOffsetSets or returns the Y position of the current page in relation to upper left corner of a window's display area
parentReturns the parent window
personalb Sets whether or not the browser's personal bar (or directories bar) should be visible
scrollbarsSets whether or not the scrollbars should be visible
selfReturns a reference to the current window
statusSets the text in the status bar of a window
statusbarSets whether or not the browser's status bar should be visible
toolbarSets whether or not the browser's tool bar is visible or not
topReturns the topmost ancestor window

JSON: Javascript Object Notation

A JSON array is equivalent to list in Python and a JSON object is similar to dictionary in Python. Python has standard JSON module where it is parsed using json.loads() method resulting in Python dictionary. A Python dictionary object can be converted into a JSON string using the json.dump() method.

PHP is white space insensitive, case-sensitive, statements are terminated by semicolons, variables start with $, constants created by define() function e.g. define("pi", 3.1416), {...} create blocks - a sequence of multiple statements (concatenation of statements). Unlike with variables, constant does not need to start with a $. Logical operators uses both ('and' &&), ('or' '||'). Loop uses parentheses for logical argument: if () ... elseif () ... else ... Single-line comments: # or //. */ .... /* is used for multiline comments. PHP Magic constants: __LINE__, __FILE__, __FUNCTION__, __CLASS__, __METHOD__, $_POST (is a PHP super global variable which is used to collect form data after submitting an HTML form with method = "post").

The double arrow operator '=>' is used as an access mechanism for arrays. => is used in associative array key/value pairs for assignment that is => is used to assign values to the keys of an array. PHP is a server side language: nothing inside the "<?php ... ?>;" blocks will ever be visible in the browser. User names and passwords are required to connect to various databases. They are secure so long they remain inside PHP tags. include_once( "../../sub-folder-x/connect_mysqli.php"); can be used to avoid keeping connect_mysqli.php file into sub-folders along with index.php file.

PHP-enabled web pages are treated just like regular HTML pages and they can be created / edited the same way as normally done for regular HTML pages. Codes can jump in and out of PHP mode even in the middle of a PHP block while the logical flow of the script remains intact. This is similar to how image and equations can be put inline with text in a MS-Word file or how PERL scripts are used in CCL (CFX Command Language). PHP code can be embedded in the middle of an HTML opening tag. Instead of using PHP echo statement, one can jump out of PHP mode and just sent straight HTML. The PHP parser doesn't care that it is in the middle of an opening tag, and doesn't require that it (HTML tag) be closed. It also allows the cases where the closing ?> tag is at the end of the HTML opening tag, just before > of HTML tag.

<?php if ($expression == true): ?>
  Show if the expression is true.
<?php else: ?>
  Otherwise show this.
<?php endif; ?>
Similarly, following code shall print "Hello, there!" 4 times.
<?php for ($i = 0; $i < 5; ++$i): ?>
  Hello, there!
<?php endfor; ?>
Tag "<?=" is shorthand for "<? php echo". The super global variable $_SERVER["PHP_SELF"] returns the filename of the currently executing script. The htmlspecialchars() function converts special characters like < and > to '&lt;' and '&gt;' which prevents Cross-Site Scripting attacks. Use stripslashes() and preg_match('/^[a-zA-Z0-9]+$/', $username) functions for additional sanitization of user inputs. Regular expression '/^[a-zA-Z0-9_.]+$/' can be used to allow underscore and dot. $_SERVER["PHP_SELF"] exploits can be avoided by using the htmlspecialchars() function. if ($_SERVER["REQUEST_METHOD"] == "POST") { .. } checks the method used to submit a form. Prepared Statements and Bound Parameters are useful against SQL injections.

Error Reporting and Debugging: Quite often while running a PHP script, one gets a blank screen, no error message but just the empty screen. The reason might be syntax error, failed function call, or something else. One need to turn on the error display options. Use "sudo find /etc -name php.ini -type f" to find the location of php.ini file (something like /etc/php/7.4/apache2/php.ini) and set "display_errors = On" in the file. The location (path) of php.ini file can also be looked into the output generated through phpinfo(); function. php.ini: update line "mysqli.default_user =" to mysqli.default_user = "root". Some programs may access fields such as $username = ini_get("mysql.default_user"); $passwd = ini_get("mysql.default_password");

Depending on which files user developer has access to, it may be needed to configure display_errors in .htaccess or PHP.ini file. Many hosting providers do not allow modification to PHP.ini file. In production version of codes, error messages must not be shown to the end users, yet information must be recorded for tracing purposes. The common way to record error messages in production environment is to store it in log files.

When working with PHP and AJAX calls, errors is difficult to track as they do not get displayed in the browser rather they are returned to the AJAX request.

The @ symbol, when placed before an expression, acts as an error control operator. When used with 'include' or 'require' statements, it suppresses error messages that would get generated if the included file cannot be found or if there is an issue during its inclusion.

"Notice: Undefined index" occurs when attempting to access an array key that does not exist within the array. This is a common warning, not a fatal error, but it indicates a potential issue in the code where an expected array key is missing. Use error_reporting(E_ALL & ~E_NOTICE); to suppress the warning (notice) messages.

debug_backtrace() generates a PHP backtrace, Returns an array of associative arrays. When an error occurs, debug_backtrace() can identify the exact function or method call that triggered it. debug_print_backtrace() prints a PHP backtrace. It prints the function calls, included/required files and eval()ed stuff. No value is returned.

User Defined Functions in PHP:

A function is defined using the function keyword, a name, a list of parameters (which might be empty) separated by commas (,) enclosed in parentheses, followed by the body of the function enclosed in curly braces. Functions need not be defined before they are referenced, except when a function is conditionally defined. By default, function arguments are passed by value (so that if the value of the argument within the function is changed, it does not get changed outside of the function).
<?php
  $x = 5.0;
  echo nl2br("$x \n");           // Output: 5
  function sqr($x) {
    $x = $x * $x;
    return $x;
  }
  
  echo nl2br("$x \n");          //  Output: 5
  echo nl2br(sqr($x) \n");      //  Output: 25
?>
To have an argument to a function passed by reference, prepend an ampersand (&) to the parameter name in the function definition.

JavaScript

  • Global Functions: eval(), isNaN(), parseInt(), parseFloat()
  • String Methods: length, toUpperCase(), toLowerCase(), substring(), indexOf(), replace()
  • Array Methods: length, push(), pop(), shift(), unshift(), splice(), slice(), forEach(), map(), filter(), reduce()
  • Number Methods: toFixed(), toPrecision()
  • Date and Time: Date() object and its methods
  • Math Object: Math.abs(), Math.round(), Math.random(), Math.floor(), Math.ceil()
  • Asynchronous Operations: setTimeout(), setInterval()

PHP vs. JavaScript

FeaturePHPJavaScript
String Manipulationstrlen(), str_replace(), explode(), implode()length, replace(), split(), join()
Array Handlingarray_push(), array_pop(), array_keys(), array_values()push(), pop(), keys(), values()
Type Conversion(int), (float), (string), intval(), floatval()parseInt(), parseFloat(), String(), Number()
Input/Outputecho, print(), file_get_contents(), file_put_contents()console.log(), alert(), fetch() (for network I/O)
Date & Timedate(), strtotime(), time()Date object methods: getFullYear(), getMonth(), getTime()
CategoryPHPJavaScriptExample Code Snippet
Outputecho, printconsole.log()PHP: echo "Hello"; JS: console.log("Hello");
String Lengthstrlen().length propertyPHP: strlen("Hello") JS: "Hello".length
Substringsubstr()substring() / slice()PHP: substr("Hello", 1, 3) JS: "Hello".slice(1, 4)
String Replacestr_replace()replace()PHP: str_replace("a", "b", "cat") JS: "cat".replace("a", "b")
Find in Stringstrpos()indexOf()PHP: strpos("Hello", "e") JS: "Hello".indexOf("e")
Array Lengthcount().length propertyPHP: count([1, 2, 3]) JS: [1, 2, 3].length
Array Mergearray_merge()concat()PHP: array_merge([1], [2]) JS: [1].concat([2])
Check if in Arrayin_array()includes()PHP: in_array(2, [1, 2, 3]) JS: [1, 2, 3].includes(2)
Loop - For Eachforeach loopforEach() methodPHP: foreach($arr as $val){} JS: [1,2,3].forEach(v => {})
JSON Encodejson_encode()JSON.stringify()PHP: json_encode(["a" => 1]) JS: JSON.stringify({a: 1})
JSON Decodejson_decode()JSON.parse()PHP: json_decode('{"a":1}') JS: JSON.parse('{"a":1}')
Date/Time Nowdate("Y-m-d H:i:s")new Date()PHP: date("Y-m-d H:i:s") JS: new Date().toISOString()
Math Roundround()Math.round()PHP: round(2.5) JS: Math.round(2.5)
Random Numberrand(min, max)Math.random() + scalingPHP: rand(1, 10) JS: Math.floor(Math.random()*10+1)
Type Checkis_array(), is_string()typeof, Array.isArray()PHP: is_array($x) JS: Array.isArray(x)
File Readfile_get_contents()fetch() / FileReader API (async)PHP: file_get_contents("file.txt") JS: fetch('file.txt')
Variable Dumpvar_dump(), print_r()console.log()PHP: var_dump($x) JS: console.log(x)
Set Timeoutsleep()setTimeout()PHP: sleep(2) JS: setTimeout(() => {}, 2000)
Define Constantdefine()const keywordPHP: define("PI", 3.14) JS: const PI = 3.14
Function Declarefunction myFunc() {}function myFunc() {} or arrow functionPHP: function greet() {} JS: const greet = () => {}

Both MySQLi (the "i" stands for improved) and PDO (PHP Data objects) have their advantages: PDO will work on many (almost all) different database systems, whereas MySQLi will only work with MySQL databases. So, switching project to use another database is easier with PDO. One only have to change the connection string and a few queries. With MySQLi, the entire code will need to be rewritten - queries included. Both are object-oriented, but MySQLi also offers a procedural API. PDO has an exception class to handle any problems that may occur in database queries.

MySQLi Object-Oriented:               |  MySQLi Procedural
-------------------------------------------------------------------------------
<?php
$srv = "localhost";                   |  <- same
$usr = "username";                    |  <- same
$pwd = "password";                    |  <- same
// Create connection
$con = new mysqli($srv, $usr, $pwd);  |  $con=mysqli_connect($srv, $usr, $pwd);
// Check connection
if ($con->connect_error) {            |  if (!$con) {
  die("Fail: ".$con->connect_error);  |   die("Fail: ".mysqli_connect_error());
}                                     |  }
$con->close();                        |  mysqli_close($con);
?>
Strings (text can contain HTML markup) are surrounded by (single or double) quotes, but with double quotes variables can be inserted to the string directly and using single quotes variables have to be inserted using the '.' dot operator. For example:
$str1 = "AI ML";
$str2 = "cfdyna.com"; 
echo '<p>Sample codes in ' . $str1 . 'at' . $str2.'<p>';
or
echo "<p>Sample codes in $str1 at $str2.<p>";
Variables can be defined in a file say named as 'common_vars.ph'. Then, this file can be included in any other file and variables defined can be used in the calling file within <?php ... > tags. For example, creation of a form can be parametrized as <input type="text" name="<?php echo $tag_username;?>" value="<?php echo $value_username;?>">

strval(string): Get the string value of a variable - this is useful function to convert arguments of a function into string before adding the information into database. Thus, $sql = "SELECT * FROM tasks WHERE username = '".$username."'"; can be simplified to combination of following two statements: $username = strval($username); and $sql = "SELECT * FROM tasks WHERE username = '$username'";

Handling Passwords: password_verify — Verifies that a password matches a hash e.g. $does_pw_match = password_verify( $user_pass, $stored_pass ); $stored_pass = password_hash( $user_pass, PASSWORD_DEFAULT ); where password_hash( ) creates a new password hash using a strong one-way hashing algorithm PASSWORD_DEFAULT.


MySQL: COMMENTS are from a '-- ' to the end of the line. The double dash-comment style requires at least white space or control character (space, tab, newline...) after the second dash. From a '#' to the end of the line, C-style comment /* ... */ can span multiple lines. You use this comment style to document a block of SQL code. MySQL does not support nested comments. Log-in to MySQL: mysql -u root -p and then enter the password, type 'quit' on mysql prompt to close the session.

  • Convention: any entry containing an underscore is user input
  • String and date values in MySQL used with either single or double quotes, but single quotes are more standard. INT signifies that the column holds integers (numeric values with no fractional part). UNSIGNED disallows negative values. NOT NULL requires that the column value must be filled in. This prevents members from being created without an ID number. AUTO_INCREMENT is a special attribute in MySQL. It indicates that the column holds sequence numbers. The PRIMARY KEY clause indicates that the the column is indexed to allow fast lookups. It also sets up the constraint that each value in that column must be unique. An ENUM (enumeration) column which means it can take only one of the values listed in the column specification. Storage engine clause, if present, names the storage engine that MySQL should use for creating the table.
  • MySQL expects dates to be written in 'CCYY-MM-DD' format
  • Check mysql version: SHOW VARIABLES LIKE "%version%";
  • Get installation directory: which mysql on Linux prompt. To clear screen: system clear; \! is used to execute system shell commands and hence \!clear; works too. \! pwd; can be used to get working directory.
  • Create a database named db_name: create database if not exists db_name;
  • Check what the default database is: select database(); To add a database to current project: use db_name; The keyword 'none' shall appear in the command prompt (MariaDB [(none)]>) if no database is selected.
  • Create database named db_name with commands input from SourceFile.sql: mysql db_name < SourceFile.sql
  • Login and activate database named 'db_name': mysql -h host_name -p -u user_name db_name
  • List all the database names being managed by MySQL server to which the current user is logged in: show databases;
  • Get list of users: SELECT user FROM mysql.users;
  • Create a new user: CREATE USER user_name IDENTIFIED BY PASSWORD user_passwd; Note that the user_name should be enclosed in quotes. User name should be specified at user_name@host_name such as 'abc'@'localhost'.
  • Show privileges granted to a user: SHOW GRANTS FOR 'user_name'@'host_name';
  • flush privileges; Required to inform MySQL to reload the privilege after the change is made.
  • Add specified privileges to a user: grant select, insert, update, delete on *.* to ‘user_name’@’host_name’;
  • Add a user name on a host: INSERT INTO table_name (Host, User, Password) values('host_name', 'user_name', PASSWORD('user_passwd’));
  • Change password for a user: SET PASSWORD FOR 'user_name'@'localhost' = PASSWORD('new_password'); FLUSH PRIVILEGES; For newer versions: ALTER USER 'user_name' IDENTIFIED BY 'new_password';
  • Remove a user: drop user 'user_name'; Note that the user name must be in single quotes. delete from user where user='user_name’ and host='host_name';
  • Create table named tab_name with column headers identified by column_designation: CREATE TABLE tab_name (column_designation);
  • List all tables in currently active database: SHOW tables;
  • Display information only for columns that match a given pattern %name where ‘%’ is a wildcard character: show columns from tab_name like ‘%name’;
  • Show whole content of a table: SELECT * FROM tab_name;
  • Add records into a table, for all the columns: INSERT INTO tab_name VALUES (value1, value2 ...);
  • Start the auto_increment other than 1, 37001 in this example: ALTER TABLE tab_name auto_increment = 37001;
  • load data infile 'c:\MySQL\tab_input.csv' replace into table tab_name fields terminated by ',' lines terminated by '\n' field_names;
  • Check structure of a table: DESCRIBE tab_name; or SHOW COLUMNS FROM tab_name; or show fields from tab_name
  • Insert several rows into a table with a single INSERT statement by specifying multiple value lists: INSERT INTO tab_name VALUES (...), (...); Parentheses enclose the set of column values for each row. INSERT INTO tab_name (col_name1, col_name2, ...) VALUES (value1, value2, ...);
  • Execute text file containing SQL queries: source queries_list.sql;
  • Load data from a CSV file into a table: load data infile input_data.csv replace into table tab_name fields terminated by ',' lines terminated by '\n' Field_1, Field_2, Field_3 ignore 1 lines; Note that in the example, only 3 fields are being updated. Ignore option is used to ignore few lines such as header of the input file.
  • load data local infile 'input_data.txt' into table tab_name; It assumes that input_data.txt is located in the current directory on the client host. By default, the LOAD DATA statement assumes that column values are separated by tabs and that lines end with newlines. It also assumes that the values are present in the order that columns are stored in the table.
  • Change attributes of field 'id' in a table: ALTER TABLE tab_name CHANGE `id` `id` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
  • Update a new record into the table emp_info: UPDATE INTO emp_info (first_name, last_name) value(‘ABC’, ‘LMN’);
  • Update additional records to the entry updated in previous step: update emp_info set PAN = ‘ABCAB3461N’ where last_name=’LMN’ and first_name=’ABC’;
  • Add column after (to the right of) an existing column: ALTER TABLE tab_name ADD COLUMN col_name VARCHAR(32) AFTER existing_column;
  • Change a column name: alter table tab_name change old_col_name new_col_name varchar (32);
  • Make a unique column to avoid duplicity: alter table tab_name add unique col_name;
  • Delete unique column from table: alter table tab_name drop index col_name;
  • Wipe out data completely from a table: delete from tab_name;
  • Rename a table: rename old_tab_name to new_tab_name;
  • Delete a table completely: drop table tab_name;
  • delete from tab_name where "Query String"; Deletes specific records matching query string. For example, delete from tab_emp_info where first_name=’ABC’ and last_name = ‘LMN’;
  • Delete a database: drop db_name;

Option-1: read files which contains SQL queries

Import SQL Queries

Option-2: Copy-paste SQL queries

Copy Paste SQL Queries


Commons Errors:

Failed to connect to MySQL: Access denied for user 'root'@'localhost' (using password: YES), Failed to connect to MySQL: Unknown database 'web_admin_db'

Catching error in SQL Queries:

$sql_cmd = "INSERT INTO tbl_members(`username`, `email`, `password`) VALUES(?,?,?)";
$stmt = $conn -> prepare($sql_cmd);
if ($stmt === False) {
  die('Error preparing SQL statement: ' . $conn->connect_error);
}

Steps to create a responsive page with LAMP: assuming LAMP is successfully configured. Default path for local server in Ubuntu: /var/www/htm. The URL to phpMyAdmin on local machine is "localhost/phpmyadmin". Check if /etc/phpmyadmin file is available. "sudo service apache2 restart" will result in error if server not installed. Use sudo apt-get install phpmyadmin to install from command line.

Installing phpMyAdmin may give error message "Connect failed: Access denied for user 'root'@'localhost' (using password: NO)" and shall ask to chose one of the 4 options. Chose 'ignore' to continue installation (use 'tab' key to select <ok>). Now loading "localhost/phpmyadmin" shall result in page looking like this:

phpmyadmin login

Optionally, GRANT ALL PRIVILEGES ON data_base.* TO 'buddhu'@'localhost'; to use this account for testing PHP codes. Use "CREATE USER 'buddhu'@'localhost' IDENTIFIED BY 'passwd'; (specify appropriate password as 'passwd') to create a new user named 'buddhu'.

Likely errors: mysqli_real_connect(): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: YES). Solution: get password from /etc/phpmyadmin/config-db.php >> run SQL Query: CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'passwd'; >> Run another query: "flush privileges;" to apply the changes. Another error: 'The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why. Or alternately go to 'Operations' tab of any database to set it up there." Get file "resources/sql/create_tables.sql" from github repository of phpmyadmin and run the SQL query from this file. Alternatively, under phpMyAdmin dashboard: go to "User Accounts", select 'phpmyadmin' under "User name" and then "Edit privileges".

phpMyAdmin privileges

Files to configure MySQL

  1. /etc/mysql/mariadb.cnf: to set global defaults
  2. /etc/mysql/conf.d/*.cnf: to set global options
  3. /etc/mysql/mariadb.conf.d/*.cnf: to set MariaDB-only options
  4. ~/.my.cnf: to set user-specific options.

Now actual database and PHP stuff:

Step-1:

Define the folder structure named as jas (JavaScript), css, dab (database), adm (administrative stuff), img (images only), vid (videos only), ico (icons only), doc (PDF, DOC and other files), sql, api, lib, tpa (third party)... and create a Readme.txt file to describe what these folders contain and/or are expected to contain. Following is an example for user registration:

web folder structure

Step-2:

Log-in to mysql terminal and create database(s) and table(s) using command and method described above. A database db_user_reg was created from command prompt. A text file contain SQL commands can be used to create table(s). Alternatively, phpMyAdmin dashboard can also be used to create and view the table.

User Table

Ensure that password field is long enough to store hashed version of the passwords (no error shall get reported and the user details shall not get added otherwise). It is safer to use field width 255 for password column.

Step-3:

Create login and user registration form using standard HTML and CSS features. A good starting point is "github.com/keerti1924/PHP-MYSQL-User-Login-System" which seems to work without any modifications. A modified version can be downloaded from here. Minor updates such as trimming user inputs, ensuring alpha-numeric user names and e-mail addresses, password length between 8 to 16 characters with at least 1 special character, prepare() and bind_param() used for database updates. A simple forgot password page has been added. There is no check if user has entered a real e-mail address or not, click on 'eye' icon shows password only for one input field.

Login page

User registration

Step-4:

Create the landing page after successful login or new user registration.

Security issues: 'Form' resubmission using refresh (F5) or "Go back one page" logs-in user and/or repeats last operation such as adding same information into the database again.

page refresh

Caching directives: PHP scripts often generate dynamic content that must not be cached by the client browser or any proxy caches between the server and the client browser. Many proxies and clients can be forced to disable caching with following code. This will sort of disable back button.
<?php
  header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
  header("Expires: Sat, 01 Jan 2020 05:00:00 GMT");   // Date in the past
?>

Some guidelines: create separate SQL command files for create and alter operations. Do not put JavaScript code inside the body - store these scripts in separate files. Follow a convention for naming: tab_ or tbl_ and db_ for table names and database names, for example db_user_reg. Add version and last update at the beginning of each file.

To-Do Application: Another example is taken from github.com/dhiraj-01/Todo-PHP to create a "ToDo List". Some modifications have been done to disable caching and prevent form resubmission on page refresh. This is a very simple set of codes for learning and demonstration. The updated version can be downloaded from here.

The folder structure of modified version is as shown below.

toDo PHP MySQL

This simple module has three main pages: signup.php, login.php and todo.php. The plain HTML file default.html is to add contents at the top of each page.
signup.php
|
*-- includes default.html and lib/database.php
*-- checks if user is logged-in and sets location to todo.php
*-- prints (echo) error message above the form section
*-- generates sign-up form and calls lib/adduser.php after Submit
|   |
|   *--- calls createCAPTCH() function to generate CAPTCHA
|   |
|   *--- adduser.php
|        |
|        *-- includes database.php (collection of all functions)
|        *-- collects inputs: username, password, secret key and CAPTCHA
|        *-- call createUser() function
|            |
|            *-- validates username, password and secret key
|                |
|                * alpha-numeric usernames
|                * password with special character, length between 6 to 10
|                * secret key: up to 6 numeric characters
|            *--- if criteria met, adds user
|            *--- if not, directs to signup.php which prints error message
login.php
|
*-- form submission directs to lib/valid_inputs.php
*-- function haveValidInputs() defined in database.php is used to check inputs
*-- checks if specified user name exist
`-- checks specified password with stored password using password_verify()
|
todo.php
|
*-- called after successful login
|   |
|   *-- option to change password with secret key used during sign-up
|   *-- generates single line form to get to-do text
|   *-- retrieves existing to-do string using getTodoItems() function
|   *-- adds new to-do string using addTodoItem() function
|
`*--lib/forgot_password.php
    |
    *-- form submission directs to lib/resetPassword.php
    `*- resetPassword() function from database.php is used to update password
        |
        *-- checks for valid username, secret key and new password
        *-- re-directs to signup.php is invalid inputs are provided.
Further improvement can be to add counter for 3 wrong attempts to log-in, send OTP to specified e-mail to reset password or secret pin, retain valid inputs when page is refreshed for invalid inputs, better background... As one can deduct, the code structure gets complicated even with simplest possible web page having server-side scripts.

Refer the example of Responsive Blog here from 'code-projects.org' which contains 140 different .php files (folder tree contains 41 directories, 266 files). A complete description of code structure with the inter-dependence of files and folders cannot be covered in few pages of a note book. The readme.txt file in this zip folder explains basic steps to make the repository working. The attached ZIP file is working on Ubuntu LTS 20.04, PHP version 7.4, Apache/2.4.41 (Ubuntu), phpMyAdmin 4.9.5deb2 and server version 10.3.39-MariaDB. Readme.txt file has been updated based on experience gained to make the code working.


Server Administration, Data Security and Hacking: Social Media Hunting, Data Theft, Tracking Personal Information

There are 52 characters (including lower and upper cases), 10 digits and 32 special characters on computer keyboard. If one does not allow to have password starting with special character and minimum size of password is set to be 8 characters, just for passwords having 8 characters, 62 x 947 = 4020 trillion combinations are possible. Note that passwords can be any size higher than 8 characters but usually it would limited to 12 ~ 16 characters as users need to remember them.

Most Basic Web Security Tips: [1] Prevent access of folder through browser such as https://www.abc.com/pqr/ - Use .htaccess file, [2] whois: This prints personal details of the website owner if privacy protection is not enabled or purchased from domain name provider, [3] wget or libwww: this Linux command can download entire content of a website: Change HTTP User Agent - RewriteCond %{HTTP_USER_AGENT} wget.* [NC], [4] Prevent access to crawlers: use Robot.txt file, [5] Prevent an htaccess file from being viewed: add following line:

<Files .htaccess>
  order allow,deny
  deny from all
</Files>

Browser Automation and Server Side Scripting:

Selenium, Pupeteer, Playwright, Headless browsers. Server side scripting: jQuery (JavaScript Framework), PHP, Ruby, Django (server side framework, free, open source and written in Python), Node.js (free, open source tool to run JavaScript outside the web browser), AngularJS (to extend HTML with new attributes). MongoDB is a document database which stores data in a type of JSON format called BSON.

jQuery

'$' is alias for 'jQuery' and '$()' is shorthand for "$(document).ready()". Code included inside $(window).load(function() { ... }) will run once the entire page (images and iframes), not when just the DOM is ready.

PowerBI and Pivot Tables

Excerpt from Microsoft website about PowerBI: Find insights in your data and share rich analytics reports. Explore your reports to find and generate the quick insights you need for better business decisions. Collaborate on reports with colleagues, then easily share reports and insights in workspaces, on the web, in apps, via Microsoft Teams.

How to Create a Pivot Table

Pivot Table


Cursor AI

Tag line on official website: "The AI Code Editor". More from website: "Cursor lets you write code using instructions. Update entire classes or functions with a simple prompt. Cursor's agent mode completes tasks end to end. It does this quickly, while keeping programmers in the loop. We support all frontier coding models, including Claude Sonnet 4, OpenAI o3-pro, OpenAI GPT-4.1, Gemini 2.5 Pro, Claude Opus 4, and more."

Thus, Cursor AI is a code editor that uses artificial intelligence models to help code writers with coding tasks such as code generation, smart rewrites, codebase queries and end-to-end task completion.


OBS Logo

OBS Studio FAQ

OBS stands for Open Broadcaster Software - an open source software to record screen and stream live on platforms like YouTube. In this section some of the tips and tricks are summarized which has been observed and received from other videos and demos. MB stands for Mouse Button. Unlike other programs, OBS does not have option to Save File... Instead is uses Profile for the same purpose. Excerpts from user guide: "A Profile saves most a solid chunk of OBS Studio settings, primarily related to outputs. Using Profiles lets you to switch between different saved settings quickly depending on the stream or recording a user is working on. Scene Collections save all Scenes and Sources that have been added to it. Similar to Profiles for output settings, you can store multiple different collections of saved Scenes and Sources. Then, you can swap between different collections for different situations. Scene Collections do not store output settings."

Studio Mode: It helps to queue-up the scenes (by creating new scenes or selecting from existing ones) and preview while streaming or recoding.

OBS-Studio Main Window

  • Alt + Left MB: crop any source object such as image, web camera...
  • Video overlap: add any scene to main scene - for example to overlay video scene (Video Capture Device with mask added to it)
  • Like any other program, white portion of an image acts as transparent section of the mask.
  • You can add only one mask on an image or video [Right click on Scene -> Filter -> -> + -> Image Mask/Blend]

You can add image mask to your webcam using ‘Image Mask/Blend’ option as per steps mentioned here: streamshark.io/obs-guide/image-mask. The white or coloured part of the image is made transparent while applying a mask and the black pixels are made invisible. Note that the mask can be applied on the source and not one the scene. If you apply mask on a source (say web cam), any relative transform between the web cam and mask cannot be applied.

Concepts of Scene and Layers in OBS: Top layer is the visible layer.

OBS Studio Mode Off

Various Types of Sources in OBS

OBS-Studio Source Window

Text Source in OBS

OBS Text Source 1

Text Source in OBS: Colour Gradient

OBS Text Source 2

Scrolling Text in OBS

OBS Text Scroll

Sometimes, the recording may automatically start without you intending to do so. This is very likely due to Hotkey associated with "Start Recording" pressed during some other tasks. Following settings might rectify this issue:

Disable hotkey when OBS window not in focus

One of the drawbacks of this setting is that you cannot start OBS while it is minimized. This is specially needed when you want to capture screen (activities on the Desktop). One option is to turn on "Never disable hotkeys" before starting a screen capture, set appropriate hotkeys (keyboard shortcuts preferably with ALT key combination at ALT key is rarely used in normal keybord input of texts) for start and stop recordings. Once desired screen capture is complete, turn on "Disable hotkeys when main window is not in focus". Note that scenes and sources automatically gets added to hot-key menu. One can use combination of ^+Shift+keys on the first, second and third rows such as z, x, c or a, s, d or q, w, e for various short cuts.

During screen capturing, one may face screens which captures itself (mirror effect) as shown in following image. If available, move the OBS Studio window to a second monitor. This will prevent it from being captured in the recording. In newer versions of OBS Studio, there is option under Settings > General > check box "Hide OBS windows from screen capture".

Screen Capture source in OBS Sutdio

Excerpts from OBS website: "High performance real time video/audio capturing and mixing. Create scenes made up of multiple sources including window captures, images, text, browser windows, webcams, capture cards and more. Studio Mode lets you preview your scenes and sources before pushing them live. Adjust your scenes and sources or create new ones and ensure they're perfect before your viewers ever see them. Set hotkeys for nearly every sort of action, such as switching between scenes, starting/stopping streams or recordings, muting audio sources, push to talk, and more. Choose from a number of different and customizable transitions for when you switch between your scenes or add your own stinger video files."


Step-by-Step method to create a circular crop of webcam for OBS Studio. One may need to use "ffmpeg -i Image-Mask-2.png -vf colorkey=white:0.01:0.0 Image-Transparent.png" or other application to create image with white pixels as transparent. In MS-PowerPoint, one can select the shape and directly save as image where the corners of the square around the circle shall be filled with transparent pixels. ImageMagick can also be used to convert white pixels to transparent.

i / ii
Input Image 1 for "Image Mask/Blend" filter
Image-Mask-1
ii / ii
Input Image 2 with transparent white pixels - to create blue circular boarder
Image-Mask-1
1 / 8
Step-1: Rename Scene, add web cam as source
Rename Scene-1
2 / 8
Step-2: Add filter to the Scene using Circular Image Mask-1
Add Filter to Scene
3 / 8
Step-2: Add filter to the Scene using Circular Image Mask-1
Add Circular Filter
4 / 8
Step-3: Adjust web cam size to fit the mask
Adjust web cam size
5 / 8
Step-4: Add new Scene
Add Circular Webcam
6 / 8
Step-5: Add filter to new scene using Circular Mask-2
Filter Using Circular Mask
7 / 8
Step-5: Add filter to new scene using Circular Mask-2
Filter Using Circular Mask 2
8 / 8
Step-6: Create a third scene and add previous scene as source
Add scene into scene

Web Scraping in Python
The term web scraping refers to collecting information from web sites. However, the same concept can be used to check the consistency and correctness of tags and links in folder structure of a website before uploading the content on host server. If a website fetches data using Javascript (called Dynamic pages such as nseindia.com), requests and urllib libraries cannot be used. These tools work only for static pages (where the contents are directly stored in HTML page being accessed).
import re
def split_string_at_numbers(input_string):
  # Check for +/- sign, digits, decimal point
  pattern = r'(-?\d+\.?\d*|\d*\.?\d+)'
  
  # Split the string by the number pattern, keeping delimiters
  sub_str  = re.split(pattern, input_string)
  sub_str_txt = []
  sub_str_num = []
  for str_txt in sub_str :
    if str_txt: 
      try:
        num = float(str_txt)
        if num == int(num):
          sub_str_num.append(int(num))
        else:
          sub_str_num.append(num)
      except ValueError:  # If conversion fails, it implies a string
        sub_str_txt.append(str_txt)
  
  for item_txt, item_value in zip(sub_str_txt, sub_str_num):
    #print(f"{item_txt} | {item_value}")
    print('{} | {}'.format(item_txt, item_value))
    
  return sub_str_txt, sub_str_num

This Python code is a simple and scalable example to check the image tags in all the HTML files stored in a folder and print summary of image tags such as relative path of image file, its file size, missing images...This code can be further improvised to include HREF tags, missing ALT tag for images, add styles to the images, remove styles of the images such as width and height... to name a few.

Python code lined here is a simple and scalable example to check the <a> tags and HREF values in all the HTML files stored in a folder and print summary of hyperlinks such as relative path of the file referred by HREF, missing files in the links... This code does not check the hyperlinks referred by HREF starting with http or https. This script can be further improvised to check for missing attribute values such as _blank.


Flowchart to create User Interfaces for multiple Standalone Apps and Deploy on Cloud Platforms like AWS

START
  ↓
Requirement Analysis: Define scope and expected key features
  ↓
Analyze Engineering Tools: inputs, run-time, outputs
  ↓
Define UI Requirements
  ├─ User roles
  ├─ Input/Output formats
  ├─ Tool execution triggers
  ↓
Choose UI Framework
  ├─ Web (React / Angular / Vue)
  └─ Desktop (Electron / PyQt)
  ↓
Design UI/UX
  ├─ Wireframes
  ├─ Navigation flow
  └─ Tool integration layout
  ↓
Develop Frontend UI
  ├─ Forms for input
  ├─ Dashboard for tools
  └─ Visualization components
  ↓
Create Back-end Layer (Optional but Recommended)
  ├─ API Gateway
  ├─ Microservices (Node.js / Python)
  └─ Tool Execution Handlers
  ↓
Integrate Standalone Tools
  ├─ CLI execution wrappers
  ├─ Containerization (Docker)
  └─ Input/Output handling
  ↓
Testing Phase
  ├─ Unit Testing
  ├─ Integration Testing
  └─ UI Testing
  ↓
Containerize Application
  ├─ UI (Frontend container)
  ├─ Back-end services
  └─ Engineering tools
  ↓
Push to Container Registry
  └─ AWS ECR
  ↓
AWS Deployment Decision
  ├─ Simple Hosting → AWS EC2
  ├─ Scalable Apps → AWS ECS / EKS
  └─ Serverless → AWS Lambda + API Gateway
  ↓
Deploy Infrastructure
  ├─ Configure VPC
  ├─ Setup Load Balancer
  ├─ Configure Auto Scaling
  ↓
Deploy Application
  ├─ Frontend → S3 + CloudFront
  ├─ Back-end → ECS / EC2 / Lambda
  └─ Tools → Containers / EC2 instances
  ↓
Setup Storage
  ├─ S3 (files/results)
  ├─ RDS / DynamoDB (metadata)
  ↓
Monitoring and Logging
  ├─ CloudWatch
  ├─ X-Ray (optional)
  ↓
Security Setup
  ├─ IAM Roles
  ├─ HTTPS (ACM)
  ├─ Authentication (Cognito)
  ↓
CI/CD Pipeline
  ├─ CodeCommit / GitHub
  ├─ CodeBuild
  └─ CodePipeline
  ↓
END (Live System)

Checklist to Develop a Simple Web App

Activity / Step / StageArtefactsRASIC
Product Definition and Planning
Define problem statementProduct OwnerS/w ArchitectS/w ArchitectFull-stackDevOps
Identify target usersProduct OwnerS/w ArchitectS/w ArchitectFull-stackDevOps
Define core featuresProduct OwnerS/w ArchitectS/w ArchitectFull-stackDevOps
Write functional requirementsProduct OwnerS/w ArchitectS/w ArchitectFull-stackDevOps
Define success metrics (KPIs)Product OwnerS/w ArchitectS/w ArchitectFull-stackDevOps
Technical Planning
Choose architectureMonolithS/w ArchitectProduct OwnerFull-stackProduct OwnerFull-stack
Select frontend frameworkReactS/w ArchitectProduct OwnerFull-stackProduct OwnerFull-stack
Select back-end techNode.jsS/w ArchitectProduct OwnerFull-stackProduct OwnerFull-stack
Choose databaseMongoDBS/w ArchitectProduct OwnerFull-stackProduct OwnerFull-stack
Define API designRESTS/w ArchitectProduct OwnerFull-stackProduct OwnerFull-stack
Create authentication and authorization schemeAWS AmplifyS/w ArchitectProduct OwnerFull-stackProduct OwnerFull-stack
Define third-party integrationsSingle Sign-OnS/w ArchitectProduct OwnerFull-stackProduct OwnerFull-stack
Create high-level system design diagramAWS AmplifyS/w ArchitectProduct OwnerFull-stackProduct OwnerFull-stack
UX/UI Design
Create wireframes (low fidelity)Full-stackProduct OwnerS/w Architect
Design UI mock-ups (high fidelity)FigmaFull-stackProduct OwnerS/w Architect
Define design system (colours, typography, components)Full-stackProduct OwnerS/w Architect
Plan responsive designDesktops onlyFull-stackProduct OwnerS/w Architect
Validate UX with stakeholdersFull-stackProduct OwnerS/w Architect
Project Setup
Initialize repositoryGitDevOpsS/w Architect
Set up project structureAWSDevOpsS/w Architect
Configure package managersnpmDevOpsS/w Architect
Set up linting and formatting toolsESLintDevOpsS/w Architect
Configure environment variablesAWSDevOpsS/w Architect
Set up CI/CD pipelineGitHubDevOpsS/w Architect
Frontend Development
Set up routing/navigationFull-stackS/w Architect
Build reusable componentsReactFull-stackS/w Architect
Implement UI screens, ensure responsivenessReactFull-stackS/w Architect
Integrate APIsReactFull-stackS/w Architect
Manage stateReduxFull-stackS/w Architect
Handle forms and validationReactFull-stackS/w Architect
Add loading/error statesNodeFull-stackS/w Architect
Back-end Development
Set up server frameworkNode.jsFull-stackS/w Architect
Define database schemaFull-stackS/w Architect
Implement APIs/endpointsFull-stackS/w Architect
Add authenticationJWTFull-stackS/w Architect
Implement business logicFull-stackS/w Architect
Add input validation and error handlingFull-stackS/w Architect
Integrate external servicesFull-stackS/w Architect
Write unit testsFull-stackS/w Architect
Database and Data Management
Design schema/modelsFull-stackS/w ArchitectProduct Owner
Set up migrationsFull-stackS/w ArchitectProduct Owner
Seed initial dataFull-stackS/w ArchitectProduct Owner
Optimize queries and indexingFull-stackS/w ArchitectProduct Owner
Security
Implement HTTPSTSL 1.3Full-stackDevOpsProduct Owner
Protect against XSS, CSRF, SQL injectionFull-stackDevOpsProduct Owner
Secure authentication and sessionsFull-stackDevOpsProduct Owner
Validate and sanitize inputsFull-stackDevOpsProduct Owner
Manage secrets securelyFull-stackDevOpsProduct Owner
Set up rate limitingFull-stackDevOpsProduct Owner
Testing
Unit testsJestFull-stackDevOpsS/w Architect
Integration testsJestFull-stackDevOpsS/w Architect
End-to-end testsFull-stackDevOpsS/w Architect
Manual QA testingFull-stackDevOpsS/w Architect
Cross-browser testingFull-stackDevOpsS/w Architect
Performance testingLighthouseFull-stackDevOpsS/w Architect
Deployment Stage
Choose hostingAWSFull-stackDevOpsS/w Architect
Set up production environmentFull-stackDevOpsS/w Architect
Configure CI/CD pipelinesCodeBuild Full-stackDevOpsS/w Architect
Set up domain and DNSFull-stackDevOpsS/w Architect
Configure SSL certificatesFull-stackDevOpsS/w Architect
Set up monitoring and loggingFull-stackDevOpsS/w Architect
Performance Optimization
Optimize frontend assetsLazy loadingS/w ArchitectFull-stackProduct Owner
Implement caching Not requiredS/w ArchitectFull-stackProduct Owner
Optimize database queriesS/w ArchitectFull-stackProduct Owner
Use compressiongzipS/w ArchitectFull-stackProduct Owner
Analyze performance S/w ArchitectFull-stackProduct Owner
Launch Readiness
Final QA passS/w ArchitectProduct OwnerS/w Architect
Fix critical bugsS/w ArchitectProduct OwnerS/w Architect
Prepare rollback planS/w ArchitectProduct OwnerS/w Architect
Create user documentation/help pagesS/w ArchitectProduct OwnerS/w Architect
Post-Launch
Monitor errors and logsS/w ArchitectFull-stackDevOpsProduct Owner
Track user behaviour and metricsS/w ArchitectFull-stackDevOpsProduct Owner
Gather user feedbackS/w ArchitectFull-stackDevOpsProduct Owner
Plan feature iterationsS/w ArchitectFull-stackDevOpsProduct Owner
Regular security updatesS/w ArchitectFull-stackDevOpsProduct Owner
Scale infrastructure as neededS/w ArchitectFull-stackDevOpsProduct Owner

Example User Stories for a Web App Development Projects

  | Stakeholder Role  | Stakeholder Name | Responsibility       | 
  | ----------------- | ---------------- | -------------------- |
  | Sponsor           | A                | Budget Approval      |
  | Project Manager   | B                | Define Requirements  |
  | Product Owner     | C                | Implement Features   |
  | Development Team  | D                | Develop Applications |
  | QA Team           | E                | Quality Assurance    |
  | End Users         | F, G, H          | Provide Feedbacks    |
  1. Epic: UI/UX Requirements
    • Modern and responsive page for laptops and desktops (not for mobile screens)
    • Company logo and colours
    • Simple menu structure
    • Conditional drop-downs
    • Navigation: Sidebars, top menus, and search boxes
    • Data Visualization: Lists, grids, expansion tables, and charts
    • Cross-browser compatibility
  2. Epic: User Authentication
    • User Registration: New users can create accounts
    • User Log-in: Users should log in using email/password
    • User authorization by admin
  3. Epic: Task Management
    • Create tasks
    • Edit and update tasks not locked
    • Delete tasks not submitted for review
    • Display task list - dashboard
  4. Epic: Collaboration
    • Submit for review
    • Close tasks
    • Add comments
Web app interface diagrams—including wireframes, mock-ups, and user flows—map out the layout and navigation of digital products. Example of web interface diagram after successful log-in:

Web-Interface-Diagram


Flowchart: User Registration with Single Sign-On (SSO) Login

 ┌─────────────────────────────┐
 │       Start                 │
 └─────────┬───────────────────┘
           │
           ▼
 ┌─────────────────────────────┐
 │ User Opens Web App          │
 └─────────┬───────────────────┘
           │
           ▼
 ┌─────────────────────────────┐
 │ New User Registration Form  │
 │ - Name, Email, Team Detail  │
 └─────────┬───────────────────┘
           │
           ▼
 .-----------------------------.
 │ Submit Registration Form    │
 └─────────┬───────────────────┘
           │
           ▼
 .-----------------------------.
 │ Registration Sent to Owner  │
 │ for Approval                │
 └─────────┬───────────────────┘
           │
           ▼
 ┌─────────────────────────────┐
 │ Owner Reviews Request       │
 └─────────┬───────────────┬───┘
           │               │
     Approved              '-------Rejected
           │                            │
           ▼                            ▼
 ┌──────────────────────┐   ┌───────────────────┐
 │ User Account Created │   │ Rejection Email / │
 │ in System            │   │ Notification Sent │
 └─────────┬────────────┘   └─────────┬─────────┘
           │                          │
           ▼                          ▼
 ┌──────────────────────┐      ┌─────────────┐
 │ Approval Notification│      │     End     │
 │ Sent to User         │      |             |
 └─────────┬────────────┘      └─────────────┘
           │
           ▼
 ┌─────────────────────────────┐
 │ User Accesses Login Screen  │
 └─────────┬───────────────────┘
           │
           ▼
 ┌─────────────────────────────┐
 │ SSO via Identity Provide    │
 │ (corporate ID/password)     │
 └─────────┬───────────────────┘
           │
           ▼
 ┌─────────────────────────────┐
 │ Authentication Successful?  │
 └─────────┬────────────────┬──┘
           │                │
          Yes              No
           │                │
           ▼                ▼
 ┌──────────────────┐  ┌───────────────┐
 │ Redirect to User │  │ Display Login │
 │ Dashboard        │  │ Error Message │
 └─────────┬────────┘  └───────┬───────┘
           │                   │
           ▼                   ▼
     ┌──────────┐         ┌──────────┐
     │   End    │         │   End    │
     └──────────┘         └──────────┘

Template to create work-flow for International Travels

This is a simple template which can be improvised to create an efficient workflow for international travels.

Good Scripting and Programming Practices

Programmer Girl Boy

First and foremost, learn the recommended guidelines for the chosen programming language and get a good text editor with syntax highlighting, auto-indentation and spell checker. Decide your own skill gap and chose whether procedural (functional) programming approach shall be easier to handle or the object oriented programming (OOP) method shall be needed. Coding standards and best practices vary depending on the industry a specific product is being developed for.

Get familiarity and start using any IDE (Integrated Development Environment) of your choice such as Visual Studio Code, Spyder, JuPyter, NetBeans, IDLE... Investigate into language specific libraries and frameworks - it helps in reusability and standardization. Instead of writing own CSS, use of Bootstrap enhances productivity.

Write the version of each piece of code at the beginning of respective file. Create naming conventions for files and folders. Learn version management programs like Git. Split the main program into functions and subroutine. Develop naming standard for each variable type. Chose variable name easy to interpret (such as with minimum 4 characters except loop counters) or multiple words separated by underscore. Create a list of 'include' modules and variables in a separate file (for example, import modules in Python such as cv2, numpy, PyPDF2...). One can follow standard convention in industry: Camel or Pascal case for naming functions, packages and classes. Snake case or Camel case for variables, objects and constants. Kebab case are supported by few programming languages such as SCHEME. One style can be to use built-in variables and function in UPPERCASE when the programming language is not case-sensitive.

Define sign conventions for variables: for example one may add prefix i_ for integers, f_ for floats, s_ for strings, a_ for arrays, d_ for dictionaries, t_ for tuples, o_ for objects...., mnth_ for monthly, qrtr_ for quarterly, half_ for half-yearly, year_ for yearly, infi_ for input field, sum_ for summation, bttn_ for buttons, cqbx_ for checkboxes...

User Ternary operator for single line loop and conditional blocks. For example, curly braces are optional in C in IF loops if there is only one statement. In Python, the single line statement can be written on the same line as the if condition. x = 1 if a > b else 2. In Java, it takes the form "variable = (condition) ? if condition True : if condition False; e.g. max_val = (n1 > n2) ? n1 : n2

Write descriptions of input variables and output(s) from each function and subroutine. Identify basic error logic and terminate the program with appropriate user message such as missing file or image. Use appropriate format statements for numbers and change the format style based on values. For example, do not print more than 3 decimals for any number > 100. For numbers > 105, switch to exponential notation. Similarly, for values < 0.0001, it is better to switch to exponential notation.

Understand the auto-generated help texts: First comment after function definition is used as Documentation String in MATLAB, Similarly, in Python first block of comments in the body of a method or function (those within triple quotes ''' ... ''') are used as Documentation String for that functions which can be printed by command help (funcName). In most of the cases, it is advised that the comments and user message should be restricted to 72 characters in the width (horizontal direction).

Excerpts from browserstack.com/guide/coding-standards-best-practices: Use the DRY (Don’t Repeat Yourself) principle. Automate repetitive tasks whenever necessary. The same piece of code should not be repeated in the script. Avoid Deep Nesting. Too many nesting levels make code harder to read and follow.

This document summarizes coding standards and guidelines for web app development projects.


User Training Flowchart

Training-Flowchart

Contact us
Disclaimers and Policies

The content on CFDyna.com is being constantly refined and improvised with on-the-job experience, testing, and training. Examples might be simplified to improve insight into the physics and basic understanding. Linked pages, articles, references, and examples are constantly reviewed to reduce errors, but we cannot warrant full correctness of all content.