0 Down time
GraphQL
NextJS
Mongo
VITE
MEAN
MERN
Rust
Spring
Hibernate
Liquid
SASS
REST
Spring
React
Angular

SQL Notes

Here’s a set of insightful questions and answers that explore strategies for improving PostgreSQL database performance. These could be useful for interviews, team discussions, or just sharpening your own database optimization skills.

more...

Keep Sharp

Interview coding tests often vary by role, but here’s a breakdown of the most common types across software engineering interviews:

Algorithm & Data Structure Challenges

more...

Hey React Componets

Hey React Componets

Do you want to build your own npm reusable react component library. I built this one very quickly. It is a simple component library including of a Card, Button, Form, Table and more components to come. Some key features are the Form component allows you to define form fields as content childeren and the Table component supports sorting, filtering and pagination.

$ npm i hey-react-components

Want to create your own. Follow these steps

Step 1: Set Up Your Project

1. Initialize your project:   

mkdir my-component-library
cd my-component-library
npm init -y

2. Install necessary dependencies:

npm install react react-dom
npm install --save-dev typescript @types/react @types/react-dom rollup @rollup/plugin-node-resolve @rollup/plugin-commonjs rollup-plugin-typescript2

   

3. Set up TypeScript configuration:

   Create a tsconfig.json file:

{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"declaration": true,
"declarationDir": "./dist/types",
"outDir": "./dist",
"jsx": "react",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["src"]
}

Step 2: Create Your Components

1. Create the folder structure:

more...

Github to Azure

Deploying an Angular app to Microsoft Azure when merging to the master branch on GitHub involves different Azure services and GitHub Actions. Here's a general overview of the process:

Set Up Azure Services:

a. Azure Storage Account: Create an Azure Storage Account to host your Angular app's static files (HTML, CSS, JS). You can also use Azure Blob Storage within the Storage Account.

b. Azure CDN (Optional): Set up an Azure Content Delivery Network (CDN) profile and endpoint to serve your app's content globally for better performance.

Configure Azure Credentials:

a. Set up an Azure Service Principal with appropriate permissions to access the Azure Storage Account and CDN (if used).

b. Generate the Azure Service Principal's Application ID, Authentication Key, and Tenant ID.

c. Configure these credentials on your local machine or your CI/CD environment where the deployment will take place. This can be done using environment variables or Azure CLI configuration.

Set Up GitHub Actions:

a. In your Angular project repository on GitHub, create a .github/workflows directory.

b. Create a YAML file (e.g., deploy.yml) in this directory to define the GitHub Actions workflow.

c. Configure the workflow to trigger on merges to the master branch.

Define Deployment Steps:

a. Within the workflow file, define steps to build and deploy the Angular app:

more...

React Hook Form

React Hook Form is a library for managing form state and validation in React applications using hooks. It is designed to make form handling in React applications more efficient and straightforward. React Hook Form is a popular alternative to other form management libraries like Formik.

Some of the key features and benefits of React Hook Form include:

1. Hooks-based: React Hook Form leverages React's hooks API, making it a natural fit for modern React applications. You can manage form state and validation rules using simple and familiar hooks.

2. Minimal Re-renders: The library is designed to minimize unnecessary re-renders, which can improve performance. It does so by only re-rendering form components when needed.

3. Validation: React Hook Form provides a flexible and extensible way to define and perform form validation. You can define validation rules for each input field and trigger validation at various points in the form submission process.

4. Custom Inputs: You can easily create and use custom form input components with React Hook Form, allowing you to encapsulate form logic and reusability.

5. Error Handling: The library provides mechanisms to handle and display validation errors, making it easier to provide feedback to users.

6. Optimized for Controlled Inputs: It primarily focuses on controlled input components, which helps you maintain full control over your form state and avoid common issues with uncontrolled components.

7. Built-in Support for Uncontrolled Components: While primarily designed for controlled inputs, React Hook Form also offers support for uncontrolled inputs when necessary.

8. Form Submission: React Hook Form provides methods for handling form submissions and managing form data, making it easier to integrate with your backend services.

more...

A-Form built with Angular Reactive Forms

I built a reusable component module to streamline the creation of Angular Reactive Forms

Angular Reactive Forms are a way to manage and validate form inputs in Angular applications. They provide a more programmatic and flexible approach to handling forms compared to Template-Driven Forms, which rely on two-way data binding. Reactive Forms are a powerful and versatile way to work with forms in Angular applications.

Reactive Forms offer a more structured and maintainable way to work with forms in Angular applications, particularly in complex scenarios with complex validation requirements or dynamic form elements.

To use Reactive Forms in an Angular application, you need to import the necessary modules, create a form model using the FormBuilder, define your form controls and validation rules, and then bind the form controls to HTML elements in your template using directives like formControlName.

My AForm Module allows you to skip the process of importing the dependencies and writing a Reactive form by providing a data object to the AForm component.

For Example:

Template:

more...

From Github to AWS

Deploying an Angular app to AWS when merging to the master branch on GitHub involves several steps, including setting up AWS services, configuring GitHub Actions, and creating deployment scripts. Here's a general overview of the process:

  1. Set Up AWS Services:

    a. S3 Bucket: Create an Amazon S3 bucket to store your Angular app's static files (HTML, CSS, JS).

    b. CloudFront Distribution (Optional): Set up an Amazon CloudFront distribution to serve your app's content globally for better performance.

  2. Configure AWS Credentials:

    a. Create an IAM user with appropriate permissions (S3, CloudFront if used).

    b. Generate AWS Access Key and Secret Access Key for the IAM user.

    c. Configure these credentials on your local machine or your CI/CD environment where the deployment will take place. This can be done using environment variables or AWS CLI configuration.

  3. Set Up GitHub Actions:

    a. In your Angular project repository on GitHub, create a .github/workflows directory.

    b. Create a YAML file (e.g., deploy.yml) in this directory to define the GitHub Actions workflow.

    c. Configure the workflow to trigger on merges to the master branch.

  4. Define Deployment Steps:

    a. Within the workflow file, define steps to build and deploy the Angular app:

more...

You know what I mean MERN

I came up with a brainstorming app and I built it with MERN. Like MEAN but with React instead of Angular. 

MERN is an acronym that stands for MongoDB, Express.js, React, and Node.js. It refers to a popular stack of technologies used for building modern web applications. Each component of the MERN stack represents a different layer of the application's architecture and contributes to the overall development process.

Here's an overview of each technology in the MERN stack:

MongoDB: MongoDB is a NoSQL database that stores data in a flexible, JSON-like format called BSON. It is known for its scalability, flexibility, and ability to handle large volumes of data. MongoDB is often used to store the application's data and provides a convenient way to interact with structured and unstructured data.

Express.js: Express.js is a web application framework for Node.js. It simplifies the process of building robust and scalable server-side applications. Express.js provides a set of tools and middleware to handle routing, request handling, and other common tasks, making it easier to create APIs and handle server-side logic.

React: React is a JavaScript library for building user interfaces. It focuses on creating dynamic and interactive user interfaces by using a component-based approach. React allows developers to build reusable UI components that efficiently update and render based on changes in application state. It is commonly used for creating the client-side of web applications.

Node.js: Node.js is a server-side runtime environment that allows developers to build scalable and event-driven applications using JavaScript. Node.js provides a non-blocking, asynchronous architecture, making it well-suited for handling I/O-heavy tasks and building APIs.

more...

Element UI Events

I have been learning the Vue framework and I discovered that Element UI is the go to CSS framework for working with Vue. 

Element UI is a popular open-source UI framework for building responsive and customizable web applications. It is designed to work with Vue.js, a progressive JavaScript framework, and provides a set of high-quality components and features to streamline the development of modern user interfaces.

Key features of Element UI include:

Rich Component Library: Element UI offers a wide range of UI components, including buttons, forms, dialogs, tables, menus, popovers, and more. These components are designed with a consistent and visually appealing style.

Responsive Design: The components in Element UI are responsive by default, ensuring that your application looks and works well across various devices and screen sizes.

Customization: Element UI provides theming and customization options, allowing you to adjust the appearance of components to match your application's design and branding.

Internationalization (i18n): The framework supports internationalization, making it easier to build applications that can be localized for different languages and regions.

Accessibility: Element UI places an emphasis on accessibility, ensuring that your application is usable by people with disabilities and complies with accessibility standards.

Grid System: Element UI includes a flexible grid system that helps you create responsive layouts and organize content.

Form Validation: The framework provides built-in form validation capabilities, helping you validate user input and provide meaningful feedback.

Icons and Typography: Element UI includes a set of icons and typography styles to enhance the visual design of your application.

Notification and Message: You can easily display notifications, messages, and alerts to users using the provided components.

more...

script