---
title: Blog - Trusted Team Extension Partner For Europe & USA (7)
description: Empower your business with our expert team augmentation services. Scale efficiently and stay ahead in the ever-evolving tech landscape. (7)
---

[Skip to content](https://www.craftsmensoftware.com/blog/page/7#main)

\[ CLIENT STORY \]

CLOSE ✕

[![Craftsmen](https://crafty-astro-2-0.skarif2.workers.dev/_astro/logo.CZgI5u57_1oRGAt.webp)![Craftsmen](https://crafty-astro-2-0.skarif2.workers.dev/_astro/logo-dark.B-8biif6_paamB.webp)](https://www.craftsmensoftware.com)

[About us↗](https://www.craftsmensoftware.com/about-us)[Client Stories↗](https://www.craftsmensoftware.com/client-success-stories)[Case Study↗](https://www.craftsmensoftware.com/case-study)[How We Work↗](https://www.craftsmensoftware.com/how-we-work)[Blog↗](https://www.craftsmensoftware.com/blog)[Career↗](https://careers.craftsmensoftware.com/)

[![](https://www.craftsmensoftware.com/hubfs/norway.svg)NO](https://www.craftsmensoftware.com/no/)

[Get In Touch↗](https://www.craftsmensoftware.com/contact-us)MENU

[About us↗](https://www.craftsmensoftware.com/about-us)[Client Stories↗](https://www.craftsmensoftware.com/client-success-stories)[Case Study↗](https://www.craftsmensoftware.com/case-study)[How We Work↗](https://www.craftsmensoftware.com/how-we-work)[Blog↗](https://www.craftsmensoftware.com/blog)[Career↗](https://careers.craftsmensoftware.com/)

[![](https://www.craftsmensoftware.com/hubfs/norway.svg)NORSK](https://www.craftsmensoftware.com/no/)

[Get In Touch↗](https://www.craftsmensoftware.com/contact-us)

# Insights on Software, Teams*and Technology Growth*

Explore practical perspectives on software delivery, team collaboration, and technology partnerships that help growing businesses make better decisions and build with confidence.

[Discuss Your Needs](https://www.craftsmensoftware.com/contact-us)

![Craftsmen engineers and international partners on stage at Tech for Good in Bergen](https://www.craftsmensoftware.com/hs-fs/hubfs/Software%20Team%20Norway%2c%20UK%2c%20USA%2c%20Sweden.jpg?width=2000&name=Software%20Team%20Norway%2c%20UK%2c%20USA%2c%20Sweden.jpg)

Search articles

[All](https://www.craftsmensoftware.com/blog#articles) [Blog](https://www.craftsmensoftware.com/blog/tag/blog#articles)[AWS](https://www.craftsmensoftware.com/blog/tag/aws#articles)[Tech](https://www.craftsmensoftware.com/blog/tag/tech#articles)[Python](https://www.craftsmensoftware.com/blog/tag/python#articles)[Tips and hacks](https://www.craftsmensoftware.com/blog/tag/tips-and-hacks#articles)[lambda](https://www.craftsmensoftware.com/blog/tag/lambda#articles)[Software Team Augmentation](https://www.craftsmensoftware.com/blog/tag/software-team-augmentation#articles)[DynamoDB](https://www.craftsmensoftware.com/blog/tag/dynamodb#articles)[Team Augmentation](https://www.craftsmensoftware.com/blog/tag/team-augmentation#articles)[AI](https://www.craftsmensoftware.com/blog/tag/ai#articles)[Nodejs](https://www.craftsmensoftware.com/blog/tag/nodejs#articles)[serverless](https://www.craftsmensoftware.com/blog/tag/serverless#articles)[React](https://www.craftsmensoftware.com/blog/tag/react#articles)[Flask](https://www.craftsmensoftware.com/blog/tag/flask#articles)[GraphQL](https://www.craftsmensoftware.com/blog/tag/graphql#articles)[FFmpeg](https://www.craftsmensoftware.com/blog/tag/ffmpeg#articles)[Git](https://www.craftsmensoftware.com/blog/tag/git#articles)[GoLang](https://www.craftsmensoftware.com/blog/tag/golang#articles)[SQL](https://www.craftsmensoftware.com/blog/tag/sql#articles)[Transcription](https://www.craftsmensoftware.com/blog/tag/transcription#articles)[Vite](https://www.craftsmensoftware.com/blog/tag/vite#articles)

Newest firstPage 7 of 11

[![](https://www.craftsmensoftware.com/hubfs/Imported_Blog_Media/Implementing_React_hook_and_Context.webp)](https://www.craftsmensoftware.com/blog/implementing-a-global-store-using-react-context-and-hook-patterns-part-1)

### [Implementing a global store using React Context and Hook patterns: Part 1](https://www.craftsmensoftware.com/blog/implementing-a-global-store-using-react-context-and-hook-patterns-part-1)

‘Prop Drilling’ through the React component tree is one of the worst nightmares for developers. For those who don’t know what prop drilling is, it’s the process of passing down data/methods from parent to children within a long hierarchy. It’s not a problem when the tree is small, with one or two-level. But when the React component gets larger, it’s troublesome to keep track of all that ‘life-altering’ props. To solve prop drilling and some related problems, global state management like Redux, Mobx, Unstated, Apollo Link State, etc. has become unrequitedly popular. Also for React, react-redux has become the oneway destination to React developers. But, sometimes for a simple app using those state management solutions might seem overkill. Here comes React to the rescue. Using React Context API and Hook patterns we can create a Redux-like store, that we can use to store data, call on dispatcher for performing actions, and thus solving the problem of prop drilling without installing any third party state management systems. Voila! This will be a two-part article, in the first part, we are going to create a redux like store, let’s call it ‘react-store’ from now on. Then in the next part, we are going to create a simple react app, to apply that react-store practically. Let’s Get Started To get started we need to understand how React Context works. The best way to learn about the Context is to go through the Official Documentation. In short, Context is a way to share data across the react-app without having to pass them explicitly (remember, prop drilling). So, we will create a context, then wrap our app with it and any state we keep on the context will be available throughout the app. Seems simple enough. Actually, we will see that it is. Then comes, React Hooks. After being included in React’s latest releases, the hooks have become such a buzzword, to be honest, it’s actually deserving. We are going to use useReducer hook (Wait, where have I heard the name reducer before? Yeah, right in redux), which to be honest is the more advanced version of useState hook. To know more about them go through their Documentation as usual. Okay, enough chit-chat. Let’s create our desired context: Copy const StoreContext = createContext(); const GlobalStore = props =\> { return ; }; const StoreContext = createContext(); const GlobalStore = props =\> { return ; }; We have created a context called StoreContext. And in the GlobalStore function, we are using StoreContext.Provider to expose the values throughout the app. Now, let’s add state to our context.: Copy const StoreContext = createContext(); const GlobalStore = props =\> { if (props === undefined) throw new Error( "Props Undefined. You probably mixed up betweenn default/named import" ); const { load, ...rest } = props; const \[state, dispatch\] = useReducer(load.reducer, load.initialState); return ; }; const StoreContext = createContext(); const GlobalStore = props =\> { if (props === undefined) throw new Error( "Props Undefined. You probably mixed up betweenn default/named import" ); const { load, ...rest } = props; const \[state, dispatch\] = useReducer(load.reducer, load.initialState); return ; };   So, we have introduced a local state for the whole context using useReducer. It returns state which have the initial state of the app that comes from prop load.initialState and dispatch that can takes actions on the state through the load.reducer. We will create a custom hook using useContext to expose the values. So, the final file GlobalStore.js will look like this: Copy import React, { createContext, useContext, useReducer } from "react"; const StoreContext = createContext(); const GlobalStore = props =\> { if (props === undefined) throw new Error( "Props Undefined. You probably mixed up betweenn default/named import" ); const { load, ...rest } = props; const \[state, dispatch\] = useReducer(load.reducer, load.initialState); return ; }; export const useStore = () =\> useContext(StoreContext); export default GlobalStore; import React, { createContext, useContext, useReducer } from "react"; const StoreContext = createContext(); const GlobalStore = props =\> { if (props === undefined) throw new Error( "Props Undefined. You probably mixed up betweenn default/named import" ); const { load, ...rest } = props; const \[state, dispatch\] = useReducer(load.reducer, load.initialState); return ; }; export const useStore = () =\> useContext(StoreContext); export default GlobalStore;   We will now create a combineReducer function, just like Redux to combine multiple reducers if needed. The combineReducer.js file will look like this: Copy const combineReducer = reducers =\> { const finalReducers = {}; Object.keys(reducers).forEach(key =\> { if (typeof reducers\[key\] === "function") finalReducers\[key\] = reducers\[key\]; else throw new Error(\`${key} reducer must be a function\`); }); const finalReducerKeys = Object.keys(finalReducers); return (state, action) =\> { let hasChanged = false; const nextState = {}; finalReducerKeys.forEach(key =\> { const reducer = finalReducers\[key\]; const previousStateForKey = state\[key\]; const nextStateForKey = reducer(previousStateForKey, action); nextState\[key\] = nextStateForKey; hasChanged = hasChanged || nextStateForKey !== previousStateForKey; }); hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; return hasChanged ? nextState : state; }; }; export default combineReducer; const combineReducer = reducers =\> { const finalReducers = {}; Object.keys(reducers).forEach(key =\> { if (typeof reducers\[key\] === "function") finalReducers\[key\] = reducers\[key\]; else throw new Error(\`${key} reducer must be a function\`); }); const finalReducerKeys = Object.keys(finalReducers); return (state, action) =\> { let hasChanged = false; const nextState = {}; finalReducerKeys.forEach(key =\> { const reducer = finalReducers\[key\]; const previousStateForKey = state\[key\]; const nextStateForKey = reducer(previousStateForKey, action); nextState\[key\] = nextStateForKey; hasChanged = hasChanged || nextStateForKey !== previousStateForKey; }); hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; return hasChanged ? nextState : state; }; }; export default combineReducer;   We will also create a createStore.js file just to create an object out of reducer and initialState. It’s so trivial. Copy const createStore = (reducer, initialState) =\> ({ reducer, initialState }); export default createStore; const createStore = (reducer, initialState) =\> ({ reducer, initialState }); export default createStore;   TL;DR: This whole code can be found here. Well, that was easy. We have our lightweight react-store ready to be used. In the next article, we will create a simple app and try to use this global store firsthand. This will be exciting. So for now, let me quote Charles Bukowski: If you’re going to try, go all the way. There is no other feeling like that. You will be alone with the gods, and the nights will flame with fire. You will ride life straight to perfect laughter. It’s the only good fight there is. Copy const StoreContext = createContext(); const GlobalStore = props =\> { if (props === undefined) throw new Error( "Props Undefined. You probably mixed up betweenn default/named import" ); const { load, ...rest } = props; const \[state, dispatch\] = useReducer(load.reducer, load.initialState); return ; }; const StoreContext = createContext(); const GlobalStore = props =\> { if (props === undefined) throw new Error( "Props Undefined. You probably mixed up betweenn default/named import" ); const { load, ...rest } = props; const \[state, dispatch\] = useReducer(load.reducer, load.initialState); return ; };

**Tusher Ahamed**17 Apr 2024 Read →

[![](https://www.craftsmensoftware.com/hubfs/Imported_Blog_Media/Managing-dependency-on-external-modules-in-a-seamless-way-01.webp)](https://www.craftsmensoftware.com/blog/managing-dependency-on-external-modules-in-a-seamless-way)

### [Managing dependency on external modules in a seamless way](https://www.craftsmensoftware.com/blog/managing-dependency-on-external-modules-in-a-seamless-way)

Introduction Have you ever worked with a project that depends on external dependency packages throughout your application code base? Managing dependency on external modules in a seamless way is crucial, as external packages can change at any time, which can cause issues and make refactoring difficult. To avoid this problem, we can use the Adapter Design Pattern to wrap our external dependency packages with a wrapper component that maps their interfaces back to our internal ones. In this article, we will talk about the Adapter Pattern, and how it allows us to encapsulate external dependencies and their interfaces, shielding our application code from changes in the outside world. \[1\] What is Adapter Design Pattern Adapter Design Pattern is a structural design pattern that allows you to encapsulate an existing class and adapt it to a new interface. The adapter design pattern is widely used in the computer programming and software development industries. An adapter holds the component with the additional functionality not available in the original component. To illustrate, let’s say we have a class called Car, which stores information about cars that can run on the road. We would like to add a new feature that allows us to run the car on a railway track. For a visual representation, it should work something like this. Source: refactoring.guru \[2\] For this feature to work correctly, we need our Car class to support this functionality. Meanwhile, no methods in our Car class can handle this feature. So how do we implement this feature? The answer is by creating an adapter class that will take all of these duties for us. Let’s see a short code snippet to understand what we are talking about. Adapter Pattern for External Dependency Changes Let’s see a high-level overview of the approach we are talking about. In brief, assume you have a NodeJS project and it relies heavily on an external package named \`log4js\` to log various events. For instance, the handleAssetPublishService is an example method where log4j is being used directly. Similarly to the above implementation, let’s say your application has several different methods different from this, which use log4js directly and all of them are distributed into different AWS lambdas for logging. Refactoring this implementation and wrapping the log4js package inside an Adapter of our own. We have created a LogAdapter class that serves as a wrapper for the log4js packages. As you can see the LogAdapter class implements the ILogger interface. In the constructor, we first initiate the behavior of the log4js logger object and later implementing the method bodies. With this, the modified method will look something like the one below. Benefits of using this Approach You might wonder why we should go to such lengths to implement the same functionality inside an adapter class. Does it not just create extra boilerplate code inside our application? Well, think of the approach in this way, assume as we have talked about, your application may have several lambda functions which rely upon the log4js. If there is a need to change the log4js to a different logger package or update its version, the whole implementation needs to be refactored accordingly. Without an adapter class, we will have to manually refactor our whole application where it is being used. On the other hand, with the adapter class implementation, we now just need to make changes to our adapter class and our codebase remains unaffected by the overall changes. One of the real-life examples is the log4j vulnerability incident \[3\]\[4\]. For instance, suddenly one day we hear that the log4js package has a significant security vulnerability that lets an attacker see all the log messages inside an active system. Overnight, they released a new stable version of the log4js package for the security fix. They had changed all the previous method signatures and taking new params now, making it incompatible with the current application. Without an adapter, we have to immediately change our entire application, removing the log4js implementation from every lambda, which could be a nightmare for your developer team. But, if we have an adapter class implementation we can just refactor it inside the adapter class and our whole application will be safe from this security risk. Suppose, this scenario happens and your development team decided to change the log4js interface with another package named \`pino\` and \`pino-pretty\`, just to ensure security. All we need to do is now, change our LogAdapter class’s implementation to serve the logging functionality throughout our application. Conclusion Well, we are almost to the end of our article. Implementing this strategy inside our application, allows us to write clean and maintainable code that we can reuse without fear of changes in external dependencies making our code more robust and scalable. It will help us to decouple our code from its dependencies to isolate it from dangerous changes that can happen outside of our circle since we can change the internal implementation at any time without having to worry about side effects throughout the application. In the mentioned example, we have explained a use case, where we used the Adapter pattern to solve it. But depending on the problem statement, the design pattern might change to Proxy or Decorator or a similar structural design pattern that is closely similar to that of the Adapter pattern. Thank you for your time. Reference Reference 1: https://betterprogramming.pub/using-the-adapter-pattern-to-secure-apps-from-external-dependency-changes-72d0f4c9d961 Reference 2: https://refactoring.guru/design-patterns/adapter Reference 3: https://www.spiceworks.com/it-security/vulnerability-management/articles/log4j-apache-vulnerability-everything-you-need-to-know/ Reference 4: https://www.cisecurity.org/log4j-zero-day-vulnerability-response

**Abdus Sayef Reyadh**16 Apr 2024 Read →

[![](https://www.craftsmensoftware.com/hubfs/Imported_Blog_Media/48_Demystifying_Cron_Job_Through_AWS_Lambda.webp)](https://www.craftsmensoftware.com/blog/demystifying-cron-job-through-aws-lambda-in-serverless)

### [Demystifying cron job through AWS lambda in Serverless](https://www.craftsmensoftware.com/blog/demystifying-cron-job-through-aws-lambda-in-serverless)

Some services like video upload to social media like Facebook, YouTube, etc via API need some time to process the request as it takes time to finish the processing of a video by Facebook or YouTube. At Craftsmen, for one of our customers we have a service API where users can send us requests with a video URL, and in which social media platform the video should be uploaded, our API will upload the video to the provided social media platform in a short moment. But the problem is that we don’t know when the processing from these social media platforms will be finished. Let’s first see our workflow to upload a video. Flowchart for uploading a video to YouTube So you can see that the request is directly passed to AWS Fargate because it may take more than 30 seconds to upload the video and any API request will last till 29 seconds and after that, it will return response even if the request is still processing. Now one problem arises is that the Fargate task only feeds the video to the social media platform’s API like Facebook graph API and YouTube data API. We don’t actually know if the video upload is successful or not as processing may take at least 2–3 minutes. So we introduced a CRON lambda-based solution to overcome the problem. The basic idea is shown in the flowchart below: The main theme is that, whenever a new request comes to the AWS Fargate task, after uploading it, we save the video information in the main DB as a processing state and add a new item in another DB called Polling DB. Our CRON lambda runs after every 5 minutes and checks if there is any new item in the Polling DB. If so, then it tries to fetch the info. about the item from the social media API and update the main DB accordingly. The code for the CRON lambda is simple. To make a lambda run as a CRON job, we just need to specify in the YML like below: Name of your lambda: handler: source to your handler lambda events: - schedule: rate(5 minutes) rate (5 minutes) means that the CRON will run after every 5 minutes. We use node JS and TypeScript. To test it offline, you will need a plugin called serverless-offline-scheduler. You will find it in the npm library. Main code is below: Copy const deleteInfoFromPollingTable = async (id: string) =\> { const params = { TableName: tableName, Key: { id, }, }; try { await dynamodb.delete(params).promise(); return true; } catch (err) { console.log(err); return false; } }; const getAllNewItemsFromDb = async () =\> { const param = { TableName: tableName, }; const res = await dynamodb.scan(param).promise(); const newItems: PollingInfo\[\] = \[\]; if (res && res.Items && res.Items.length \> 0) { for (const item of res.Items) { if (isPollingEntity(item)) { if (!item.pollStatus && item.pollCount \< 5) newItems.push(item); if (item.pollCount \>= 5) { await updateMainDatabase(item.id, PostStatus.Unprocessed); } } } } return newItems; }; const getYoutubeVideoStatus = async (id: string, refreshToken: string, postId: string, pollCount: number) =\> { auth.setCredentials({ refresh\_token: refreshToken }); const tokens = await auth.refreshAccessToken(); auth.setCredentials(tokens.credentials); google.youtube('v3').videos.list( { auth, id: postId, part: 'statistics', }, async (err: Error | null, msg: any) =\> { if (err) { console.log(err); await setProcessingStatus(id, pollCount, false); } else { console.log(msg.data.items); if (!msg.data.items || msg.data.items.length === 0) { await setProcessingStatus(id, pollCount, false); } else { await updateMainDatabase(id, PostStatus.Processed); } } } ); }; import { ScheduledEvent, Context } from 'aws-lambda'; import { DynamoDB } from 'aws-sdk'; import { isPollingEntity, PollingInfo } from '@/src/lambda/database/entity/pollingInfoEntity'; import { PostStatus } from '@/src/type/input'; import { google } from 'googleapis'; const youtubeAppClient: any = process.env.youtubeAppCLient; const youtubeSecret: any = process.env.youtubeSecret; const auth = new google.auth.OAuth2({ clientId: youtubeAppClient, clientSecret: youtubeSecret, }); const dynamodb = new DynamoDB.DocumentClient(); const tableName: any = process.env.POLLTABLE; const mainTable: any = process.env.POST\_DYNAMODB\_TABLE; export const pollItemInfo = async (event: ScheduledEvent, context: Context) =\> { const newItems = await getAllNewItemsFromDb(); console.log(newItems); const updatePromise = \[\]; const youtubePromise = \[\]; for (const item of newItems) { updatePromise.push(setProcessingStatus(item.id, item.pollCount, true)); youtubePromise.push(getYoutubeVideoStatus(item.id, item.refreshToken, item.postId, item.pollCount)); } await Promise.all(updatePromise); await Promise.all(youtubePromise); }; const setProcessingStatus = async (id: string, pollCount: number, pollStatus: boolean) =\> { const params = { TableName: tableName, Key: { id }, UpdateExpression: 'set pollStatus = :pollStatus,pollCount = :pollCount', ExpressionAttributeValues: { ':pollCount': pollCount + 1, ':pollStatus': pollStatus, }, ReturnValues: 'UPDATED\_NEW', }; try { await dynamodb.update(params).promise(); return true; } catch (error) { console.log(error); return false; } }; const updateMainDatabase = async (id: string, status: string) =\> { const params = { TableName: mainTable, Key: { id }, UpdateExpression: 'set #sts = :postStatus', ExpressionAttributeNames: { '#sts': 'status', }, ExpressionAttributeValues: { ':postStatus': status, }, ReturnValues: 'UPDATED\_NEW', }; try { await dynamodb.update(params).promise(); await deleteInfoFromPollingTable(id); return true; } catch (error) { console.log(error); return false; } }; const deleteInfoFromPollingTable = async (id: string) =\> { const params = { TableName: tableName, Key: { id, }, }; try { await dynamodb.delete(params).promise(); return true; } catch (err) { console.log(err); return false; } }; const getAllNewItemsFromDb = async () =\> { const param = { TableName: tableName, }; const res = await dynamodb.scan(param).promise(); const newItems: PollingInfo\[\] = \[\]; if (res && res.Items && res.Items.length \> 0) { for (const item of res.Items) { if (isPollingEntity(item)) { if (!item.pollStatus && item.pollCount \< 5) newItems.push(item); if (item.pollCount \>= 5) { await updateMainDatabase(item.id, PostStatus.Unprocessed); } } } } return newItems; }; const getYoutubeVideoStatus = async (id: string, refreshToken: string, postId: string, pollCount: number) =\> { auth.setCredentials({ refresh\_token: refreshToken }); const tokens = await auth.refreshAccessToken(); auth.setCredentials(tokens.credentials); google.youtube('v3').videos.list( { auth, id: postId, part: 'statistics', }, async (err: Error | null, msg: any) =\> { if (err) { console.log(err); await setProcessingStatus(id, pollCount, false); } else { console.log(msg.data.items); if (!msg.data.items || msg.data.items.length === 0) { await setProcessingStatus(id, pollCount, false); } else { await updateMainDatabase(id, PostStatus.Processed); } } } ); }; import { ScheduledEvent, Context } from 'aws-lambda'; import { DynamoDB } from 'aws-sdk'; import { isPollingEntity, PollingInfo } from '@/src/lambda/database/entity/pollingInfoEntity'; import { PostStatus } from '@/src/type/input'; import { google } from 'googleapis'; const youtubeAppClient: any = process.env.youtubeAppCLient; const youtubeSecret: any = process.env.youtubeSecret; const auth = new google.auth.OAuth2({ clientId: youtubeAppClient, clientSecret: youtubeSecret, }); const dynamodb = new DynamoDB.DocumentClient(); const tableName: any = process.env.POLLTABLE; const mainTable: any = process.env.POST\_DYNAMODB\_TABLE; export const pollItemInfo = async (event: ScheduledEvent, context: Context) =\> { const newItems = await getAllNewItemsFromDb(); console.log(newItems); const updatePromise = \[\]; const youtubePromise = \[\]; for (const item of newItems) { updatePromise.push(setProcessingStatus(item.id, item.pollCount, true)); youtubePromise.push(getYoutubeVideoStatus(item.id, item.refreshToken, item.postId, item.pollCount)); } await Promise.all(updatePromise); await Promise.all(youtubePromise); }; const setProcessingStatus = async (id: string, pollCount: number, pollStatus: boolean) =\> { const params = { TableName: tableName, Key: { id }, UpdateExpression: 'set pollStatus = :pollStatus,pollCount = :pollCount', ExpressionAttributeValues: { ':pollCount': pollCount + 1, ':pollStatus': pollStatus, }, ReturnValues: 'UPDATED\_NEW', }; try { await dynamodb.update(params).promise(); return true; } catch (error) { console.log(error); return false; } }; const updateMainDatabase = async (id: string, status: string) =\> { const params = { TableName: mainTable, Key: { id }, UpdateExpression: 'set #sts = :postStatus', ExpressionAttributeNames: { '#sts': 'status', }, ExpressionAttributeValues: { ':postStatus': status, }, ReturnValues: 'UPDATED\_NEW', }; try { await dynamodb.update(params).promise(); await deleteInfoFromPollingTable(id); return true; } catch (error) { console.log(error); return false; } }; The driver function is the main.ts file. At first, it tries to fetch all the items whose polling status is false and the poll count is less than 5. That means we will retry the process for each item at most 5 times. If the poll count is greater than or equal to 5, we consider that the process was failed. So we update the info for that item in the main DB as unprocessed and delete the item from the polling table. Thus the polling table will never get overpopulated with items as we are deleting items from thereafter the process is done. If the polling status is false and the poll count is less than 5, that means we need to process the item. So we store the items in an array. Then immediately after that, we update the polling status of the items stored in the array to true. We do this because if the CRON running currently takes more than 5 minutes, another new CRON will also start running and it will try to fetch all the items in the Polling DB. So we set this polling status to true so that the CRON lambdas that will run later can understand that these items are being processed by another CRON. Then we try to see for each id if there exists any video in social media. If so, that means the video processing is done by the social media servers. So we update the info for that item in the main DB as processed and delete the item from the polling table as it’s work is done. If we can’t find any item in the social media with that id, then we update the polling status to false for that item in the Polling DB and increase the poll count by one. Thus another CRON which will run later will fetch this item also for processing, as it has polling status false. This is how we used lambda CRON in our project to overcome the problems we had. To test it offline, you need to install serverless-offline-scheduler and run the command SLS schedule or serverless schedule. It will run only the CRON lambda in offline.

**Abul Hasnat**14 Apr 2024 Read →

[![](https://www.craftsmensoftware.com/hubfs/34_Connecting_With_Kaltura_with_TypeScript-1.webp)](https://www.craftsmensoftware.com/blog/connecting-with-kaltura-from-nodejs-using-kaltura-typescript-client)

### [Connecting with Kaltura from NodeJs using Kaltura TypeScript Client](https://www.craftsmensoftware.com/blog/connecting-with-kaltura-from-nodejs-using-kaltura-typescript-client)

Imagine a multinational company planning a grand product launch for their latest gadget. They want to broadcast the event live to their global audience, ensuring that customers, media, and stakeholders can tune in from anywhere in the world. The event includes presentations, product demos, and interviews with key figures. Let’s discover how to seamlessly integrate video management by connecting with Kaltura from NodeJs using Kaltura TypeScript Client. Or Imagine you’re managing a popular online learning platform that streams educational videos to thousands of students globally.Your platform needs a robust video management solution to handle video uploads, processing, streaming, and analytics. Enter Kaltura, a powerful video platform that can simplify these tasks. But how do you integrate Kaltura with your NodeJs backend seamlessly? That’s where the Kaltura TypeScript client comes into play. Recently when I was working on a project, I found myself looking for a better way to upload a video on Kaltura from a NodeJs project. Of course, there is a Kaltura npm library that can be used to upload videos and do other things on Kaltura, but it didn’t work out for us, so we switched to Kaltura TypeScript client.

**Asif Imtiaj Safi**13 Apr 2024 Read →

[![](https://www.craftsmensoftware.com/hubfs/Imported_Blog_Media/43_FFmpeg_Basic_Filter_Graphs.webp)](https://www.craftsmensoftware.com/blog/ffmpeg-basic-filter-graphs)

### [FFmpeg – Basic Filter Graphs](https://www.craftsmensoftware.com/blog/ffmpeg-basic-filter-graphs)

FFmpeg – Basic Filter Graphs is considered the Swiss Army knife of video transcoding/streaming. Let’s start with some very basic examples today of what we can do with FFmpeg. Format conversion Copy ffmpeg -y -i input.mkv output.mp4 ffmpeg -y -i input.mkv output.mp4 In this simplest example, FFmpeg produces MP4 output from MKV input. -y denotes that we want to overwrite output.mp4 if it already exists. -i marks the input. In addition to these two, FFmpeg supports many other popular multimedia file formats, including MXF, AVI, WAV, M4A, JPG, PNG etc. Codec conversion Copy ffmpeg -y -i input.mkv -vcodec libx264 -acodec flac output.mkv ffmpeg -y -i input.mkv -vcodec libx264 -acodec flac output.mkv It is common to use FFmpeg to transcode from one codec to another. Here, we specify the video and audio codecs with -vcodec and -acodec. Take only video or audio Copy ffmpeg -y -i input.mkv -map 0:v output.mp4 -map 0:v selects the video streams from the first input (we have only one input file here anyway, marked by 0), while 0:a means the audio streams. ffmpeg -y -i input.mkv -map 0:v output.mp4 -map 0:v selects the video streams from the first input (we have only one input file here anyway, marked by 0), while 0:a means the audio streams. Resize the video Copy ffmpeg -y -i input.mkv -filter\_complex scale=720:480 output.mp4 ffmpeg -y -i input.mkv -filter\_complex scale=720:480 output.mp4 -filter\_complex can be used to combine many filters together. Filters sit between the input and the output and make some change to the media flowing through them. Here we are using the scale filter and specifying the output width and height. Clipping Copy ffmpeg -y -i input.mkv -ss 30.4 -to 40.15 output.mp4 ffmpeg -y -i input.mkv -ss 30.4 -to 40.15 output.mp4   Here, -ss and -to are used to specify the start and end times in seconds. Snapshot at time Copy ffmpeg -y -i input.mkv -ss 2.598 -vframes 1 output.jpg ffmpeg -y -i input.mkv -ss 2.598 -vframes 1 output.jpg   We can give a filename with .jpg extension, and -vframes 1 will tell FFmpeg to produce a single image at the specified time instance. Thumbnails at interval Copy ffmpeg -y -i input.mp4 -filter\_complex "fps=1/5,scale=320:180" thumbnail-%03d.jpg ffmpeg -y -i input.mp4 -filter\_complex "fps=1/5,scale=320:180" thumbnail-%03d.jpg   The fps filter is used here to say that we need 1 frame every 5 seconds. We scale it to required dimensions and give a pattern for the thumbnail filename to be numbered as we like. Extract audio channels Copy ffmpeg -y -i input.mxf \\ -filter\_complex "\[0:a\]asplit=2\[a1\]\[a2\];\[a1\]pan=mono|c0=c0\[ch1\];\[a2\]pan=mono|c0=c1\[ch2\]" \\ -map \[ch1\] channel\_1.wav \\ -map \[ch2\] channel\_2.wav ffmpeg -y -i input.mxf \\ -filter\_complex "\[0:a\]asplit=2\[a1\]\[a2\];\[a1\]pan=mono|c0=c0\[ch1\];\[a2\]pan=mono|c0=c1\[ch2\]" \\ -map \[ch1\] channel\_1.wav \\ -map \[ch2\] channel\_2.wav   Getting slightly complicated now, but the graph image above should make it easier to understand. We first fork the input audio with the asplit filter into two identical branches labeled a1 and a2. Then we connect each of these to pan filters that are each set up to produce one mono channel. The first pan filter will select the first channel (c0) from a1 and the second one will select the second channel (c1)from a2, and we label the outputs from these pan filters ch1 and ch2 respectively. Lastly, we map ch1 and ch2 to produce two separate WAV files. Complex graphs with shared filters In this final example, we try to reuse common filters and produce simultaneous outputs in parallel. Copy ffmpeg -y -i input.mxf \\ -filter\_complex "\[0:a\]asplit=2\[a1\]\[a2\];\[a1\]pan=mono|c0=c0\[ch1\];\[a2\]pan=mono|c0=c1\[ch2\]" \\ -map \[ch1\] channel\_1.wav \\ -map \[ch2\] channel\_2.wav ffmpeg -y -i input.mxf \\ -filter\_complex "\[0:a\]asplit=2\[a1\]\[a2\];\[a1\]pan=mono|c0=c0\[ch1\];\[a2\]pan=mono|c0=c1\[ch2\]" \\ -map \[ch1\] channel\_1.wav \\ -map \[ch2\] channel\_2.wav   As shown above, we apply the common operations early in the graph and try to reuse the filters whenever possible. For example, we reuse format, yadifand aresample filters for the HD and SD outputs, but do the scaling for them separately since they require different dimensions. In addition, we do a horizontal flip with hflip for the SD output only, just for fun! On the other hand, the thumbnails share some common filters (deinterlacing with yadif) with the video filters, but then needs fps and scale to adjust the frame rate and size specific to thumbnails only. Conclusion FFmpeg supports a vast collection of many other filters which can be combined to implement a lot of advanced requirements. But I hope the above examples are helpful to understand the basics and get started with this versatile and extremely powerful tool. If you are interested to learn more, here is a short FFmpeg course on Udemy, with concepts explained with easy diagrams and step-by-step hands-on demo videos with lots of practical use cases and examples. Happy transcoding!

**Syed Andaleeb Roomy**09 Apr 2024 Read →

[![](https://www.craftsmensoftware.com/hubfs/Setting-Up-a-NodeJsTypeScript-CICD-Pipeline-for-AWS-Lambda-Using-GitHub-Action-and-Serverless.webp)](https://www.craftsmensoftware.com/blog/setting-up-a-nodejs/typescript-ci/cd-pipeline-for-aws-lambda-using-github-action-and-serverless)

### [Setting Up a NodeJs/TypeScript CI/CD Pipeline for AWS Lambda Using GitHub Action and Serverless](https://www.craftsmensoftware.com/blog/setting-up-a-nodejs/typescript-ci/cd-pipeline-for-aws-lambda-using-github-action-and-serverless)

Introduction When working with an AWS Lambda project, it’s common to change your code locally, and then upload it on AWS daily or at least a weekly basis. It’s very much true for projects that are medium or large and where new features and bugfixes are constantly being added. A CI/CD pipeline can help a lot in these cases, as the developers don’t have to push the code on AWS manually and don’t have to worry about stuff related to pushing. They can just do their work and forget about the unnecessary things. And it’s also very easy to create such a pipeline just using GitHub Actions and Serverless Framework.

**Asif Imtiaj Safi**05 Apr 2024 Read →

[![](https://www.craftsmensoftware.com/hubfs/Imported_Blog_Media/Customizing-Cognito-verification-emails-with-HTML-using-AWS-Lambda.webp)](https://www.craftsmensoftware.com/blog/customizing-cognito-verification-emails-with-html-using-aws-lambda)

### [Customizing Cognito verification emails with HTML using AWS Lambda](https://www.craftsmensoftware.com/blog/customizing-cognito-verification-emails-with-html-using-aws-lambda)

This has become very common to use AWS Cognito as an authentication system in modern days. Using Cognito, when a user signs up or gets an invitation from another user, he gets an email with password and verification codes. But the email is in simple plain text. But we can easily configure a lambda function that can customize and beautify this email according to our needs. To configure the lambda, first, we have to understand the states when we can actually trigger a lambda from Cognito. These states are (source): CustomMessage\_SignUp : Custom message — To send the confirmation code post-sign-up. CustomMessage\_AdminCreateUser : Custom message — To send the temporary password to a new user. CustomMessage\_ResendCode : Custom message — To resend the confirmation code to an existing user. CustomMessage\_ForgotPassword : Custom message — To send the confirmation code for Forgot Password request. CustomMessage\_UpdateUserAttribute : Custom message — When a user’s email or phone number is changed, this trigger sends a verification code automatically to the user. Cannot be used for other attributes. CustomMessage\_VerifyUserAttribute : Custom message — This trigger sends a verification code to the user when they manually request it for a new email or phone number. CustomMessage\_Authentication : Custom message — To send MFA code during authentication. For convenience, we will only focus on the first two and hope that you can easily configure for the others. Now let’s configure the lambda. Go to the Lambda console and click create a function and give it a name and node version then create it. Now for the code part, follow the below:   Let’s go through the code. The event in the lambda will contain all the things we need for an email. event.triggerSource will contain the states described above. So based on this trigger source, we will construct different email template. You can see in the code that two functions template and templateInvite actually return some HTML code as a string. One thing to remember that you should use inline CSS in the HTML, otherwise there may be some problems. Another thing to notice that, for the CustomMessage\_AdminCreateUser state, always use the email addresses from the event.request.usernameParameter, otherwise Cognito will throw a silent error and you will not be able to debug what is actually happened. And always include only the body tag of the HTML. You can see in the code I have done that. Now, let’s configure the Cognito to call this lambda whenever a new user is registered. Go to your Cognito user pool console, and click on the Trigger from the menu tab. Now select the lambda function in the Custom message menu just like below: Selecting the lambda in the Cognito trigger Now you will see whenever a new user registers or gets a new invitation, he will get your customize mail. You can actually customize the message for the SMS also in the event.response.smsMessage parameter. Custom email for confirm signup Custom email for the invitation

**Abul Hasnat**03 Apr 2024 Read →

[![](https://www.craftsmensoftware.com/hubfs/Imported_Blog_Media/AWS_Lambda_Function_in_Golang.webp)](https://www.craftsmensoftware.com/blog/aws-lambda-function-in-golang)

### [AWS Lambda Function in GoLang](https://www.craftsmensoftware.com/blog/aws-lambda-function-in-golang)

AWS Lambda is a well known and great cloud Function as a Service (FaaS). And Google’s GoLang is a statically typed, compiled programming language. It is widely popular for it is being super fast and it’s built-in concurrency. In this blog post, we will discuss how we can use GoLang in the AWS Lambda function. In this demonstration, I’m using Go1.15. Following things are assumed: You know how to setup GoLang for development in Unix systems You are familiar with AWS Lambda As Go is a compiled language, we cannot use the Lambda Function’s editor to edit the GoLang source code which we can do it in the case of scripting languages like Python, NodeJS, etc. In the case of Go, we will build the main function’s (the main function starts the lambda handler) file (cmd/main.go) which will create a compiled executable that is to be deployed to AWS Lambda. Let’s see step by step how a GoLang function can be created and deployed to AWS Lambda. We will use the following project structure in this demo, but you can use any structure at your convenience. Copy lambda-function-in-golang/ cmd/ main.go main\_test.go ... deploy/ ... scripts/ ... go.mod go.sum lambda-function-in-golang/ cmd/ main.go main\_test.go ... deploy/ ... scripts/ ... go.mod go.sum   Lambda Handler Let’s look at how cmd/main.go look like: Copy package main import ( "fmt" "github.com/aws/aws-lambda-go/lambda" ) type LambdaEvent struct { Name string \`json:"name"\` Age int \`json:"age"\` } type LambdaResponse struct { Message string \`json:"message"\` } func LambdaHandler(event LambdaEvent) (LambdaResponse, error) { return LambdaResponse { Message: fmt.Sprintf("%s is %d years old.", event.Name, event.Age), }, nil } func main () { lambda.Start(LambdaHandler) } package main import ( "fmt" "github.com/aws/aws-lambda-go/lambda" ) type LambdaEvent struct { Name string \`json:"name"\` Age int \`json:"age"\` } type LambdaResponse struct { Message string \`json:"message"\` } func LambdaHandler(event LambdaEvent) (LambdaResponse, error) { return LambdaResponse { Message: fmt.Sprintf("%s is %d years old.", event.Name, event.Age), }, nil } func main () { lambda.Start(LambdaHandler) }   github.com/aws/aws-lambda-go/lambda is the AWS SDK for GoLang. LambdaEvent is used to store the event and this is a custom event. Instead of using this custom event, different AWS service specific events can be used. For AWS service specific events, github.com/aws/aws-lambda-go/events this package can be used. LambdaResponse is used to store the response to be returned. Some rules regarding the Lambda Handler are as follows: The Handler must be a function. The handler may take 0 to 2 arguments. If there is only one argument, it can be the context. Context, or an event from github.com/aws/aws-lambda-go/events this package or any custom event. If there are 2 arguments used, the first one must be context.Context. The handler may return 0 to 2 value. If there is only one value, it must implement error. If there are 2 return values, the second value must implement error. Valid Lambda Handler function signature: func () func () error func () (TOut, error) func (TIn), error func (context.Context) error func (TIn) (TOut, error) func (context.Context) (TOut, error) func (context.Context, TIn) error func (context.Context, TIn) (TOut, error) Here, TIn and TOut represent the event and response respectively. NOTE: Global variables that are independent of your Lambda function’s handler code can be declared and modified. The handler may declare an init a function that is executed when your handler is loaded. Create Compiled Executable And Prepare It For AWS Lambda To build the executable, run the following command in the project root directory. GOOS=linux go build cmd/main.go GOOS=linux will ensure that the compiled executable is Linux environment compatible, even if it is built/compiled in a non-Linux environment. This command will create a compiled executable named main in the project root directory. Zip the compiled executable main. zip function.zip main Create The Function Create the lambda function using the following command. Copy aws lambda --profile craftsmen --region us-east-2 create-function --function-name lambda-go --runtime go1.x --zip-file fileb://function.zip --handler main --role arn:aws:iam::{account-id}:role/service-role/basic\_lambda\_execution aws lambda --profile craftsmen --region us-east-2 create-function --function-name lambda-go --runtime go1.x --zip-file fileb://function.zip --handler main --role arn:aws:iam::{account-id}:role/service-role/basic\_lambda\_execution Replace {account-id} in the above command with your actual account id. You can use your own role ARN too. Test The Function Configure test event as follows Copy { "name": "Rayhan", "age": 25 } { "name": "Rayhan", "age": 25 } Test the function. This will give { “message”: “Rayhan is 25 years old.” } as a response. Lambda Layers You may wonder that external package(s) (AWS GoLang SDK) has been used, but there are no Lambda Layers for the external packages. Actually, when the application is compiled, the compiled executable includes all the external packages used. To get benefit from the AWS Lambda Layer, GoLang Plugins can be used. Golang Plugins is the feature released in the Go1.8. It allows you to dynamically load shared libraries (.so files). It gives you an opportunity to export some of your code to a separate library or use the plugin prepared and compiled by someone else. The full project source code along with the Terraform configuration can be found HERE. Stay in Peace and Keep Coding!!! References Building Lambda functions with Go AWS Lambda function handler in Go AWS Lambda deployment package in Go How to build pluggable Golang application and benefit from AWS Lambda Layers.

**Mahmood Al Raihan**03 Apr 2024 Read →

[![](https://www.craftsmensoftware.com/hubfs/Cool_new_features_in_Python_3.9.webp)](https://www.craftsmensoftware.com/blog/explore-the-cool-new-features-of-python-3.9-including-type-hinting-improved-string-functions-and-more-efficient-data-handling)

### [Some Cool New Features of Python 3.9](https://www.craftsmensoftware.com/blog/explore-the-cool-new-features-of-python-3.9-including-type-hinting-improved-string-functions-and-more-efficient-data-handling)

Python 3.9 is released on 5th October 2020 and is now available. It comes with some of the great features and lots of improvements. In this article, we will explore some of its cool features. To know more about what is coming with Python 3.9 visit this page. And if you wish to see the full changelog then go here.

**Md. Nahidur Rahman**01 Apr 2024 Read →

[←](https://www.craftsmensoftware.com/blog/page/6#articles) [1](https://www.craftsmensoftware.com/blog/#articles) … [6](https://www.craftsmensoftware.com/blog/page/6#articles)

7

[8](https://www.craftsmensoftware.com/blog/page/8#articles) … [11](https://www.craftsmensoftware.com/blog/page/11#articles) [→](https://www.craftsmensoftware.com/blog/page/8#articles)

## Looking for A Trusted AI-native Partner?

Our engineers work inside your product team, bringing broadcast experience and AI-native workflows. Let’s talk about your platform, your roadmap and where you need support.

[Book a Strategy Call →](https://www.craftsmensoftware.com/contact-us)

[![Mahmudul Haque Azad](https://www.craftsmensoftware.com/hs-fs/hubfs/Azad_bhai_new_DP__grey_BG.png?width=58&height=58&name=Azad_bhai_new_DP__grey_BG.png) Book Free 1:1 with Mahmudul Haque Azad CEO & Janitor, Craftsmen](https://www.craftsmensoftware.com/contact-us)

![](https://www.craftsmensoftware.com/hs-fs/hubfs/Azad_bhai_new_DP__grey_BG.png?width=46&height=46&name=Azad_bhai_new_DP__grey_BG.png)

Book Free 1:1 with Mahmudul Haque Azad

CEO & Janitor, Craftsmen

Loading calendar…

### ABOUT CRAFTSMEN

[The Team](https://www.craftsmensoftware.com/about-us)[Our Partnership Model](https://www.craftsmensoftware.com/how-we-work)[Client Stories](https://www.craftsmensoftware.com/client-success-stories)[Career](https://careers.craftsmensoftware.com/)[FAQ](https://www.craftsmensoftware.com/faq)[Privacy Policy](https://www.craftsmensoftware.com/privacy-policy)

<https://www.linkedin.com/company/craftsmensoftware/><https://www.youtube.com/@craftsmensoftware>

### HEADQUARTERS

Craftsmen UK

One Sovereign Quay, Bridge End, Leeds, West Yorkshire LS1 4AG, United Kingdom

### OPERATIONAL HUB

Craftsmen Bangladesh

Plot # 316, Lane # 4, DOHS Baridhara, Dhaka 1206, Bangladesh

### SALES & PARTNERSHIP

Craftsmen Norway

Kong Oscars gate 66, 68, 5017 Bergen, Norway

Craftsmen France

6 Avenue Pierre Grenier, 92100 Boulogne-Billancourt, Paris, France

### A TEAM YOU CAN TRUST

[![ISO 9001 certified](https://crafty-astro-2-0.skarif2.workers.dev/_astro/iso-9001.rB3N1YoH_19riAQ.webp)](https://www.craftsmensoftware.com/trust-centre)[![ISO 27001 certified](https://crafty-astro-2-0.skarif2.workers.dev/_astro/iso-27001.Ds31wC1E_Z2lNtpQ.webp)](https://www.craftsmensoftware.com/trust-centre)[![ISO 27701 certified](https://crafty-astro-2-0.skarif2.workers.dev/_astro/iso-27701.qBI_Bjkt_Z1J5MRi.webp)](https://www.craftsmensoftware.com/trust-centre)

[![Glassdoor reviews](https://crafty-astro-2-0.skarif2.workers.dev/_astro/glassdoor.C76Qo6k3_Z1Br5vs.webp)](https://www.glassdoor.com/Overview/Working-at-Craftsmen-EI_IE3004266.11,20.htm)[![GoodFirms, top software development company in Bangladesh](https://crafty-astro-2-0.skarif2.workers.dev/_astro/goodfirms.CJaHzqAg_1xfRU9.webp)](https://www.craftsmensoftware.com/blog/craftsmen-thrives-at-goodfirms-by-offering-scalable-robust-software-solutions-developed-with-quality-by-maestros)

© 2026 Craftsmen. All rights reserved.

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://www.craftsmensoftware.com/#organization",
  "@type" : "Organization",
  "address" : {
    "@type" : "PostalAddress",
    "addressCountry" : "GB",
    "addressLocality" : "Leeds",
    "addressRegion" : "West Yorkshire",
    "postalCode" : "LS1 4AG",
    "streetAddress" : "One Sovereign Quay, Bridge End"
  },
  "alternateName" : "Craftsmen Software",
  "areaServed" : [ "Norway", "Sweden", "United Kingdom", "Germany", "Spain", "United States" ],
  "contactPoint" : {
    "@type" : "ContactPoint",
    "availableLanguage" : [ "English", "Norwegian" ],
    "contactType" : "sales",
    "url" : "https://www.craftsmensoftware.com/contact-us"
  },
  "description" : "Craftsmen is an AI-native software engineering partner. We build dedicated engineering teams for companies in Europe and the US, and have worked with media and broadcast technology companies since 2011.",
  "founder" : {
    "@type" : "Person",
    "jobTitle" : "Founder & CEO",
    "name" : "Mahmudul Haque Azad"
  },
  "knowsAbout" : [ "Software team extension", "Dedicated software engineering teams", "Media and broadcast software", "Live streaming engineering", "Cloud-native engineering on AWS", "Legacy software modernisation" ],
  "legalName" : "Craftsmen Ltd.",
  "location" : [ {
    "@type" : "Place",
    "address" : {
      "@type" : "PostalAddress",
      "addressCountry" : "GB",
      "addressLocality" : "Leeds",
      "addressRegion" : "West Yorkshire",
      "postalCode" : "LS1 4AG",
      "streetAddress" : "One Sovereign Quay, Bridge End"
    },
    "name" : "Craftsmen UK (headquarters)"
  }, {
    "@type" : "Place",
    "address" : {
      "@type" : "PostalAddress",
      "addressCountry" : "NO",
      "addressLocality" : "Bergen",
      "postalCode" : "5017",
      "streetAddress" : "Kong Oscars gate 66, 68"
    },
    "name" : "Craftsmen Norway"
  }, {
    "@type" : "Place",
    "address" : {
      "@type" : "PostalAddress",
      "addressCountry" : "FR",
      "addressLocality" : "Boulogne-Billancourt",
      "postalCode" : "92100",
      "streetAddress" : "6 Avenue Pierre Grenier"
    },
    "name" : "Craftsmen France"
  }, {
    "@type" : "Place",
    "address" : {
      "@type" : "PostalAddress",
      "addressCountry" : "BD",
      "addressLocality" : "Dhaka",
      "postalCode" : "1206",
      "streetAddress" : "Plot # 316, Lane # 4, DOHS Baridhara"
    },
    "name" : "Craftsmen Bangladesh (operational hub)"
  } ],
  "logo" : "https://www.craftsmensoftware.com/hubfs/Craftsmen%20Logo_Black.png",
  "name" : "Craftsmen",
  "sameAs" : [ "https://www.linkedin.com/company/craftsmensoftware/", "https://www.facebook.com/craftsmenltd", "https://www.youtube.com/@craftsmensoftware" ],
  "url" : "https://www.craftsmensoftware.com/"
}
```

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://www.craftsmensoftware.com/#website",
  "@type" : "WebSite",
  "inLanguage" : [ "en", "nb" ],
  "name" : "Craftsmen",
  "publisher" : {
    "@id" : "https://www.craftsmensoftware.com/#organization"
  },
  "url" : "https://www.craftsmensoftware.com/"
}
```