Posts

React Style Guide

  Naming Extensions : Use  .jsx  extension for React components. eslint:  react/jsx-filename-extension Filename : Use PascalCase for filenames. E.g.,  ReservationCard.jsx . Reference Naming : Use PascalCase for React components and camelCase for their instances. Component Naming : Use the filename as the component name. For example,  ReservationCard.jsx  should have a reference name of  ReservationCard . However, for root components of a directory, use  index.jsx  as the filename and use the directory name as the component name: // bad import Footer from './Footer/Footer' ; // bad   import   Footer from './Footer/index' ;   // good   import   Footer from './Footer' ; Always use camelCase for prop names, or PascalCase if the prop value is a React component. Always define explicit defaultProps for all non-required props. Why? propTypes are a form of documentation, and providing defaultProps means the reader ...

Git Strategies for developers

Git is a version control system or VCS that is primarily employed for source code management and also for keeping track of changes made to a file or a set of files. It enables streamlining the individual processes of multiple developers working on the same project. What makes a Good Commit ? Rule1-  Keep your commits small Rule2-  Keep related changes only in a commit Rule3-  Write meaningful commit messages.  Try using Conventional Commit Messages -  Developers working on real projects in teams, should prefer using conventional commit message standard for consistency and tracking.  Share Git Stash with another Dev or machine Create a patch The following git command will create a patch file that contains all the differences represented by the set of changes in the stash. git stash show "stash@{0}" -p > changes.patch The “stash@{0}” is the ref of the stash. If you want a different one just use $ git stash list to see your list of stashes and select wh...

Authentication and Authorization Code Flows

Image
Authorization Code Flow with PKCE - https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-proof-key-for-code-exchange-pkce Implicit Flow -  https://auth0.com/docs/get-started/authentication-and-authorization-flow/implicit-flow-with-form-post https://auth0.com/docs/get-started/authentication-and-authorization-flow/which-oauth-2-0-flow-should-i-use

Top 7 Coding Challenge Websites

"Practice leads to perfection and perfection leads to Succession" - Amanda Jenson Problem solving is a skill. And if you are a programmer, then you should practice solving problems every day to make yourself more productive and efficient.  There are many popular websites that help you do that by providing various types of problems where you need to apply your analytical and mathematical skills to solve each problem using programming languages. HackerRank LeetCode TopCoder CodeChef CodinGame GeeksforGeeks Code Jam- Google's Coding Competitions Conclusion Thank you for reading this article. I hope that it helps you a lot in your problem-solving journey.

Top VS Code Extension for React Developers

Image
VS Code, one of the best IDE tools available for developers. Extensions within VS Code marketplace to enhance and speed up your productivity.  They are full of shortcuts, themes, icons, intellisense and much more.  Below is list of most useful extensions in VS Code. GitLens - Git supercharged Git Graph EditorConfig for VS Code Color Highlight Sort lines VS Code React Refactor Markdown All in One ESLint Todo Tree SVG Prettier Material Icon Theme Microsoft Live Share If you know of any other useful VS code extensions, please share them in comments. Until we meet again. Cheer!

Building professional and quality React component using Storybook

Image
StoryBook Steps to Install Storybook: Open your project. Run below command npx sb init Yarn package manager is default package manager used to add storybook in case both npm and yarn are installed. If you need to run npm then use below command: npx sb init --use-npm Using WebPack5: npx sb init --builder webpack5 Run story book using below command: npm run storybook Common Issues In some cases while running storybook, core-js creates issue due to conflicting version with babel. To resolve this add core-js@3 as dev dependency to your package. This should resolve such issues, in case it still gives issue check for conflicting version of babel or core-js. Running npm update helped in my case. In case some modules are not accessible by storybook, it could be due to webpack alias missing in storybook webpack, in that case updating modules in ./storybook/main.js can help. Using alias with webpack, need to registered with storybook webpack also to resolve dependencies during storybo...

Distributed System Design CAP Theorem

A plain english introduction to CAP Theorem  You’ll often hear about the CAP theorem which specifies some kind of an upper limit when designing distributed systems. As with most of my other introduction tutorials, lets try understanding CAP by comparing it with a real world situation. Chapter 1: “Remembrance Inc” Your new venture :  Last night when your spouse appreciated you on remembering her birthday and bringing her a gift, a strange Idea strikes you. People are so bad in remembering things. And you’re sooo good at it. So why not start a venture that will put your talent to use? The more you think about it, the more you like it. In fact you even come up with a news paper ad which explains your idea Remembrance Inc! - Never forget, even without remembering! Ever felt bad that you forget so much? Don’t worry. Help is just a phone away! When you need to remember something, just call 555—55-REMEM and tell us what you need to remember. For eg., call us and let us know of y...