Mark Iafrate, Author at ProdSens.live https://prodsens.live/author/mark-iafrate/ News for Project Managers - PMI Tue, 21 May 2024 11:20:11 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://prodsens.live/wp-content/uploads/2022/09/prod.png Mark Iafrate, Author at ProdSens.live https://prodsens.live/author/mark-iafrate/ 32 32 What Most Brands Miss With User Testing (That Costs Them Conversions) https://prodsens.live/2024/05/21/what-most-brands-miss-with-user-testing-that-costs-them-conversions/?utm_source=rss&utm_medium=rss&utm_campaign=what-most-brands-miss-with-user-testing-that-costs-them-conversions https://prodsens.live/2024/05/21/what-most-brands-miss-with-user-testing-that-costs-them-conversions/#respond Tue, 21 May 2024 11:20:11 +0000 https://prodsens.live/2024/05/21/what-most-brands-miss-with-user-testing-that-costs-them-conversions/ what-most-brands-miss-with-user-testing-(that-costs-them-conversions)

I’m an inclusive marketing consultant and the founder of Thompson Media Group. A former client of mine recently…

The post What Most Brands Miss With User Testing (That Costs Them Conversions) appeared first on ProdSens.live.

]]>
what-most-brands-miss-with-user-testing-(that-costs-them-conversions)

I’m an inclusive marketing consultant and the founder of Thompson Media Group. A former client of mine recently forwarded me an email he’d received from a market insights company he’s subscribed to. The insights the company had included in this particular email was about “The Top 5 Ranked TV Sitcoms in U.S. History” according to consumers. My client’s message to me was one of disbelief at the results, writing, “According to who?”. He couldn’t believe a representative base of respondents came up with the very homogenous top 5 list.

For my client, his questioning the results presented in the email caused friction in his mind. That friction resulted in him doubting the methodology and as a result the credibility of the company sending the email.

Like that company, a lot of brands have unnecessary friction in the customer experiences they deliver. That friction negatively impacts those brands’ conversions.

Free Download: A/B Testing Guide and Kit

Why Brands Struggle to Improve Their Conversion Rates

Brands don’t talk to enough different types of people. As a result, if consumers don’t fit into what is considered to be “mainstream” or “normal,” their experiences aren’t sufficiently reflected or considered in the products, services, and experiences brands deliver.

Friction-filled experiences can make consumers from underrepresented communities hesitate and ultimately decide not to choose the brands they were once considering.

I’ve seen this happen in user testing quite a bit. Brands will take the time to observe how their ideal consumers receive their product, their website, or their sales pages. But because they don’t focus on recruiting people with different identities, they miss out on the opportunity to understand the unique ways consumers with different identities go about making decisions.

I always like to remind my clients — your customer base is more diverse than you think. Just because you may focus your energy on defining who you serve based upon psychographics and specific qualifying criteria, doesn’t mean they don’t have a variety of identities that influence what they do and don’t purchase.

For instance, my husband, who is a Spanish speaker, chose his mobile phone company purely based on the fact that the guy who works in the local store closest to our house, speaks Spanish. That wasn’t the case for the competitor with the store across the street. For him, it was better to choose an option where he knows he can seamlessly get his needs met in person, in the language he prefers. In this instance, my husband’s identity as a Spanish speaker was the primary factor in his user experience, and ultimately his purchase decision.

Below are some common ways the people you want to serve are different. As you design and gather feedback on the products, services, and experiences you deliver, it’s helpful to keep these differences, and the corresponding identities and communities connected to them, in mind.

Consumer differences graph

Remember, when consumers are considering your brand as a solution to their problem, they are often looking to answer this important question: do people like me achieve success here?

As I’ve worked with brands of all sizes across industries to grow bigger and more diverse customer bases over the years, one thing that has always been clear is that people with identities from underrepresented and underserved communities experience friction at higher rates than other consumers.

Here are a few examples of friction consumers shared with me during user testing sessions on various brands’ website and social media channels:

  • A gay man expressed frustration with a hotel’s website because the information he needed to let him know he would be safe there was buried in the website’s footer under an obscure label
  • A woman with disabilities told me she wished an ecommerce brand wouldn’t put all their headings and subheads in all caps because it’s difficult for people with cognitive disorders to read
  • A woman who follows a gluten-free diet shared that although she was happy a restaurant posted an allergen-friendly menu on its website, she wished it wasn’t in table format because they are harder to read because of all the scrolling involved
  • A Black woman told me she absolutely would not work with a wedding photographer after looking at her Instagram portfolio and not seeing any clients who looked like her
  • And a Spanish speaker told me he felt like a brand was saying “You’re not important” when they buried the link to access the Spanish language version of their website in the footer, rather than placing it at the top of the page

In some of these cases, the brands had already done the work of making sure they were serving the needs of people from underrepresented and underserved communities. But those experiences were friction-filled, which made it harder for the consumer to take the next step forward with the brand, which diminished their conversions.

User testing that specifically incorporated people with these identities would have helped the brand identify ways to eliminate the friction these consumers experienced.

In this episode of the Inclusion & Marketing podcast, I cover more in-depth ways brands can go about being inclusive with their conversion rate optimization efforts such as leaning into relatability with your messaging:

How to Get Identity-Based Insights in User Testing That Improve Conversions

As you’re working to increase your conversion rates, it’s helpful to have a solid understanding of what’s at the heart of the friction your audience is experiencing with your brand.

User testing isn’t the place to learn all the cultural intelligence and insights needed about your ideal customers who are part of underrepresented and underserved communities.

Instead, during inclusive user testing with a broader customer base, aim to implement what you know about your customers without creating any unnecessary friction for them.

When I do user testing, I recommend that clients focus on asking people to go through the website the same way they always would when gathering information, then talking me through their choices as they go.

And as you’re talking to different consumers, focus on getting answers to these two questions.

Is there anything different about their decision-making process that’s based on their identity?

Different people have different needs based on their identity. And as consumers from underrepresented and underserved communities are going through your customer experience, it‘s helpful to understand the process and key questions they look for. They’re often looking for answers that let them know, “This brand is for people like me.”

Common factors that impact decision-making to a higher degree for people from marginalized communities include:

  • Values
  • Safety
  • Availability
  • Representation
  • Accessibility

For instance, I follow a gluten-free diet for health reasons. As such “availability” of food I can safely eat (and actually want to eat), is high on my priority list when choosing a restaurant. My need to know there are food options for me is higher due to my identity than it is for someone without any dietary restrictions. As such, user testing will reflect my elevated need to find this information easily on a restaurant’s website.

In this video, a Black gay man walked me through his experience on an ice cream brand’s website. In this interaction, I learned how important it was for him to know if the brand shared his values, and shared them in an easily accessible way.

I did another session with a Black woman for a beauty brand, and she immediately expressed her excitement when she saw that the retailer had highlighted “Black-owned brands.”

Once you know the questions these consumers are looking to have answered, you can identify how to ensure you are giving them what they need in a manner that delivers the least amount of friction.

Are there any friction points that are identity-specific?

If you do user testing with a general population, you often won’t uncover any points of friction that are specific to an underrepresented and underserved community or identity.

That’s why it is important to include people with different identities in your user testing. Then you can identify if there are specific things about their identity that aren’t being served well with the experiences your brand delivers.

For instance, I’ve talked to and have conducted user testing with people who are part of the LGBTQ+ community. They shared with me the friction they experienced when coming across a form like this one that wasn’t gender inclusive.

Diverse form options example

Another great example, from this episode of the Inclusion & Marketing podcast, where I chatted with three neurodivergent consumers. They shared their experiences, preferences, and major friction points when shopping both in stores and online.

I did some user testing with a woman who is hearing impaired. She told me that because of her disability, she often experienced friction when looking for online learning resources for her business. This is because a lot of the time the brands didn’t have any accessibility information listed on their websites or sales pages.

If you want to find out more about some of these friction points before you even get to user testing, it’s a good practice to incorporate talking to a broad cross-section of your customers into your marketing workflow. On this episode of the Inclusion & Marketing podcast, I cover how to do this more in-depth, including how to infuse what you learn into your work.

How to Get Started With Inclusive User Testing

1. Get dialed in on who your customer is.

Where possible, dig into customer data to uncover the identities of the people who are coming to you to solve their problems.

2. Focus on the identities you want to ensure feel like they belong with your brand.

Then, be sure to recruit people who have those identities into your sample any time you engage in user testing.

3. Eliminate friction that already exists in the customer experience you deliver.

You’ll do that by identifying ways to quickly and intuitively demonstrate that people with the identities you’ve chosen to serve do indeed belong with you.

It’s Time to Increase Your Brand’s Conversions

Make what you’ve already created work harder for you.

Optimize your conversions by engaging in user testing with a broader diversity of your ideal customers. When you work to cut out the friction consumers experience, particularly as a result of their identity, you’ll make more of the people who engage with your brand feel like they belong with you.

That sense of belonging will lead to higher conversions.

Learn how to run effective A/B experimentation in 2018 here.

The post What Most Brands Miss With User Testing (That Costs Them Conversions) appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/05/21/what-most-brands-miss-with-user-testing-that-costs-them-conversions/feed/ 0
How to Create a Marketing Calendar You’ll Actually Use https://prodsens.live/2024/05/21/how-to-create-a-marketing-calendar-youll-actually-use/?utm_source=rss&utm_medium=rss&utm_campaign=how-to-create-a-marketing-calendar-youll-actually-use https://prodsens.live/2024/05/21/how-to-create-a-marketing-calendar-youll-actually-use/#respond Tue, 21 May 2024 11:20:10 +0000 https://prodsens.live/2024/05/21/how-to-create-a-marketing-calendar-youll-actually-use/ how-to-create-a-marketing-calendar-you’ll-actually-use

No matter what type of business I’ve worked for over the years, my team has always stressed the…

The post How to Create a Marketing Calendar You’ll Actually Use appeared first on ProdSens.live.

]]>
how-to-create-a-marketing-calendar-you’ll-actually-use

No matter what type of business I’ve worked for over the years, my team has always stressed the importance of a marketing calendar — and then never made one.

A marketing calendar is essential to keeping a team organized and productive, but creating and maintaining one can be intimidating without the right guidance. So, if you’re reading this hanging your head in shame, don’t worry; this is a safe space. And today, we’re breaking the cycle.

Let’s unpack how to create a marketing calendar you’ll actually use.

→ Free Download: Social Media Calendar Template [Access Now]

What is a marketing calendar?

 

A marketing calendar is a schedule of your upcoming marketing activities and important dates. It covers a month, quarter, or even year and documents product launches, social media posts, blog articles, sales, and live events. Social media calendars, content calendars, and event calendars are also examples of types of marketing calendars.

At its core, a marketing calendar is pretty simple. It’s just a schedule of your team’s upcoming marketing activities and important dates. Think of it like a vacation itinerary but with fewer tours and more blog articles — which are way more fun anyway, right?

Some companies may opt for a single marketing calendar, which gives them a high-level overview of everything scheduled in a given month, quarter, or year, while others prefer multiple marketing calendars dedicated to specific activities, like a social media or editorial calendar.

lost-traveler-with-mapImage Source

Any complexity with a marketing calendar (like a vacation itinerary) depends on how detailed your team wants to get and how you plan to use it, but more on that shortly.

What should a marketing calendar include?

Regardless of the finer nuances of your marketing calendar, there are several “big ticket” milestones you should account for no matter what. These include:

  • Campaigns
  • Product Launches
  • Sales
  • Webinars/Live Events
  • Industry Conferences
  • Content Publication
  • Emails
  • Holidays
  • Experiments/Tests

These milestones can dramatically impact buyer behavior. Noting them on a marketing calendar will help you plan and respond accordingly.

Depending on your team’s needs and workflows, you may also want to include details like the platform or channel, project description, assignees, deadlines, status, and resource links on your marketing calendar — but the type of marketing calendar often dictates this.

Types of Marketing Calendars

In my experience, many teams benefit from activity-specific marketing calendars rather than just one general calendar.

With all of the activities that fall under marketing, activity-specific calendars clear out noise so you can focus on the right information at the right time. Having different types of marketing calendars also gives accountable teams more freedom to customize the calendar as needed.

For example, my marketing career has almost always revolved around an editorial or content calendar. “Sorry, can’t do lunch. I have to schedule an article for tomorrow,” was a common sound bite for me.

hubspot-marketing-calendar

A peek at my content calendar in HubSpot circa 2017. Image Source

Every month, I published 15-20 blog articles per week, so a dedicated editorial calendar was a must. I created a calendar with the upcoming titles and their editorial/SEO guidelines, publish dates, URLs, draft deadlines, assigned writers, and campaigns.

As the month progressed, I reviewed this calendar daily to know what was coming up, what was complete, and what was up next. It was the best way to keep my work organized, offer transparency, communicate with my writers and stakeholders, and keep the company’s blog running smoothly.

But this is just one type of marketing calendar you may find valuable.

Some other popular marketing calendars include:

  • Campaign Calendar: This high-level calendar shows every major campaign you’re running during a specific period. Campaigns could be centered on the launch of a new product, a holiday, or even a content offer. The items on this calendar will likely determine milestones on your activity-specific calendars (i.e., If you’re launching a new research report, you may put a related blog article on your editorial calendar or a promotional email on your email calendar).
  • Events Calendar: Do you host a lot of webinars? How about in-person events? This is the place for them. Like your campaigns, events often have related activities that show up on your other calendars. Take HubSpot’s INBOUND event. While the INBOUND Team has its own events calendar, the HubSpot Blog Team also has INBOUND-related content we track on our editorial calendar.
  • Email Calendar: Email marketing is far from dead. With this calendar, you’ll see what emails you’re sending and when to avoid spamming your audience. This calendar should include the send dates and times, audiences, and campaigns attached to each email. Tapping our INBOUND example again, this is the calendar that would make sure we aren’t hitting contacts with a sales pitch too frequently.
  • Editorial or Content Calendar: This is a schedule of the content you publish, likely your blog. Like mine, I’d recommend it include publish dates, draft deadlines, authors, and campaign information. Depending on your strategy, you may want something similar for podcasts and videos.
  • Social Media Calendar: This is a schedule of what you’re publishing on social media and when. If your volume is high, you may want to get even more granular, with calendars specific to Instagram, TikTok, LinkedIn, etc. This makes it easier to see exactly what’s going on each platform to avoid over-posting.

Pro tip: HubSpot has a social media calendar template to get you started, or you can try these social media calendar tools.

Why use a marketing calendar?

marketing-calendar-benefits-supported-by-statistic

According to CoSchedule, marketers who are proactive planners are three times more likely to report success than those who aren’t. As a planner, this is enough to get me on board with using a marketing calendar, but some teams need more convincing. Thankfully, marketing calendars come with many benefits:

Identifying Priorities

Not sure what to work on? Marketing calendars are one of the easiest ways to identify work priorities.

When you’re stuck, just take a peek at your marketing calendar to see what’s on the horizon (I’d recommend looking one to two weeks ahead). This will give you a better idea of what tasks are time-sensitive and need to be done to stay on track.

To illustrate, let’s say it’s the last week of November and your business usually runs a big sale for the holiday season. Noting the sale on your marketing calendar reminds you to prioritize email promotion, social media posts, and any other activities leading up to the December launch.

Encourages Proactivity

On a related note, a marketing calendar can help your team stay proactive. When something is noted on a marketing calendar, it’s less likely to “sneak up on you.” You’ll see it regularly and be encouraged to work ahead, space out tasks to meet your deadlines, and avoid working on something last minute.

Team Alignment

With so many moving pieces, it can be difficult for marketing teams to stay on the same page. A marketing calendar creates one source of truth for your most important information and priorities.

If the product team is releasing a new feature to your offering, for instance, having the launch on your marketing calendar will flag it as something important everyone should be aware of. It also lets the team know support may be needed from content or social media to hit this milestone.

We recently went through this at HubSpot with the launch of Spotlight. Spotlight is HubSpot’s bi-annual product showcase, which brings together our latest innovations across the customer platform into one visually engaging web experience for our audience.

With its inaugural release in April 2024, the product team developed a comprehensive marketing plan to tap other teams, but they tracked progress on their own calendar.

Organization

Perhaps this goes without saying, but the biggest reason to use a marketing calendar is to keep you organized. It brings together your most vital information in a clear, easy-to-understand format and communicates priorities at a glance.

Without an up-to-date marketing calendar, crucial tasks may be more likely to be forgotten or done haphazardly.

 

How to Create a Marketing Calendar

Ok, here’s the hard part: Actually creating your marketing calendar.

Developing a marketing calendar takes time and careful consideration to guarantee nothing important is missed. To make this a little less intimidating, I’ve broken down five steps to help you get started.

While it may not be possible to forecast all activities a year ahead, I suggest starting with the big picture and then zooming in on the next quarter and month.

Mapping out marketing plans monthly or quarterly provides more flexibility and adaptability for things the world might not see coming. (Like oh, I don’t know, the COVID-19 pandemic.)

Let’s start from the top.

1. Identify your key dates and milestones.

Of course, the first step in creating your marketing calendar is deciding what should be included.

Marketing handles so many different tasks it’s easy to forget something, so don’t do this in a vacuum.

Consult with stakeholders and representatives from your major marketing departments about what needs to go on your marketing calendar (e.g., product marketing, comarketing, or partnerships). Take note of the items we discussed earlier, including product launches, holidays, industry events, sales, and other significant instances that will impact your marketing campaigns.

For this step, I recommend covering big milestones already determined for the entire year. At the start of each quarter and month, you can revisit and refine events as needed.

2. Set your functional goals.

With your landmarks locked in, ask yourself what you hope to get from your marketing calendar. What do you want to accomplish with it? What do you want it to do for you?

Your answers to these questions will dictate what should be included in your marketing calendars and how refined they should be.

Functional goals may be things like being able to:

  • Tag assignees
  • View assignments that haven’t been completed yet
  • Click out to view live posts
  • Share links to copy and assets that go along with a calendar item

The HubSpot Blog Editorial Calendar on Asana allows our team to see these details and many more.

HubSpot Editorial Calendar is hosted on Asana showcasing many crucial assignment details

It’s smart to consult other leaders and implementors to understand their goals. They’ll use your marketing calendar most frequently, so you want it to be useful to them. Talk to your writers, video producers, social media managers, event planners, designers, and anyone else getting their hands dirty.

What might this look like? Well, let’s say your social media team would love a marketing calendar that documents all of their content and tracks what’s gone out. Knowing this, you’ll create a dedicated social media calendar that includes details on the platform, assignee, creative, copy, and even links to published pieces.

3. Break down your key dates into touchpoints/needs.

Now we’re getting into the nitty gritty with tactics. I recommend zooming in to your nearest quarter or even month. Getting granular with something more than three months away is a bit of a reach, so keeping timelines short will help keep them realistic.

Ask yourself what each of your upcoming milestones will entail. What promotional assets will they need? What teams will you need to tap?

Of course, you won’t know exactly what your marketing push will look like — heck, maybe there will be some new, funky trend you’ll want to try out — but having a vague idea of the workload will be helpful in creating a timeline.

For instance, during HubSpot’s Spotlight launch, our product team had a comprehensive content plan leading up to the big day, including videos and emails.

Spotlight promotion included videos like this on LinkedIn featuring HubSpot Head of Product Andrew Pitre.

The team also created a comprehensive social media kit to help others at HubSpot spread the word.

HubSpot’s marketing calendar for the launch of Spotlight included a variety of marketing plays including an internal social media kit for HubSpot employees.

Think about social media, blogging, email marketing, advertising, video marketing, and other common levers you pull in large campaigns. Jot these down for each of your milestones.

4. Establish rough timelines and schedules.

You have your key dates and potential to-dos, now it’s time to actually get them on a schedule!

Considering the average time it takes to plan and create deliverables, develop a rough timeline for each key date, and map them for the weeks and months ahead.

Be mindful of team bandwidth and avoid overloading or overlapping multiple projects. Even if something is noted in advance, that doesn’t mean your team will magically be able to do double the work.

If you find yourself facing a ton of overlap, note that you need to address and solve the bandwidth issue when those timelines begin.

5. Document your schedule in the tool of your choice.

Good news: All the hard stuff is behind you. Congrats!

Now, you’ve just got to make it official.

The final step in creating your marketing calendar is getting all of the key dates and details input into the tool of your choice. This could be as basic as a paper calendar. But for easy sharing, accessibility, and updating (all factors you should look for in a calendar tool), it’s best to go digital.

In our next section, we’ll review some examples and my personal recommendations.

Marketing Calendar Examples

There are many options for formally documenting, sharing, and maintaining your marketing calendar, with varying complexity. To help guide you, I’ll walk through some popular solutions and my recommendations.

Simple Spreadsheet

Suppose you’re looking for a simple, low-budget option. In that case, you can create your marketing calendar in a simple spreadsheet using Microsoft Excel or Google Sheets (The HubSpot Blog used G-Cal as their editorial calendar for an embarrasingly long time).

Let’s look at an example from the integration tool Zapier:

Social media marketing calendar's can be as simple as a Excel or Google Sheets spreadsheet.

Image Source

In this straightforward, no-frills design for a content marketing calendar, you’ll see columns for:

  • Month
  • Content type
  • Topic/Title
  • Author
  • Publish date
  • Promotion channels
  • Key metrics
  • Notes
  • Links

It’s easy to find and update the information you need without being too technical. Something like this is great for getting started and could easily be adapted to your needs.

Note: While not a traditional 30-day calendar view, you can sort the “publish date” column chronologically to ensure you view things in order.

HubSpot offers similar spreadsheet templates for a social media calendar and editorial calendar. Check them out!

HubSpot Calendar

Speaking of HubSpot, you’re one lucky marketer if you’re a HubSpot Professional or Enterprise user. In your HubSpot portal, you’ll find my favorite tool for creating a marketing calendar using HubSpot Calendar.

HubSpot's marketing calendar offers a variety of task filters

Image Source

HubSpot Calendar is an easy-to-use digital marketing calendar you’ll find in your Portal (Marketing > Campaigns).

With it, you can add tasks for blog articles (like I did back in my day), emails, landing pages, or custom needs and easily mark them complete after they’re done.

HubSpot's marketing calendar shows a variety of task details

This marketing calendar can be viewed by day, week, month, or even as a chronological list. It displays items color-coded by campaign and different icons, so it’s a breeze to know what’s happening at a glance.

HubSpot's marketing calendar color codes campaigns

In my opinion, if most of your marketing activities are done through HubSpot, HubSpot Calendar is the most efficient and convenient option for creating your marketing calendar.

Why? Not only can you create tasks for your most common activities, but you can automatically view other activities completed on the platform, like social media ads and website pages.

Unlike other calendar tools where your activities are likely being completed on external platforms, HubSpot gives you a truly holistic view of all your efforts. You can also easily access the completed assets from the calendar.

Third-Party Apps

If you’re not a HubSpot user, and a spreadsheet isn’t your style, plenty of other calendar tools can get the job done.

In the past, I’ve used ClickUp and Trello (another favorite), but Asana and Monday are also popular options.

If you’re using a third-party app or software for your marketing tasks, there’s also a good chance it has a built-in calendar tool to help keep you organized. Sprout Social, for example, has a built-in social media calendar for its users.

Regardless of the solution you choose, make sure that it is:

  • Easy to use/update
  • Shareable
  • Accomplishes all of your functional goals

Schedule and stick with it!

It’s not enough just to make a marketing calendar; you’ve got to stick with it.

A marketing calendar is no “set and forget.” It’s a living and breathing document that must be reviewed and updated regularly to actually be useful.

So, I’ll leave you with two important tips for maintaining a marketing calendar:

1. Make reviewing/updating your marketing calendar a part of your routine.

In my experience, your team should always review your marketing calendar at the beginning of the quarter, at the beginning of each month, and then every week. So, work this into your existing meetings and stand-ups.

This routine ensures everyone is on the same page about priorities and what they should work on. It also allows your team to raise flags, ask questions, or discuss changes.

2. Leave room for flexibility.

Let’s face it, life happens. Priorities change, as do tactics, social climates, buyer behaviors, and many other things. So, leave room for flexibility in your marketing calendar.

Just because something was put on the schedule a few months ago doesn’t mean it’s still a good move today. Have regular conversations about what is on your marketing calendar, and be ready and willing to pivot. Agility is key.

With these reminders and the steps outlined above, your team should be ready to usher in a new era of organization and productivity with a marketing calendar. I know I am!

social media content calendar

The post How to Create a Marketing Calendar You’ll Actually Use appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/05/21/how-to-create-a-marketing-calendar-youll-actually-use/feed/ 0
10 Best Design Collaboration Software & Tools for Creatives https://prodsens.live/2024/05/21/10-best-design-collaboration-software-tools-for-creatives/?utm_source=rss&utm_medium=rss&utm_campaign=10-best-design-collaboration-software-tools-for-creatives https://prodsens.live/2024/05/21/10-best-design-collaboration-software-tools-for-creatives/#respond Tue, 21 May 2024 11:20:09 +0000 https://prodsens.live/2024/05/21/10-best-design-collaboration-software-tools-for-creatives/ 10-best-design-collaboration-software-&-tools-for-creatives

Even the most creative people know the most innovative projects get done when you work as a team.…

The post 10 Best Design Collaboration Software & Tools for Creatives appeared first on ProdSens.live.

]]>
10-best-design-collaboration-software-&-tools-for-creatives

Even the most creative people know the most innovative projects get done when you work as a team. However, working as a team can be difficult without the right tools to streamline and organize your workflows while keeping everyone informed.

So, to help you work more efficiently with your team, I rounded 10 of my favorite design collaboration software and tools you can try.

Let’s get into it!

What is design collaboration software?

Best Design Collaboration Tools That I Love

1. Asana
2. InVision
3. Figma
4. Typeform
5. Notion
6. Miro
7. Trello
8. Balsamiq
9. Simplified
10. Visme

Click Here to Get HubSpot's Project Management Tool

With the right collaborative tools and software, you and your team can efficiently collaborate while monitoring projects, ensuring everyone is on the same page.

Now that you know about design collaboration software, let’s dive into different software and tools available to your organization.

And, once you’ve chosen which tool or software you want to use for your next collaborative design project, check out HubSpot’s Content Hub to help you with the creation side of your project.

You can explore our free web design resources for extra inspiration or help.

Best Design Collaboration Tools That I Love

Here are 10 creative collaboration tools I recommend checking out.

1. Asana

I’ve been using Asana for years, and it’s been incredibly helpful in managing my assignments and collaborating with colleagues at HubSpot.

It has a variety of features, such as intuitive work workflows, calendars, and task boards that you can either keep for yourself or loop your team on.

asana-May-17-2024-05-40-24-0158-PMImage source

What I like:

Asana allows users to plan and structure their workflows to their liking. I especially love that I can set deadlines and communicate them to my team members via messages in the platform or automatic email notifications.

Asana also has a card feature that allows you to leave important details and checklists regarding how the assignment should be completed, almost like a virtual flashcard with the assignment on the front and information on the back.

Best for:

Asana is best for teams in which assignments are sent up the ladder to the next person. For example, someone may assign me a blog post in Asana.

Once I complete that blog post, I mark it as completed, and it’s pinged to my colleague for scheduling.

What Users Are Saying:

It‘s me; I’m “users.” I use Asana all the time for work, and I enjoy it. It‘s easy to create detailed cards with assigned tasks and track my and my teammates’ progress through our workflows.

2. InVision

InVision is like a digital whiteboard platform that allows teams to collaborate, share essential project details, and communicate at every step of the design process.

The last thing you want for a project is a fractured team in which some people are unaware of what’s happening.

Invision solves this issue by centralizing your project and enabling your team to collaborate in one place.

invision-1Image source

What I Like:

The platform provides a customizable experience with over 100 templates and allows your users to integrate their favorite tools. This creates a custom workflow that is adaptable to the user’s needs.

Best for:

InVision is best for marketers who want to centralize and manage every aspect of the design process, from ideation to hand-off.

What Users Are Saying:

Users say InVision is very intuitive and easy to use, but creating a prototype can be difficult because it might not always recognize links and buttons on your prototype.

3. Figma

Figma is an impressive all-in-one platform that boasts a variety of tools for different use cases ranging from brainstorming to strategic planning to prototyping and beyond.

Seriously, I was blown away by the resources and tools in Figma’s arsenal.

In addition to the plethora of services Figma offers, it also provides real-time collaboration features to streamline your workflow and centralize your team’s design project.

Figma

Image source

What I Like:

This platform is among the most versatile on this list and boasts features like:

  • unlimited viewers (great for large teams)
  • shareable links
  • private projects
  • Unlimited teams
  • Custom workspaces

Moreover, Figma has a mobile app for Android and iOS, making it ideal for marketers who are constantly on the go.

Best for:

Figma is an excellent option for both individual and team projects. Thanks to its unlimited viewers and team features, it’s ideal for large or cross-functional teams.

What Users Are Saying:

While looking through reviews, I noticed a lot of users calling Figma the best UX/UI design tool, especially for new or non-designers.

4. Typeform

Sometimes, I need feedback from my teammates on a blog post pitch or a project idea. If you’re in the same boat, you can probably send a message in Slack, schedule a 1:1, or request feedback via email.

However, a survey would be more appropriate if your team is large or you need more comprehensive information.

Platforms like Typeform make it simple to create user-friendly survey forms that help you accumulate feedback in a timely fashion.

typeform-May-17-2024-05-53-04-3974-PMImage source

What I Like:

With Typeform, I can create quizzes, polls, or surveys so I can gather feedback from my team, such as what’s working or not working in my project or if teammates are encountering any hiccups.

I especially love that I can add images, GIFs, or other types of media to make my surveys more interesting and engaging.

Best for:

Creating surveys to send out to team members.

What Users Are Saying:

5. Notion

I have mentioned Notion in several other blog posts, and for good reason—I and other creators swear by it.

A while ago, I spoke with blogger, podcaster, and YouTuber Lisa De La Cruz about the productivity and note-taking platform, and she loves it.

“It’s a connected workspace with hundreds of free templates perfect for managing content creation, deadlines, finances, and more,” she said. “The content creation calendar is a game changer, making it easier to take an idea all the way to the finished product seamlessly.”

notion

Image source

What I Like:

Notion is a wonderful platform for storing and organizing screenshots, links, and other media in a Wiki-style layout. This allows you and your team to keep track of references in one place.

You can also customize your Notion layout to accommodate your workflow.

Best for:

The platform is best for saving and organizing references for your team so they can easily be deferred back to when needed.

What Users Are Saying:

Most users praise Notion for its organizational resources. However, they say the mobile app isn’t as optimized as the desktop.

 

6. Miro

Miro is a whiteboard platform that can be most hopeful during a team design project‘s brainstorming and ideation phase.

Multiple people can edit the board at once, and teams can choose from a variety of templates, so they won’t have to spend time creating a layout they love from scratch.

Miro

Image source

What I Like:

Miro is very user-friendly and has an intuitive layout.

Best for:

Miro is best for brainstorming and collaboration among team members.

What Users Are Saying:

Users praise Miro as an exceptional collaboration tool, especially for global teams during brainstorming sessions.

7. Trello

Trello is a work management tool that works similarly to Asana. Like Asana, it includes workflow boards that you can organize to track your projects from start to hand-off.

trello -1Image source

What I Like:

I love tools like Trello because I’m a visual person. Seeing assignments neatly organized into boards that other team members can access and track helps me visualize my workflow.

Like Asana, tasks within workflow boards can be marked “Assigned,” “In Progress,” or “Done,” so team members are all aware of how a project is progressing.

Best for:

Trello works best for teams that use the Kanban approach to their workflow. Kanban means using visual cues to communicate the tasks that need to be done in a workflow.

What Users Are Saying:

Users love how simple Trello is to use since it mainly requires dragging and dropping digital cards from one stage to the next. The platform’s visual elements makes is easy for users to track their progress on just one screen.

However, some users complain that private items and personal notes can be difficult to distinguish from shared boards, meaning team members can wind up receiving notifications for personal tasks that don’t concern them—which can be distracting.

8. Balsamiq

This tool takes a fun approach to organization by utilizing a less aesthetically polished UI that mimics the experience of jotting down information on a notepad or whiteboard.

The low-fidelity approach encourages users to focus less on the visuals of a project and more on its structure and content.

balsamiq Image source

What I Like:

I‘m a sucker for a unique motif, so I love Balsamiq’s “marker-on-a-whiteboard” look. Plus, it’s a great tool for beginner designers who simply need a quick mockup.

Best for:

Balsamiq is excellent for collaborating on design mockups.

What Users Are Saying:

Most user reviews of Balsamiq mention the platform’s “ease of implementation.”

9. Simplified

Simplified is a design software tool that boasts a plethora of collaboration tools as well as AI tools that streamline the design approval process.

What I Like:

Thanks to its intuitive interface, Simplified lives up to its name. Furthermore, it includes unlimited workspaces that allow users to collaborate with as many clients and stakeholders as they need.

simplified Image source

Best for:

If you want a tool that will boost the efficiency and speed of the design approval process, them Simplified could be for you.

What Users Are Saying:

Reviews of Simplified show that users appreciate its free plan, which allows them to use a variety of features at no cost.

Many also say it’s helped them to create more content, such as blog posts, faster and to help them keep track of multiple client-based projects.

10. Visme

Visme is a cloud-based content creation tool that is designed to be intuitive enough for users without design experience.

Visme is especially useful for marketers, creatives, businesses, and educators looking to craft materials such as infographics, social media graphics, and presentations.

visme Image source

What I Like:

Visme allows for role-based permissions, meaning that users can designate different levels of access depending on the roles of team members.

This helps protect sensitive information and ensures some team members aren’t bogged down with details that may not be pertinent to their tasks.

Best for:

Visme is best for crafting visuals that bolster content.

What Users Are Saying:

Many users, like the one below, praise Visme for how easy it is to use and for its unique features, such as the background removal tool. Many found that it’s flexible for use on an individual and team level.

The right design collaboration tool can greatly affect how quickly and efficiently your team completes a creative project. So, make sure you weigh your options and pick the best one for your organization. Good luck!

New Call-to-action

The post 10 Best Design Collaboration Software & Tools for Creatives appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/05/21/10-best-design-collaboration-software-tools-for-creatives/feed/ 0
A Beginner’s Look into Azure Active Directory (Microsoft Entra ID) and Roles with a Simple Exercise https://prodsens.live/2024/05/13/a-beginners-look-into-azure-active-directory-microsoft-entra-id-and-roles-with-a-simple-exercise/?utm_source=rss&utm_medium=rss&utm_campaign=a-beginners-look-into-azure-active-directory-microsoft-entra-id-and-roles-with-a-simple-exercise https://prodsens.live/2024/05/13/a-beginners-look-into-azure-active-directory-microsoft-entra-id-and-roles-with-a-simple-exercise/#respond Mon, 13 May 2024 04:20:04 +0000 https://prodsens.live/2024/05/13/a-beginners-look-into-azure-active-directory-microsoft-entra-id-and-roles-with-a-simple-exercise/ a-beginner’s-look-into-azure-active-directory-(microsoft-entra-id)-and-roles-with-a-simple-exercise

First of all, what is Active Directory? Active Directory is a service that was previewed by Microsoft in…

The post A Beginner’s Look into Azure Active Directory (Microsoft Entra ID) and Roles with a Simple Exercise appeared first on ProdSens.live.

]]>
a-beginner’s-look-into-azure-active-directory-(microsoft-entra-id)-and-roles-with-a-simple-exercise

First of all, what is Active Directory?

Active Directory is a service that was previewed by Microsoft in 1999 has been in use since windows server 2000 edition. It has been a useful service in helping organisations as a Windows domain services tool that allows you to set permissions and make groups for the users and assets in your environment. Active Directory works on premises with the domain controller.

This service is also available in the cloud, for Microsoft Azure it is known as Azure Active Directory (Azure AD) or by its new name Microsoft Entra ID. It is an identity and access management solution from Microsoft that helps organizations secure and manage identities for hybrid and multicloud environments.

Permissions and access management solutions are given based on roles in Azure are assigned using either:

  • Azure Active Directory (Azure AD) Roles is an identity and access management service that enables user and device authentication and authorization across Azure and other integrated applications. Azure Active Directory roles control access to Azure Active Directory resources such as users, groups, and applications.
  • Azure Roles (or Role Based Access Control-RBAC) is a widely used access control model that allows administrators to assign specific roles to Azure users, groups, or service principals.

Azure Roles is responsible for the access to Azure resources while Azure AD Roles controls access to resources in Azure AD (Microsoft Entra ID). These roles have their different purposes, scopes and types of roles you can assign. Below is a table highlighting the differences between Azure Active Directory Roles (Azure AD) and Azure Roles.

Image description

Practical Exercise

Hagital Consulting Ltd has decided to streamline its identity management process by utilizing Microsoft *Entra ID *(Azure Active Directory) to manage its cloud-based identities.

  • Create the Administrative Department and add two users (Grace Peters and Ahmed Johnson) to it.
  • Assign the Global Administrator Role to User A (Grace Peters)
  • Show all the steps it took the Global Admin to Log in into the Azure Portal with Grace Peters new credentials.
  • Let the Global Administrator (Grace Peters) create/onboard a new member (Steven Kalu) to the Admin Department

Let’s go ahead with the exercise.

Prerequisite

First thing login to your Microsoft Azure Portal by going to https://portal.azure.com.

If you do not have an azure account sign up and create an account for free with this link https://azure.microsoft.com/en-us/free/. Registration will require a phone number and a debit or credit card details to validate your account even for the free account. You have a choice between the free or pay as you go account.

Practical Begins

Step 1: Search for Microsoft Entra ID in the search bar at the top of your portal page and Select Microsoft Entra ID.

Image description

You are now in the Default Directory| Overview page.

  • Click Groups under the Manage drop-down menu at the left-hand side of the portal.

Image description

  • Click New group.

Image description
Step 2: The New Group menu create the Administrative Department.

  • Group type: Select Security.
  • Group name: Type Administrative Department
  • Group description: Give a description of the group or you can leave it as is.
  • Membership type: Leave as is.

Image description

  • Members: Click on No members selected

Image description

  • The Add members menu pops up click Users underneath the search bar.

Image description

Select the two new members of this group in this we are picking Grace **and **Ahmed Johnson the click Select at the bottom left of the windows.

Image description

  • You are back to the New Group page click Create at the bottom left of the page.
  • Back at the Groups| All groups page click Refresh then your newly created Administrative Department will show up under the list of groups found.

Image description
Step 2: Assigning Global Administrative role to a member of the created group. We will be giving Grace this role and appoint her as Head of the Admin.

  • Click on Default Directory|Groups to get back to the Default Directory page.

Image description

  • Click on Users under the Manage dropdown menu at the left-hand side of the page.

Image description

  • In the Users page click Grace.

Image description

  • Grace’s User page is now open. Go to the menu at left hand side of the page click on Manage in its dropdown menu click on Assigned roles.

Image description

  • In the Grace|Assigned roles page click on Add assignments.

Image description

  • Directory roles window opens. In the search bar type Global Administrator, select it when it appears and click Add at the bottom of the window.

Image description

  • Click on Refresh once back in Grace|Assigned **roles page, the role will now appear in the list of **Administrative roles she has been given.

Image description

Sign into Grace’s Azure Portal

Step1: Open another browser or your current browser in incognito or Inprivate mode depending on the browser you are using.

Image description

  • Login to Azure using Grace’s credentials.
  • Go and copy Grace User Principal name (UPN) to login to Azure.

Image description

  • Paste it in the Sign in.

Image description

  • Enter the password you gave to the account or the copied out autogenerated password and click Sign In.

Image description

  • Grace will be prompted to Update your password at your first sign in. Change password and click Sign in.

Image description

  • An Action Required prompt will show on screen, for this exercise we will be clicking Ask Later.
  • Stay signed in? prompt comes click Yes.

You are now logged Grace’s User Account.

Image description

Create/Onboard a new member into the Administrative Department with Grace who we have giving the role of Global Administrator.

Step 2: Click Microsoft Entra ID to go into the Default Directory|Overview Page

  • Click on Add
  • In the menu that hover your mouse over User then click on Create new user

Image description

Step 3: In the Create new user page we start with the Basic tab.

  • User principal name: Enter the user’s name
  • Mail nickname: Leave the check box ticked beside the Derive from user principal name
  • Display name: Enter a name
  • Password: You can leave the Auto-generate password ticked but copy the password somewhere you can easily find it or uncheck the box and type in the password yourself.

Image description

  • Click Next: Properties at the bottom of the portal to move to the next tab.

Step 3: We move to the next tab Properties.

  • We start with Identity.
  • First name: Enter Steven
  • Last name: Enter Kalu
  • User type: Leave it as Member.

  • Job Information: We will fill in a few other details

1.** Job title:** Admin Officer

  1. Company name: Higital Consulting Ltd
  2. Department: Administrative
  • Leave everything else as they were and click Next: Assignments at the bottom of the page.

Image description

Step 4: In the Assignments tab. We be adding Steven Kalu to the Administrative Department.

  • Click Add group

Image description

  • In the new window Select group look for and click the check box for Administrative Department we created.

Image description

  • Once done click Select at the bottom of the page.
  • Click Next: Review + create
  • Click Create

You have successfully created a user with Graces Peter’s Portal. You can view the account, Steven Kalu, you just created by going to Default Directory| Overview and click Users under manage. You will be able to see it in both your account you start this exercise with and in Grace Peters’ account.

Image description

In summary, Azure Active Directory (Azure AD) Roles and Azure Roles are important parts of access management in Azure’s ecosystem. As we can see from the simple exercise above it can help an organisation securely and efficiently manage its users/staff and give access and privileges which can be similar to their roles in their organisation.

The post A Beginner’s Look into Azure Active Directory (Microsoft Entra ID) and Roles with a Simple Exercise appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/05/13/a-beginners-look-into-azure-active-directory-microsoft-entra-id-and-roles-with-a-simple-exercise/feed/ 0
Creating AI Apps Using RAG & LangChain: A Step-by-Step Developer Guide! https://prodsens.live/2024/05/08/creating-ai-apps-using-rag-langchain-a-step-by-step-developer-guide/?utm_source=rss&utm_medium=rss&utm_campaign=creating-ai-apps-using-rag-langchain-a-step-by-step-developer-guide https://prodsens.live/2024/05/08/creating-ai-apps-using-rag-langchain-a-step-by-step-developer-guide/#respond Wed, 08 May 2024 10:20:19 +0000 https://prodsens.live/2024/05/08/creating-ai-apps-using-rag-langchain-a-step-by-step-developer-guide/ creating-ai-apps-using-rag-&-langchain:-a-step-by-step-developer-guide!

Today, Large language models (LLMs) have emerged as one of the biggest building blocks of modern AI/ML applications.…

The post Creating AI Apps Using RAG & LangChain: A Step-by-Step Developer Guide! appeared first on ProdSens.live.

]]>
creating-ai-apps-using-rag-&-langchain:-a-step-by-step-developer-guide!

Today, Large language models (LLMs) have emerged as one of the biggest building blocks of modern AI/ML applications. Gone are the days when AI was considered more of a fiction rather than a reality. Every organization is embracing the power of these LLMs to build their personalized applications. The advantages these LLMs provide are enormous and hence it is obvious that the demand for such applications is more.

Companies such as Google, Meta, OpenAI, Anthropic, etc to name a few, have tremendously contributed to the growth of Generative AI. But to build LLM-powered applications, LLMs are just not enough, you need to have some tools, a framework and an approach to make sure the applications are robust and work as expected.

In this article, we are going to discuss one such framework known as retrieval augmented generation (RAG) along with some tools and a framework called LangChain.

What is Retrieval Augmented Generation?

Large language models are great but they too have limitations such as creating fake, biased, made-up responses that are inaccurate and these are referred to as LLM hallucinations. Such responses generated by these LLMs hurt the applications authenticity and reputation. To mitigate such unwanted responses from the LLMs, there are some techniques that have gained popularity. One such approach is retrieval augmented generation (RAG).

RAG Approach

RAG is where the LLM applications are augmented with some external knowledge base to mitigate the effects of hallucination. This way, for any user query, the system goes through the knowledge base to search for the relevant information and finds the most accurate information. There will be no room for hallucination since the custom knowledge source is already present.

See the above image for example, the PDF is our external knowledge base that is stored in a vector database in the form of vector embeddings (vector data). Basically, the PDF document gets split into small chunks of words and these words are then assigned with numerical numbers known as vector embeddings. You need an embedding model to convert text, image, audio, video, into embeddings.

The user query goes through the same LLM to convert it into an embedding and then through the vector database to find the most relevant document. Once the relevant document is found, it is then added with more context through the LLM and finally the response is generated. This way, RAG has become the bread and butter of most of the LLM-powered applications to retrieve the most accurate if not relevant responses. Well, there are some notable AI frameworks such as LangChain and LlamaIndex that help these LLM applications to be robust by providing all the toolkit required. Let’s understand LangChain since we will be using LangChain in our tutorial.

What is LangChain?

LangChain is an open-source AI framework developed by Harrison Chase to help developers to create robust AI applications by provisioning all the components required. LangChain is equipped with memory capabilities, integrations with vector databases, tools to connect with external data sources, logic and APIs. This makes LangChain a powerful framework for building LLM-powered applications.

LangChain modules Image credits: Upstash

LangChain consists of modules such as Model I/O, Retrieval, Chains and Agents, each having their own strengths to help developers build seamless AI applications. Model I/O module handles prompts, LLMs interaction, chat models and output parsers. The retrieval module handles everything related to data management from loading to modifying to text splitters to embedding the data using embedding models. Then comes the Chain module and as the name suggests, it basically interlinks all the tasks together to make sure the tasks happen in a sequential fashion.

The agents act as the brain of the system that handles the decision making. They determine the sequence of actions to take to complete the task. The agent is capable of choosing the tools required for the task. LangChain has many agent toolkit libraries that can be used to build powerful LLM powered applications.

You can install LangChain using the following pip command

pip install langchain

What is SingleStore?

SingleStore is a modern cloud-based relational and distributed database management system that specializes in high-performance, real-time data processing. SingleStore is not just for OLAP and OLTP workloads, but one can also build real-time GenAI applications seamlessly.

singlestore database

SingleStore started to support vector search and storage back in 2017 itself. It has some amazing integrations with today’s popular AI frameworks such as Langchain, LlamaIndex etc. Supports both SQL and Python and all the data types and this makes it the only database any organization can have instead of having different types of databases for different types of workloads.

RAG with LangChain and SingleStore: Hands-on Tutorial!

Let’s build a simple AI application that can fetch the contextually relevant information from our own custom data for any given user query.

Sign up to SingleStore database to use it as our vector database.

Once you sign up, you need to create a workspace. It is easy and free, so do it.

singlestore workspace

Once you create your workspace, create a database with any name of your wish.

workspace

As you can see from the above screenshot, you can create the database from ‘Create Database’ tab on the right side.

Now, let’s go to ‘Develop’ to use our Notebooks feature [just like Jupyter Notebooks]

singlestore database

Create a new Notebook and name it as you wish.
new notebook

Before doing anything, select your workspace and database from the dropdown on the Notebook.

singlestore db workspace

Now, start adding all the below shown code snippets into your Notebook you just created as shown below.

Install the required libraries & dependencies

!pip install langchain --quiet
!pip install --upgrade openai==0.28.1 --quiet
!pip install pdf2image --quiet
!pip install pdfminer.six --quiet
!pip install singlestoredb --quiet
!pip install tiktoken --quiet
!pip install --upgrade unstructured==0.10.14 --quiet

Import the libraries

from langchain.document_loaders import PyPDFLoader
from langchain.chat_models import ChatOpenAI
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.chains import RetrievalQA, ConversationalRetrievalChain
import os

Load your custom document

from langchain.document_loaders import OnlinePDFLoader
loader = OnlinePDFLoader("example.pdf")
data = loader.load()

I am using this publicly available pdf about world tourism barometer.

[If you like to use the same, mention it in the place of example.pdf with the complete url]

Using LangChain framework to split the document into chunks

from langchain.text_splitter import RecursiveCharacterTextSplitter

print(f"You have {len(data)} document(s) in your data")
print(f"There are {len(data[0].page_content)} characters in your document")

text_splitter = RecursiveCharacterTextSplitter(chunk_size = 2000, chunk_overlap = 0)
texts = text_splitter.split_documents(data)

print(f"You have {len(texts)} pages")

Use OpenAI API to generate embeddings for the document chunks

import os
import getpass
os.environ["OPENAI_API_KEY"] = getpass.getpass("OpenAI API Key: ")

When you run the above command, it prompts you to add your OpenAI api key.

Let’s store our document chunks into SingleStore database table

Action required: Make sure you have selected the workspace and the database where you want to store your data.

from langchain.embeddings import OpenAIEmbeddings

embedding = OpenAIEmbeddings()

#from langchain.vectorstores.singlestoredb as s2
from langchain.vectorstores import SingleStoreDB
#from langchain.vectorstores.utils import DistanceStrategy

#s2.ORDERING_DIRECTIVE["DOT_PRODUCT"] = s2.ORDERING_DIRECTIVE[DistanceStrategy.DOT_PRODUCT]

docsearch = SingleStoreDB.from_documents(
    texts,
    embedding,
    table_name = "tourism_pdf",
    #distance_strategy = "DOT_PRODUCT"
)

You can change the table name as per your wish.

Let us check the text chunks and associated embeddings stored inside our database.

select * from tour_pdf limit 1;

Ask a query against your custom data (the pdf that you loaded) using just similarity search to retrieve the top k closest content.

query = "Global inflation is expected to fall or rise in 2023?"
docs = docsearch.similarity_search(query)
print(docs[0].page_content)

The answer you should see is a big paragraph which is less accurate and not so efficient.

Here is the augmented response to the user query

import openai

prompt = f"The user asked: {query}. The most similar text from the document is: {docs[0].page_content}"

response = openai.ChatCompletion.create(
    model="gpt-3.5-turbo",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": prompt}
    ]
)
print(response['choices'][0]['message']['content'])

The response you receive will be to the point and highly efficient with more context.

Let’s test when knowledge base (custom documents like pdf) is not provided

from langchain.llms import OpenAI
llm = OpenAI(temperature=0.8)

llm.predict("your query?")

In this case, it won’t provide the information and might say that it doesn’t have enough data to answer your question/query. This way, the RAG approach mitigates the hallucination effects of LLMs and increases the efficiency.

Finally, you can go to your database and verify if the provided pdf is stored chunkwise. You should see the data as below.

vector data store

Hope you understood how we utilized the RAG approach combined with LangChain framework and SingleStore to store and retrieve data efficiently. If you like to try the above tutorial, you need a free SingleStore account, OpenAI api key and a publicly available pdf.

SingleStore is giving away $600 worth free credits for every new signup.
Try the tutorial and let me know what you think:)

The post Creating AI Apps Using RAG & LangChain: A Step-by-Step Developer Guide! appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/05/08/creating-ai-apps-using-rag-langchain-a-step-by-step-developer-guide/feed/ 0
Set Image or Gradient as Text Background in CSS 😎 https://prodsens.live/2024/04/06/set-image-or-gradient-as-text-background-in-css-%f0%9f%98%8e/?utm_source=rss&utm_medium=rss&utm_campaign=set-image-or-gradient-as-text-background-in-css-%25f0%259f%2598%258e https://prodsens.live/2024/04/06/set-image-or-gradient-as-text-background-in-css-%f0%9f%98%8e/#respond Sat, 06 Apr 2024 05:20:52 +0000 https://prodsens.live/2024/04/06/set-image-or-gradient-as-text-background-in-css-%f0%9f%98%8e/ set-image-or-gradient-as-text-background-in-css-

How to Spice Up Your Text with Background Image or Gradient in CSS 😎 Hey fellow developers! Ever…

The post Set Image or Gradient as Text Background in CSS 😎 appeared first on ProdSens.live.

]]>
set-image-or-gradient-as-text-background-in-css-

How to Spice Up Your Text with Background Image or Gradient in CSS 😎

Hey fellow developers! Ever wanted to make your text stand out in a cool and unique way? 💥 With CSS, we can jazz up our text by adding background images or gradients behind them. Let’s dive in! 🌊

🖼 Setting Background Image Behind Text

So you’ve got a rad image and you want your text to pop against it? Here’s how you do it with some CSS magic:

.text-with-bg {
  display: inline;
  padding: 10px 20px;
  background-image: url('path_to_your_image.jpg');
  background-size: cover;
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

Here’s a quick breakdown of what’s happening:

  • background-image: This is where you toss in the URL of your awesome image.
  • background-size: Makes sure the image fits the text perfectly.
  • color: Sets the text color to white to stand out.
  • font-size, font-weight, text-align, text-transform: Just some extra spice for your text.
  • -webkit-background-clip, background-clip: Clips the background to the shape of the text.
  • -webkit-text-fill-color: Makes the text transparent so the background image shines through.

Just swap 'path_to_your_image.jpg' with your actual image URL, and boom! Your text is now part of the image. 🚀

🎨 Applying a Background Gradient Behind Text

Want to go for that gradient look instead? Let’s do it:

.text-with-gradient {
  display: inline-block;
  padding: 10px 20px;
  background-image: linear-gradient(to bottom right, #ffcccc, #cc99ff);
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

Here’s the deal:

  • background-image: Now it’s a groovy gradient.
  • linear-gradient(to bottom right, #ffcccc, #cc99ff): This combo gives you a nice transition from light pink to light purple.
  • Rest of the properties stay the same as before.

Now your text is vibing with that gradient goodness! 🌈

🎉 Time to Play!

With CSS, the sky’s the limit! Mix and match colors, images, and gradients to create your own funky styles. 🎨💃 Let your creativity run wild and make your text the life of the party! 🎉

Go ahead, copy these snippets into your projects, and let’s make the web a little more awesome, one stylish text at a time! 😄🚀

The post Set Image or Gradient as Text Background in CSS 😎 appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/04/06/set-image-or-gradient-as-text-background-in-css-%f0%9f%98%8e/feed/ 0
How to Build Your Open Source Dream Team: A Guide https://prodsens.live/2024/03/19/how-to-build-your-open-source-dream-team-a-guide/?utm_source=rss&utm_medium=rss&utm_campaign=how-to-build-your-open-source-dream-team-a-guide https://prodsens.live/2024/03/19/how-to-build-your-open-source-dream-team-a-guide/#respond Tue, 19 Mar 2024 16:20:23 +0000 https://prodsens.live/2024/03/19/how-to-build-your-open-source-dream-team-a-guide/ how-to-build-your-open-source-dream-team:-a-guide

We’ve talked a lot about the challenges of being a maintainer, especially a solo maintainer. But like I…

The post How to Build Your Open Source Dream Team: A Guide appeared first on ProdSens.live.

]]>
how-to-build-your-open-source-dream-team:-a-guide

We’ve talked a lot about the challenges of being a maintainer, especially a solo maintainer. But like I say in our recent newsletter, open source is a team sport. But finding the right teammates can be a tricky situation as well. You might not get it right all of the time. And that’s ok. Taking steps to make sure you and your project stay healthy can help to create a smoother and more rewarding open source experience. In this blog post, I’ll provide a checklist and examples to help you build and manage an effective team for your open source project.

Checklist for Building Your Dream Team

  1. Recognize the Need

    • Is the workload overwhelming for you or your existing team?
    • Are you taking on complex challenges that require specialized expertise that you don’t excel in?
  2. Scout for Superpowers

    • Do you have contributors who have consistently shown their commitment and skills through active involvement in your project?
    • Do you have contributors who have demonstrated enthusiasm, a collaborative spirit, and alignment with your project’s goals?
    • Do you have contributors who are good communicators, have a good understanding of your project, and receive feedback well?
  3. Invite Your Team
    Once you’ve identified people who would be good for the team, extend a formal invitation to potential team members, acknowledging their contributions, sharing any requirements you have, and a list of the responsibilities for the rol.

  4. Grant Appropriate Permissions

    • Assign specific permissions based on the team’s role and responsibilities (e.g., triage, maintainer, documentation).
      • You can start with more restrictive permissions and review them regularly as the project evolves.
    • Consider utilizing code owners for different parts of the codebase.
  5. Expand Your Horizons
    Because open source projects are constantly growing and changing with the community, you should do a regular evaluation of the needs of the project.

    • Identify areas that require specialized attention (documentation, community engagement, etc.).
    • Talk to contributors with relevant expertise, even if they’re outside your existing community. (You can use our Contributor Insights feature to understand which potential contributors might be a good fit.)
  6. Onboard New Team Members

    • It’s important to clearly define roles, responsibilities, communication channels, and project goals.
    • Set expectations and timelines for their contributions.
    • Consider creating guidelines or documentation to streamline the onboarding process.
  7. Keep Track of Your Team

    • Monitor team participation and contributions using tools like Contributor Insight Pages.

Here’s an example of a Contributor Insight Page tracking our Engineering Team:

engineering team activity levels

Using a tool like insights will make it easier to identify when it’s time to remove someone from your team due to inactivity.

Handling Team Departures

If there are departures, be respectful and understanding. If you have to remove a team member, communicate the reasons behind the decision privately. Acknowledge the individual’s contributions and express gratitude.

Practical Application

As your project gains traction, you might notice an influx of issues and pull requests that become challenging to manage alone. This could be a sign that you need a dedicated triage team. Look for contributors who have consistently demonstrated their commitment by actively participating in issue discussions, providing thoughtful feedback, and submitting well-documented pull requests.

Once you’ve identified potential team members, extend a formal invitation acknowledging their contributions. For example:

“Hey @contributor-username, I’ve noticed your dedication to this project through your insightful comments and high-quality pull requests. Would you be interested in joining our triage team? Your help would be invaluable in managing incoming issues and pull requests. Here’s a link to our Triage Guide with more information about how we approach triaging.”

If they accept, grant them the appropriate permissions, such as the “Triage” permission on GitHub, which allows them to manage issues and pull requests without directly modifying the codebase.

Questions to Help You Build Your Dream Team

Team Building and Management

  • What skills and expertise are currently missing in our team that are crucial for our project’s growth?
  • How can we identify potential contributors within our community who demonstrate the enthusiasm and skills needed for our team?
  • What criteria should we use to evaluate the contributions of potential team members?
  • How can we create a welcoming and inclusive environment that encourages diverse contributors to join our team?
  • What are the specific roles and responsibilities for each team member, and how can we communicate these clearly?
  • How frequently should we review and potentially adjust team members’ roles and permissions to reflect their current contributions and project needs?
  • What strategies can we employ to keep our team motivated and engaged over time?

Project Governance and Decision-Making

  • How do we make decisions within the team, and how can we ensure this process is transparent and inclusive?
  • What measures do we have in place to manage and resolve conflicts within the team?
  • How can we effectively manage the transition of team members, including welcoming new members and gracefully handling departures?

Community Engagement and Contribution

  • What steps can we take to actively engage our community and encourage new contributors?
  • Can we support contributors who are new to open source? How can we clearly communicate the answer to that question?
  • How can we make our project more accessible to newcomers (if you have the bandwidth), including clear documentation and easy-to-start issues?
  • In what ways can we recognize and reward contributions to the project, beyond code, such as documentation, design, or community management?
  • What platforms and tools can we use to better understand and track our contributors’ engagement and contributions?

Project Sustainability

  • What are our long-term goals for the project, and how can we align our team’s efforts to achieve these?
  • How can we ensure the project remains sustainable, with active maintenance and development, even as individual contributors’ availability may change?
  • What funding models should we consider to support the project’s growth and sustainability?

Open Source Best Practices

  • How can we stay up-to-date with best practices in open source project management and governance?
  • What partnerships or collaborations with other projects or organizations could benefit our project?
  • How can we leverage insights to better understand our project’s impact and areas for improvement?

Building your open source dream team is more than filling roles; it’s about creating and encouraging a community that shares your passion and vision for the project. The right team can move your project forward and enrich the open source ecosystem.

If you like this post, watch our Intro repo where we’ll be launching a new intro course for maintainers soon!

The post How to Build Your Open Source Dream Team: A Guide appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/03/19/how-to-build-your-open-source-dream-team-a-guide/feed/ 0
Dissecting layered architecture https://prodsens.live/2024/03/08/dissecting-layered-architecture/?utm_source=rss&utm_medium=rss&utm_campaign=dissecting-layered-architecture https://prodsens.live/2024/03/08/dissecting-layered-architecture/#respond Fri, 08 Mar 2024 05:20:59 +0000 https://prodsens.live/2024/03/08/dissecting-layered-architecture/ dissecting-layered-architecture

Selecting the right architecture is key to a project’s success. In software development, architects and developers are always…

The post Dissecting layered architecture appeared first on ProdSens.live.

]]>
dissecting-layered-architecture

Selecting the right architecture is key to a project’s success. In software development, architects and developers are always balancing the needs for scalability, speed, and meeting project goals to create effective solutions. Amidst the myriad of architectural patterns, layered architecture, also known as n-tier architecture, stands out for its structured approach and ease of adaptation. This pattern segregates the application into logical layers, each with a distinct responsibility, thereby promoting a separation of concerns that can lead to more manageable and scalable software designs. Understanding and dissecting layered architecture is crucial for any team aiming to build robust, flexible, and maintainable systems.

Story story…

Story telling GIF
So, in those days in the past Netflix found itself at a crossroads, it had to enter a new era. Gone were the days when their primary business was mailing DVDs; the future was streaming, and with it came a surge of users hungry for on-demand content. However, Netflix’s digital infrastructure, akin to a tangled web code and processes all stuffed into a single, a gigantic box (a monolithic architecture), struggled under the weight of growing demands. This giant box was really slow to adapt, and every small tweak risked toppling the entire operation. In a bold move, Netflix began to dismantle this box, carefully extracting and separating its contents into smaller, specialized boxes, each handling a distinct part of the Netflix experience – strategy known as microservices, which is essentially a nuanced take on layered architecture.

Boom gif
As Amazon’s business boomed, its once robust infrastructure began to buckle under pressure, mirroring challenges faced by Netflix. Overloaded servers and a tangled web of code dependencies threatened to derail the “Everything Store.” Embracing a strategy similar to Netflix, Amazon undertook a significant overhaul of its system architecture, transitioning from a bulky, unified codebase to a sleek arrangement of microservices. This transformation allowed individual teams to update, test, and deploy their services independently, significantly reducing the risk of widespread issues from minor changes. This not only reinforced Amazon’s dominance in e-commerce but also set the stage for the launch of AWS, its cloud computing division. AWS epitomized the benefits of microservices, offering a model for agile, resilient software development. Amazon’s shift to microservices showcases the effectiveness of breaking down complex systems into simpler, interconnected components, ensuring both growth and stability.

What is a layered architecture

Think meme GIF
Layered architecture is like sorting your apps and tasks on your computer into neat folders, each with its own job. It’s a way for software developers to keep things organized when building applications, making sure everything doesn’t get tangled up in a big mess. This method sorts the application into different layers or “levels,” each focusing on specific tasks, such as showing stuff to the user, doing the heavy thinking, or dealing with saving and fetching data. It’s all about keeping things clean and straightforward, so if something needs fixing or updating, you won’t have to dig through a mountain of code.

Think of it as making a cake with different layers. The bottom layer might be your data access layer, handling all the interactions with databases, sort of like making sure the cake has a solid base. The middle layer, the business logic layer, is where all the action happens—mixing ingredients, deciding the cake’s flavor, essentially the brain of the operation. And the top layer is the presentation layer, the icing and decorations, making everything look good and user-friendly.

This setup lets developers change one part without messing up the rest. For instance, if you want to switch from chocolate to vanilla, you don’t need to rebuild the entire cake—just tweak the middle layer. It’s a practical, flexible way to build software, making life easier for the folks coding it and ensuring everything runs smoothly for us, the users. It’s a classic approach that’s stuck around because it works, helping to make complex applications manageable and maintainable.

Why layered architecture

Thinking meme gif
Layered architecture is chosen for several compelling reasons that align with the goals of many software development projects. This architectural style provides a structured approach to designing software applications, offering numerous benefits that address common challenges in software development. Here are the key reasons why layered architecture is widely adopted:

  1. Modularity: By organizing an application into distinct layers, each with its specific responsibility, developers can work on separate parts of the application without impacting others. This modularity makes it easier to manage, develop, and maintain the application.

  2. Flexibility: Changes or updates can be made to one layer without requiring alterations to others. This flexibility is especially beneficial when dealing with changing business requirements or when updating technology stacks.

  3. Scalability: Layered architecture allows for the scaling of individual layers according to their specific load or performance requirements. For instance, the data access layer can be scaled independently to handle increased database load.

  4. Reusability: Components and services within a layer can often be reused in different parts of an application or even in different projects, reducing development time and increasing efficiency.

  5. Maintainability: The separation of concerns facilitated by layered architecture simplifies maintenance and debugging, as issues can be isolated to specific layers. This clear structure also makes it easier for new developers to understand the application.

  6. Improved Security: Security measures can be implemented more effectively in a layered architecture, as each layer can have its own security controls. For example, access control can be enforced in the presentation layer, while data integrity checks can be implemented in the business logic layer.

  7. Testability: Each layer can be tested independently, which simplifies the testing process. Mock objects or stubs can be used to simulate the behavior of adjacent layers, making unit testing and integration testing more straightforward.

The layers

Layers of Layered
Some important sections in layered architecture include:

Presentation Layer

Presentation layer
The Presentation Layer is essentially the face of your application, the part that users interact with. Imagine it as the front desk of a hotel, where the interaction between guests and the hotel’s services begins. This layer’s primary job is to present information in a user-friendly manner and interpret the user’s inputs, turning clicks, taps, and types into actions the application can understand and respond to. It’s all about creating an intuitive, engaging user experience, whether it’s through a sleek website interface, a responsive mobile app, or a powerful desktop application.

Underneath the hood, the Presentation Layer is busy translating user requests to the Business Logic Layer and then displaying the results back to the user. It ensures that data is presented in a clear, accessible way, handling everything from formatting data to managing how users navigate through the app. By focusing on user interaction, it plays a crucial role in making the software accessible and enjoyable to use, directly influencing user satisfaction and engagement. It’s the bridge between the human user and the complex processes running in the background, making sure the digital conversation goes smoothly.

Business Layer

Business Layer
The Business Layer is essentially the brain of any software application, quietly sitting between the user’s touchpoints and the nitty-gritty of data management. It’s like the director behind a play, making sure every scene flows smoothly into the next, according to the script. Here, all the heavy lifting happens: validating the user’s inputs, crunching numbers, making key decisions, and seamlessly coordinating data flow. This is where the application’s heartbeat is, ensuring everything ticks according to the business’s rules and goals.

Think of it as the middleman who speaks both the language of the user’s wishes and the technical dialect of database interactions. It’s incredibly versatile, capable of adapting to new business strategies or rules without causing a ripple effect across the user interface or storage systems. This layer keeps the app’s logic tidy and centralized, making updates a breeze and ensuring the whole operation runs without a hitch. It’s the unsung hero that works tirelessly behind the scenes, ensuring the app not only meets the immediate needs of its users but also stays aligned with the long-term vision of the business. In short, the Business Layer is where the magic happens, turning user interactions into real outcomes.

Persistence Layer

Persistence Layer
The Persistence Layer is where all the data action happens, acting as the sturdy foundation of any app. Imagine it as the backstage crew of a theater, working tirelessly to make sure every prop is in place, ready for the next scene. This layer’s job is to manage how data is stored, retrieved, and updated in databases or other storage systems. It’s the bridge between the application’s working memory and its long-term memory, ensuring that data doesn’t just vanish when the app closes.

In simpler terms, it’s like a librarian who knows exactly where every book should go, keeps track of which ones are checked out, and makes sure they’re all in the right place at the end of the day. It allows the rest of the application to forget about the complexities of how data is stored or the nitty-gritty of database languages. Developers can ask for what they need using simple commands, and the Persistence Layer takes care of the rest, whether it’s saving new data, fetching information for a user, or updating an existing record.

This layer is crucial for maintaining the integrity and performance of the app’s data interactions, making sure that data is not only stored safely but also easily accessible when needed. It’s the unsung hero that ensures the digital world remains orderly and efficient, enabling seamless experiences for users and peace of mind for developers knowing that their data is handled with care.

Types of Layered architectures

Layered architecture, a fundamental principle in software design, organizes applications into distinct levels, each with its unique role. This design pattern enhances maintainability, scalability, and allows for easier debugging and updates. While the concept is universal, the implementation can vary, leading to different types of layered architectures, each tailored to specific project needs or preferences.

Traditional Layered Architecture

Traditional architecture

Traditional Layered Architecture is the classic model, typically consisting of the Presentation, Business, and Data Access layers. It’s akin to a well-organized filing system, where each drawer holds a specific type of document. This straightforward approach facilitates a clear separation of concerns, making it easier for developers to locate and manage code. Ideal for small to medium-sized applications, it ensures that each component focuses on its specific task, from handling user interfaces to managing database interactions.

Three-tier Architecture

Three-tier Architecture

Three-tier Architecture is a direct implementation of layered design, dividing the application into three distinct tiers: the Presentation tier for user interfaces, the Logic tier for processing, and the Data tier for database management. It’s like a three-layer cake, with each layer having its unique flavor and purpose. This model is particularly popular for web applications, offering a balanced approach to separating concerns, which simplifies development, maintenance, and scaling.

N-tier/Multi-tier Architecture

N-Tier Architecture
N-tier or Multi-tier Architecture expands on the three-tier model by introducing additional layers, such as a Service layer or an Integration layer. Imagine adding more floors to a building, each designed for a different purpose like administration, sales, or customer service. This approach offers flexibility and scalability, accommodating complex applications and systems that require more nuanced separation of concerns. It’s particularly useful for enterprise-level applications that need to integrate with various databases, services, and external applications.

Microservices Architecture

Microservices Architecture
Microservices Architecture takes the principles of layered architecture and applies them across distributed systems. Each microservice acts as an independent layer, responsible for a specific business function and communicating with other services via well-defined interfaces. Think of it as a community of small, specialized shops rather than one big department store. This architecture supports agile development practices, allows for easy scaling, and can significantly enhance the resilience and flexibility of large, complex systems.

Advantages and disadvantages of layered architecture

red vs blue pills
| Advantages | Disadvantages |
|————————————|————————————-|
| Modularity
Organizes an application into distinct layers, making it easier to manage and develop. | Performance Overhead
The additional layers can introduce latency, especially if many layers are involved. |
| Flexibility
Updates can be made to one layer without requiring alterations to others, adapting easily to changes. | Increased Complexity
While it simplifies development within a layer, the overall architecture can become more complex. |
| Scalability
Individual layers can be scaled according to their specific needs, enhancing the application’s performance. | Redundant Data Access
Can lead to inefficiencies due to multiple layers performing similar data access logic. |
| Reusability
Components within a layer can often be reused in different parts of an application or even across projects. | Rigidity
If not well-designed, the architecture can become too rigid, making it difficult to adapt to new requirements. |
| Maintainability
Simplifies maintenance and debugging, as issues can be isolated within specific layers. | Dependency Issues
Layers depend on the functionality of layers below them, which can complicate updates or changes. |
| Improved Security
Enables effective implementation of security measures at different layers. | Over-Abstraction
Excessive use of abstraction can lead to a bloated codebase that’s hard to navigate. |
| Testability
Facilitates easier testing, as each layer can be tested independently. | |

Best practices for layered architecture

thumb up gif
Implementing a layered architecture effectively requires adherence to best practices that ensure the architecture serves its intended purpose—making the application scalable, maintainable, and flexible. Here are some of the best practices for deploying a layered architecture:

  1. Clearly Define Layer Responsibilities: Each layer should have a clear and distinct responsibility. Avoid mixing different types of logic in the same layer to maintain a clean separation of concerns.

  2. Minimize Dependencies Between Layers: Depend on abstractions rather than concrete implementations to minimize tight coupling between layers. This approach facilitates easier changes and testing.

  3. Use Dependency Injection: Implement dependency injection to decouple the layers further. This allows for better testing capabilities and adherence to the inversion of control (IoC) principle.

  4. Implement a Strong Contract Between Layers: Define clear interfaces or contracts between layers. This ensures that changes within one layer do not adversely affect others.

  5. Isolate External Dependencies: External dependencies (such as third-party libraries or APIs) should be encapsulated within their own layer or set of components to prevent them from leaking into the business logic.

  6. Design for Reusability: Where possible, design components within a layer to be reusable across the application. This reduces duplication and fosters a DRY (Don’t Repeat Yourself) codebase.

  7. Leverage Intermediary Layers for Cross-Cutting Concerns: Utilize layers or components specifically for handling cross-cutting concerns such as logging, authentication, and error handling to avoid code duplication and ensure consistency.

  8. Keep the Business Logic Layer Independent: The business logic layer should be kept independent of the user interface and data storage mechanisms. This allows the core functionality of the application to remain consistent regardless of changes in the presentation or data access layers.

  9. Ensure Scalability of Individual Layers: Design each layer with scalability in mind. For instance, the data access layer should be able to handle increased load without affecting the business logic or presentation layers.

  10. Prioritize Performance Optimization: While layer separation is crucial, be mindful of the performance implications. Optimize the interactions between layers to minimize overhead and consider asynchronous processing where appropriate.

  11. Document the Architecture: Maintain up-to-date documentation on the architecture, including the responsibilities of each layer, the data flow, and the interfaces between layers. This is crucial for onboarding new team members and facilitating maintenance.

Wrap up

Layered architecture organizes software into distinct levels, each handling specific responsibilities, from user interfaces (Presentation Layer) to core logic (Business Layer) and data management (Data Access Layer). This structure supports modularity, making applications easier to manage, update, and scale by isolating changes to specific layers. Popular variations include the traditional three-tier model, focusing on presentation, logic, and data, and the more flexible N-tier architecture, which adds additional layers as needed. Microservices architecture, though more distributed, shares the principle of dividing responsibilities for greater agility and scalability. Adopting layered architecture offers benefits like improved maintainability, reusability, and security, but it can introduce performance overhead and complexity. Best practices such as defining clear layer responsibilities, minimizing dependencies, and using dependency injection ensure the architecture enhances the application’s development and maintenance. Layered architecture remains a popular choice for structuring complex applications, providing a balance between organization and flexibility.

Conclusion

Bye meme gif
So, wrapping things up, the whole layered architecture thing is pretty much like organizing your digital workspace into clear, easy-to-find sections. It’s a smart way to build software, ensuring everything from the user’s first click to the nitty-gritty data stuff is neatly separated and easy to handle. This approach makes apps way easier to tweak, scale, and keep running smoothly, even as they grow or need to change with the times. Sure, it’s not perfect—sometimes it can slow things down or make things a bit complex—but with a little care and following some smart tips, these issues can be mostly smoothed out. Whether it’s sticking to the basics with a three-tier setup or going all out with N-tier or microservices, sticking to this game plan helps build solid, flexible software. As tech keeps racing ahead, the good old principles of layered architecture will keep being a go-to for creating software that’s not just good for now, but also ready for whatever comes next.

The post Dissecting layered architecture appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/03/08/dissecting-layered-architecture/feed/ 0
FAANG – Guia Descomplicado de Entrevistas – parte 2 https://prodsens.live/2024/02/18/faang-guia-descomplicado-de-entrevistas-parte-2/?utm_source=rss&utm_medium=rss&utm_campaign=faang-guia-descomplicado-de-entrevistas-parte-2 https://prodsens.live/2024/02/18/faang-guia-descomplicado-de-entrevistas-parte-2/#respond Sun, 18 Feb 2024 18:20:50 +0000 https://prodsens.live/2024/02/18/faang-guia-descomplicado-de-entrevistas-parte-2/ faang-–-guia-descomplicado-de-entrevistas-–-parte-2

Achou que hoje não ia ter post novo? Achou errado! Hoje vai ter post novo sim e talvez…

The post FAANG – Guia Descomplicado de Entrevistas – parte 2 appeared first on ProdSens.live.

]]>
faang-–-guia-descomplicado-de-entrevistas-–-parte-2

Achou que hoje não ia ter post novo? Achou errado!

Image description

Hoje vai ter post novo sim e talvez seja a pergunta que eu mais recebo por DMs no finado Twitter.

Você leu o post anterior, aplicou com seu resume topado e agora o recrutador entrou em contato pra marcar uma entrevista. O que fazer? Nesse post vamos discutir algumas estratégias e materiais de estudo, vamos lá jovem gafanhoto(a) que a estrada é longa.

É importante mencionar que esse não é o único caminho, mas é o que funcionou comigo

Tabela de conteúdo

  1. Conversa com a pessoa recrutadora.
  2. Tempo de preparo
  3. Materiais de estudo para algoritmos
  4. Materiais de estudo para system design
  5. Estratégias de estudo.

Conversa com a pessoa recrutadora

Se o seu resume chamou atenção, a pessoa recrutadora vai te ligar para conversar e fazer um pente fino se você encaixa na vaga.

Carta de magic recrutadora imperial.

Dica importante (que nem deveria ser uma dica…): seja uma pessoa bacana com a pessoa recrutadora. Essa pessoa será sua aliada no processo de recrutamento. Eu já vi muito dev sendo arrogando com o pessoal de recrutamento e pow, tomou na cabeça!

Conversa vai e conversa vem, em dado momento a pessoa vai te perguntar sua disponibilidade para uma primeira fase de entrevista. Não se sinta pressionada(o) a dizer amanhã, não é assim que seleção de FAANG funciona. Pense em quanto tempo você precisa e marque respeitando essas datas. O pipeline de recrutamento é feita para acomodar isso.

Tempo de preparo

Imagem relacionada ao tempo

Show! Mas e por quanto tempo você deve se preparar? A resposta óbvia é que o tempo NUNCA vai ser o suficiente. A entrevista é uma questão de múltiplas variáveis onde você estuda para tentar diminuir a chance de te perguntarem algo que você não sabe, porém, SEMPRE vai ter algo que você não manda muito bem. Tendo dito isso, pense em quanto tempo você precisa pra exercitar o básico.

Eu gosto de pensar que existem 4 trilhas distintas dependendo do seu grau de preparo anterior. Quanto mais intimidade você tem com os materiais e preparo, menos tempo você precisa.

Para efeito de comparação, NORMALMENTE hoje em dia eu sigo a trilha level 5. Por que level 5? Para quem joga D&D sabe que é no level 5 que você tem acesso à bola de fogo e a brincadeira começa de verdade 😆.

Trilha aventureira level 10+

Image description

Normalmente, a pessoa já é uma veterana nesses tipos de entrevistas e já domina os tipos de questões diferentes que podem aparecer. Eu diria que nessa trilha aqui, a pessoa precisa de umas 2-4 semanas de preparo pra “refrescar” a memória.

Aqui eu diria pra focar nos tópicos que você lembra menos ou que exigem diversos conceitos, backtracking, grafos, greedy e programação dinâmica são bons candidatos.

Trilha aventureira level 5

Se você se enquadra aqui, bem-vinda(o) ao meu time. Normalmente, nessa categoria a pessoa precisa de 4 a 8 semanas de preparo, estudando no mínimo umas 2 horas por dia. A pessoa em questão já sabe a maioria das estruturas de dados mais comuns, conhece análise assintótica e já tem familiaridade com diversas questões e estratégias.

O objetivo aqui são 2:

  1. Praticar os algoritmos com diversas questões pra aprender mais estratégias ou exercitar as estratégias que já se conhece.
  2. Aprender algoritmos novos que por algum motivo você não tem tanta familiaridade.

Trilha aventureira level 1

Nessa categoria temos a pessoa que já cursou CC ou tem familiaridade com algoritmos, mas faz muito tempo que estudou qualquer coisa, fez questões, etc.

Eu recomendo de 8 – 12 semanas de treino intensivo. Você precisará praticar os diversos tópicos, aprender as estratégias, relembrar as análises de cada estrutura de dados e caminhar das questões fáceis até as questões médias/difíceis no leetcode.

Eu me enquandrava justamente aqui lá em 2013 quando fiz minha primeira seleção e de novo em 2020 quando comecei a praticar no leetcode pela primeira vez. É comum quando a gente fica enferrujado acabar voltando pra essa categoria, a boa notícia é que com o tempo, você vai ficar cada vez mais “estável” no level 5.

Trilha level 0 em algoritmos e ciência da computação

Se você se assustou com o level 1 e pensou “vixe, eu num caio nem aqui” não se desespere, essa categoria é para você, nobre aspirante à pessoa aventureira.

Por ter conhecimento 0 em algoritmos você vai precisar começar do básico fazendo um curso no assunto, estudando os algoritmos clássicos e brincando com as questões easy pra ir se acostumando. O ideal é que você comece implementando cada algoritmo/estrutura de dados pra saber como a coisa funciona.

Materiais de estudo para algoritmos

Agora que você tem uma ideia de quanto tempo vai levar, por onde você estuda? Eu deixo aqui os materiais que eu usei, vi por aí e/ou vejo outras pessoas recomendarem.

Livros

Grokking algorithms

O Grokking algorithms é um livro bom pra quem tá no nível 0 acima. Ele é bem básico, mas te ajuda a molhar o pé no mundo dos algoritmos. Eu tenho ele e acho divertido como ele vai apresentando os conceitos.

Livro cracking the coding interview

Esse aqui é a “bíblia” pra entrevistas. Normalmente pro pessoal que está ali no level 1. Esse foi o primeiro livro a abordar o assunto quando era tudo mato. As explicações são boas e as questões que tem nele são clássicas.

Elements of programming interviews

Esse aqui tem pra várias linguagens, eu acho que tem versão em Python, Java e C++. Ele é mais direto ao ponto do que o cracking the coding e tem menos explicações. Eu cheguei a usá-lo brevemente, mas depois de um tempo eu prefiro só praticar no leetcode ou usar materiais que apontam questões no próprio leetcode. Eu deixo ele aqui mais por curiosidade se a pessoa realmente gosta do tópico de livros.

Outro ponto interessante é que ele trata de alguns temas que podem ser úteis em entrevistas para pessoas mais sênior como design, paralelismo, etc.

Vídeos

Em português, o Will e o Gustavo tem feito um trabalho excepcional abordando várias temas no canal deles do Twitch. Recomendo acompanhar as lives deles não só pelo conteúdo, mas também pela resenha que é sensacional 😂.

Existem centenas de canais de youtube abordando o assunto. Eu deixo aqui o meu favorito que é o Neetcode. A jornada do cara do Neetcode é bem interessante e vale a pena você dar uma olhada. As explicações dele, infelizmente, são em inglês, mas se isso não é uma barreira, eu recomendo.


Current NEET and ex-Google SWE, also I love teaching!

N.E.E.T. = (Not in education, employment or training)

Preparing for coding interviews? Checkout neetcode.io

favicon
youtube.com

Cursos

Eu vou recomendar 3 cursos aqui. 2 sobre algoritmos no geral e 1 focado em entrevistas:

  1. Curso de algoritmos de Princeton na Coursera. É puxado, mas tem muita info legal.
  2. Curso de algoritmos do William Fiset no youtube. Eu acho que hoje em dia tá gratuito. Ele tem curso cobrindo os principais algoritmos e ele também tem um curso focado em grafos.
  3. Curso para entrevistas do próprio leetcode. Esse é novo e o bom é que ele é um guia usando as próprias questões do leetcode.

Com exceção do curso do leetcode, os dois cursos acima podem ser feitos gratuitamente.

Sobre plataformas pagas (sem citar nome das famosas), eu não sou muito fã delas. Isso vai de cada um, eu não acho que o curso vai te dar nada que você não aprenda nos materias gratuitos. Porém, se você curte a didática da pessoa em questão vá em frente, o que vale é estudar e passar na entrevista 😀🤑.

Materiais de estudo para system design

Eu falei muito sobre algoritmos até agora, mas outro tópico cobrado em especial pra quem é pleno e sênior é o tal do System Design. E aí? Vai na lista abaixo que é sucesso:

  1. (Gratuito) Design Primer: Primeiro vamos de conteúdo gratuito né? A “bíblia” pra estudar design de sistemas é o repo no github “design primer”.
    Bom mencionar: a) é todo em texto, b) existe uma versão em português mas não sei o quanto já foi traduzido.
  2. (Pago) Livro System Design Interview do Alex Xu: Excelente intro e o livro 2 vai em alguns aspectos mais complexos. É uma boa base, mas cuidado em não sair decorando porque às vezes o autor se aprofunda mais em uma área que ele se interessa, mas que talvez você não precise focar durante a entrevista. Eu falarei mais sobre isso em um post mais adiante quando focarmos em System Design.
    Image description
  3. (Pago) Eu curto o curso da educative.io Grokking the system design interview. Por muito tempo, esse era o único curso que “juntava” todo o conteúdo disponível pela internet.

Existem diversos canais de youtube falando sobre o tema, os dois que eu mais utilizei são o “System Design Fight Club” e o “Code with Irtiza”. Mais uma vez, muito cuidado em seguir cegamento o que eles falam, a maioria desses canais é de pessoas sem muito XP na indústria, eles só meio que repetem o que tá nos livros ou fazem designs SUPER complicados. Como exercício é interessante, mas na entrevista, muitas vezes a pessoa do outro lado só quer algo simples e que funcione.

Estratégias de estudo

Algumas estratégias básicas que funcionaram comigo:

  1. Siga um fluxo de estudo que vai de estrutura de dados mais básicas até as mais complexas.
  2. Mantenha uma planilha ou anotações sobre o quão bem você resolveu qual questão. Dá uma olhada no meu exemplo abaixo.

    • As questões verdes foram fáceis, eu volto nelas após semanas.
    • As questões amarelas eu sei por onde fazer, mas errei algum detalhe/besteira. Eu costumo voltar nelas após alguns dias.
    • As questões vermelhas eu não sabia por onde ir. Leio como resolver e volto nela no mesmo dia ou no dia seguinte. O objetivo é fazer ela ficar amarela
      leetcode grinding
  3. Não bata muito a cabeça contra as questões. Não conseguiu resolver em 10-15 min? Vá olhar a resposta e entender como fazer.
  4. Não foque em questões hard. Raramente elas caem em seleção (acho que só Google e Meta pedem elas hoje em dia). IMHO, não vale à pena, o esforço é muito alto e a recompensa é muito pequena.
  5. Tenha olhar crítico ao analisar soluções de system design. Questione e pense se dá pra fazer diferente.
  6. Dê pausas quando tiver muito estressado(a). É uma maratona. Cuidado com o burnoutinho.
  7. Você pode variar seu dia entre algoritmos e system design pra deixar mais dinâmico e evitar fadiga mental.
  8. É bacana colocar uma meta “2-3 questões por dia” e tentar focar nela. O que sair depois disso é lucro.

Conclusão

Como falei até aí em cima, é uma maratona, vá com calma que você chega lá.

Se você durou até aqui, parabéns! Nos vemos em breve na parte 3 sobre algoritmos e estruturas de dados. E se curtiu, segue aí, compartilha e espalhe a palavra 🥰.

Image description

Série FAANG até agora

  1. Parte 1 – Conceitos, curriculo e aplicando

The post FAANG – Guia Descomplicado de Entrevistas – parte 2 appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/02/18/faang-guia-descomplicado-de-entrevistas-parte-2/feed/ 0
Elevando a Qualidade: Guia Prático de Testes em Cypress para Componentes e E2E em Aplicações React https://prodsens.live/2024/01/12/elevando-a-qualidade-guia-pratico-de-testes-em-cypress-para-componentes-e-e2e-em-aplicacoes-react/?utm_source=rss&utm_medium=rss&utm_campaign=elevando-a-qualidade-guia-pratico-de-testes-em-cypress-para-componentes-e-e2e-em-aplicacoes-react https://prodsens.live/2024/01/12/elevando-a-qualidade-guia-pratico-de-testes-em-cypress-para-componentes-e-e2e-em-aplicacoes-react/#respond Fri, 12 Jan 2024 04:24:20 +0000 https://prodsens.live/2024/01/12/elevando-a-qualidade-guia-pratico-de-testes-em-cypress-para-componentes-e-e2e-em-aplicacoes-react/ elevando-a-qualidade:-guia-pratico-de-testes-em-cypress-para-componentes-e-e2e-em-aplicacoes-react

Os testes desempenham um papel fundamental no desenvolvimento de aplicações, garantindo a estabilidade, confiabilidade e qualidade do código.…

The post Elevando a Qualidade: Guia Prático de Testes em Cypress para Componentes e E2E em Aplicações React appeared first on ProdSens.live.

]]>
elevando-a-qualidade:-guia-pratico-de-testes-em-cypress-para-componentes-e-e2e-em-aplicacoes-react

Os testes desempenham um papel fundamental no desenvolvimento de aplicações, garantindo a estabilidade, confiabilidade e qualidade do código. Neste artigo, vamos explorar a importância dos testes de componentes e os end-to-end (E2E) usando Cypress em aplicações React.

Um pouco sobre Cypress

O Cypress é uma poderosa ferramenta de automação de testes end-to-end (E2E) projetada para facilitar o processo de teste em aplicações web. Com um foco especial na simplicidade de uso e eficácia, o Cypress ganhou popularidade entre desenvolvedores e equipes de QA devido às suas características distintivas. Seu design intuitivo e capacidades abrangentes tornam-no uma peça fundamental no processo de garantia de qualidade para aplicações web modernas.

Principais Características:

  1. Integração Simples: A instalação do Cypress é direta, e a integração com projetos existentes é fácil
  2. Testes em Tempo Real: Ao contrário de muitas ferramentas de automação, o Cypress executa testes em tempo real enquanto interage com a aplicação, fornecendo feedback instantâneo e facilitando a depuração.
  3. Comandos Simples e Intuitivos: A sintaxe dos comandos Cypress é clara e intuitiva. Operações comuns, como clicar em elementos, preencher formulários e verificar resultados, são expressas de maneira concisa.
  4. Execução em Navegadores Reais: O Cypress executa testes diretamente em navegadores reais, o que significa que os desenvolvedores podem confiar na precisão dos resultados e na consistência com a experiência do usuário real.
  5. Conceito de “Subjects” e Encadeamento de Comandos (chains of commands): O Cypress gerencia um conceito de “subject” que permite o encadeamento natural de comandos, simplificando a construção de testes complexos.
  6. Ampla Gama de Assertivas (Assertions): A capacidade de verificar o estado do DOM e dos elementos usando assertivas robustas simplifica a validação de resultados esperados.
  7. Visual Regression Testing Integrado: O Cypress pode integrar facilmente testes de regressão visual, comparando capturas de tela para identificar alterações visuais não intencionais.
  8. API Mocking e Testes de API: A capacidade de simular chamadas de API e realizar testes de integração com facilidade contribui para uma cobertura de teste mais abrangente.
  9. Timeouts Configuráveis: O Cypress gerencia timeouts automaticamente, mas oferece controle configurável para adaptar a execução dos testes conforme necessário.
  10. Comunidade Ativa e Suporte Contínuo: O Cypress possui uma comunidade ativa, com suporte constante e atualizações frequentes, garantindo que a ferramenta permaneça relevante e eficiente.

Definindo algumas bases

Segue aqui alguns pontos importantes para utilizar o cypress com maestria.

Esse e vários outros pontos podemos encontrar na própria documentação do cypress:

1. Como o Cypress consulta o DOM:

O Cypress possui comandos específicos para interagir com elementos no DOM. Veja um exemplo de como você pode usar o comando cy.get para consultar e interagir com um elemento:

// Consulta e interação com um botão usando seu seletor
cy.get('button').click();

// Consulta e interação com um input usando um atributo específico
cy.get('[data-cy=username-input]').type('nome de usuário');

2. Como o Cypress gerencia subjects e chains of commands:

O Cypress mantém uma referência ao elemento alvo como um “subject”. Cada comando retorna um novo “subject”, permitindo a encadeamento de comandos. Veja um exemplo:

// Cada comando retorna um novo "subject"
cy.get('ul')
  .find('li')   // O subject agora é a lista de itens dentro da ul
  .first()      // O subject agora é o primeiro item da lista
  .click();     // Clicando no primeiro item

3. Como as assertivas (assertions) funcionam:

As assertivas no Cypress são usadas para verificar se o estado do DOM ou de outros elementos é como esperado. Exemplo:

cy.get('.status-message').should('be.visible'); // Verifica se o elemento está visível

cy.get('input[name="username"]').should('have.value', 'nome de usuário'); // Verifica o valor do input

4. Como os timeouts são aplicados aos comandos:

O Cypress gerencia timeouts automaticamente, mas você pode personalizá-los conforme necessário. Exemplo:

// Configuração de um timeout específico para um comando
cy.get('elemento').click({ timeout: 10000 }); // Timeout de 10 segundos para o clique

Esses exemplos demonstram como os conceitos fundamentais do Cypress são aplicados no contexto de consultas ao DOM, manipulação de “subjects”, execução de assertivas e controle de timeouts. O Cypress é uma ferramenta poderosa que oferece controle detalhado sobre interações com o DOM e facilita a criação de testes E2E robustos.

Conceitos que irão parecer por aqui

Subjects:

No contexto do Cypress, “subjects” referem-se aos elementos HTML ou objetos que são o foco de uma cadeia de comandos. Cada comando no Cypress gera um novo “subject”, e os comandos subsequentes são executados em cima desse “subject”. Isso cria uma forma natural de encadear comandos, simplificando a escrita de testes e a interação com o DOM. Por exemplo:

cy.get('button')   // "get" retorna um novo "subject" representando o botão
  .click()        // "click" é executado no "subject" do botão
  .should('be.visible');  // "should" é executado no "subject" após o clique

Chains of Commands:

As “chains of commands” (cadeias de comandos) referem-se à sequência de comandos encadeados que são executados em Cypress. Cada comando gera um novo “subject” que é passado para o próximo comando na cadeia. Isso cria uma forma clara e concisa de expressar interações e verificações em testes E2E. Exemplo:

cy.get('.menu')
  .should('be.visible')
  .contains('Item de Menu')
  .click()
  .should('have.class', 'ativo');

Assertions:

As assertivas em Cypress são usadas para verificar se o estado de um “subject” ou de um elemento DOM corresponde às expectativas definidas no teste. Elas ajudam a garantir que a aplicação está se comportando conforme o esperado. Um exemplo comum usando a assertiva should:

cy.get('.elemento').should('be.visible');

Neste exemplo, a assertiva verifica se o elemento com a classe “.elemento” está visível.

Visual Regression Testing Integrado:

O Visual Regression Testing é uma técnica que compara imagens ou capturas de tela da aplicação em diferentes momentos para detectar alterações visuais inesperadas. O Cypress oferece integração nativa com esse tipo de teste, permitindo comparar automaticamente capturas de tela durante a execução do teste. Isso ajuda a identificar alterações visuais que podem ocorrer inadvertidamente ao longo do desenvolvimento.

cy.visit('/pagina');
cy.matchImageSnapshot();  // Compara a página atual com uma referência anterior

esse exemplo é bem simplório, veja a documentação do cypress para aprofundar no assunto. https://docs.cypress.io/guides/tooling/visual-testing

API Mocking:

API Mocking refere-se à capacidade de simular chamadas de API durante os testes. Isso permite isolar o frontend do backend, garantindo que os testes se concentrem apenas no comportamento do frontend. O comando cy.intercept é comumente utilizado para definir respostas simuladas para solicitações de API. Exemplo:

cy.intercept('GET', '/api/dados', { fixture: 'dados.json' }).as('getDados');
cy.visit('/dashboard');
cy.wait('@getDados').its('response.statusCode').should('eq', 200);

Neste exemplo, a chamada de API é interceptada e substituída por uma resposta simulada, garantindo que os testes não dependam da disponibilidade do backend real durante a execução.

Testes de Componentes em React:

Os testes de componentes em React visam verificar se os componentes individuais funcionam conforme o esperado. Isso pode incluir testes de renderização, manipulação de estados, interações do usuário e muito mais. A biblioteca de testes mais comum para React é o Jest, frequentemente combinado com React Testing Library para testes centrados no usuário.

Exemplo de teste de renderização com Jest:

import { render, screen } from '@testing-library/react';
import Component from './Component';

test('renderiza o componente corretamente', () => {
  render(<Component />);
  const elemento = screen.getByText(/texto do component/i);
  expect(elemento).toBeInTheDocument();
});

Exemplo com Cypress

import React from "react";
import ErrorMessage from "./ErrorMessage";

function ErrorMessage({ message }) {
  return <div className="error-message">{message}div>;
}

describe("", () => {
  it("renders", () => {
        // instancia do componente
    cy.mount(<ErrorMessage message="Mensagem de erro" />);
        // validação se a div com a class error-message contém a mensagem "Mensagem de erro"
    cy.get(".error-message").should(`have.text`, "Mensagem de erro");

        // ... Outros possíveis testes
  });
});

Para rodar o teste basta executar o seguinte comando:

$ yarn cypress run --component

ou ainda via interface

$ yarn cypress open

Testes E2E com Cypress:

Os testes E2E simulam interações do usuário em uma aplicação completa. O Cypress é uma ferramenta poderosa para isso, permitindo simular cliques, preenchimento de formulários, navegação entre páginas e mais, enquanto monitora visualmente o comportamento da aplicação.

Exemplo de teste E2E com Cypress:

describe('Teste E2E em React com Cypress', () => {
  it('Deve fazer login corretamente', () => {
    cy.visit('/login');
    cy.get('input[name="username"]').type('usuario');
    cy.get('input[name="password"]').type('senha');
    cy.get('button[type="submit"]').click();
    cy.url().should('include', '/dashboard');
// ...
// podemos continuar esse teste fazendo diversas outras assertations em /dashboard para garantir o o bom funionanmento do workflow
  });
});

Outros exemplos de testes

Vamos explorar exemplos específicos para testes mais avançados em Cypress, abordando pontos como API Mocking, Visual Regression Testing e Testes em Diferentes Dispositivos e Resoluções.

Exemplo 1: API Mocking

Suponha que você tenha um componente React que faz uma solicitação a uma API para recuperar dados. Aqui está um exemplo de como você pode usar o Cypress para simular essa chamada de API:

// cypress/integration/apiMocking.spec.js
describe('Teste E2E com API Mocking', () => {
  it('Deve simular a resposta da API', () => {
    cy.intercept('GET', '/api/data', { fixture: 'data.json' }).as('getData');
    cy.visit('/dashboard');
    cy.wait('@getData').its('response.statusCode').should('eq', 200);
    cy.get('.data-item').should('have.length', 5);
  });
});

Neste exemplo, o cy.intercept é usado para interceptar a chamada de API e fornecer uma resposta simulada a partir de um arquivo de fixture.

Exemplo 2: Visual Regression Testing

O Cypress suporta visual regression testing usando a biblioteca cypress-plugin-snapshots. Aqui está um exemplo básico:

// cypress/integration/visualRegression.spec.js
describe('Teste de Regressão Visual', () => {
  it('Deve garantir a consistência visual', () => {
    cy.visit('/dashboard');
    cy.matchImageSnapshot();
  });
});

No exemplo acima, cy.matchImageSnapshot() tira um print da página e a compara com uma referência anterior, alertando sobre qualquer diferença visual.

Exemplo 3: Testes em Diferentes Dispositivos e Resoluções

Cypress permite a simulação de diferentes dispositivos e resoluções. Veja um exemplo:

// cypress/integration/responsiveTesting.spec.js
describe('Teste de Responsividade', () => {
  it('Deve garantir layout responsivo', () => {
    cy.viewport('iphone-6');
    cy.get('.mobile-menu').should('be.visible');

    cy.viewport('macbook-15');
    cy.get('.desktop-menu').should('be.visible');
  });
});

No exemplo acima, cy.viewport é usado para simular diferentes tamanhos de tela e garantir que os elementos responsivos estejam visíveis conforme o esperado.

Estes são exemplos básicos, e a complexidade pode aumentar com a necessidade do seu projeto. Lembre-se de ajustar conforme necessário para atender aos requisitos específicos da sua aplicação.

Benefícios de Testes Abordados

Os principais benefícios dos testes incluem Garantia de Qualidade, Detecção Precoce de Problemas e Facilidade de Manutenção. A Garantia de Qualidade é assegurada através dos testes de componentes que verificam a funcionalidade individual de partes da aplicação. A Detecção Precoce de Problemas é obtida através dos testes E2E que identificam falhas em fluxos reais de usuário, permitindo a identificação e correção de problemas antes do lançamento. Por último, a Facilidade de Manutenção é conseguida por meio de testes automatizados que diminuem a necessidade de testes manuais repetitivos, permitindo uma maior precisão e eficiência.

A Garantia de Qualidade é um dos principais benefícios de realizar testes. Especificamente, os testes de componentes ajudam a assegurar que as partes individuais da aplicação funcionem corretamente. Isso é vital porque cada componente de uma aplicação é como um tijolo na construção de uma casa – se um tijolo é fraco ou defeituoso, pode comprometer a estrutura inteira. Portanto, garantir que cada componente funcione corretamente contribui para a construção de um produto final mais robusto e de alta qualidade, o que, por sua vez, traduz-se em uma melhor experiência para o usuário.

Outro benefício importante é a Detecção Precoce de Problemas. Aqui, os testes E2E desempenham um papel crucial. E2E, ou End-to-End, refere-se a testes que verificam o fluxo de uma aplicação, desde o início até o final. Estes testes identificam falhas em fluxos de usuário reais, permitindo que os desenvolvedores detectem e corrijam problemas antes do lançamento. Isso é extremamente valioso porque, sem esses testes, problemas podem passar despercebidos até o lançamento do produto, quando são mais difíceis e custosos de corrigir. A detecção precoce de problemas, portanto, evita problemas futuros e melhora a experiência do usuário.

Por último, mas não menos importante, os testes automatizados proporcionam Facilidade de Manutenção. Eles reduzem a necessidade de testes manuais repetitivos, o que não só economiza tempo, mas também garante uma maior precisão dos testes. Isso ocorre porque os testes manuais são propensos a erros humanos, enquanto os testes automatizados realizam as mesmas operações da mesma maneira todas as vezes. Além disso, os testes automatizados podem ser executados a qualquer momento, o que significa que os desenvolvedores podem verificar a qualidade do código constantemente, tornando a manutenção do código mais eficiente.

Conclusão

Investir em testes de componentes e E2E para aplicações React é crucial para o sucesso do desenvolvimento. O uso de ferramentas como Jest para testes de componentes e Cypress para testes E2E pode melhorar significativamente a qualidade e confiabilidade das aplicações, proporcionando uma experiência consistente para os usuários finais.

Este artigo oferece apenas uma visão geral, mas a prática constante e a adaptação às necessidades específicas do projeto são essenciais para garantir a eficácia dos testes em sua aplicação React.

Referências

Visual Testing | Cypress Documentation

Introduction to Cypress | Cypress Documentation

React Component Testing | Cypress Documentation

Repositório de pesquisa | GitHub

The post Elevando a Qualidade: Guia Prático de Testes em Cypress para Componentes e E2E em Aplicações React appeared first on ProdSens.live.

]]>
https://prodsens.live/2024/01/12/elevando-a-qualidade-guia-pratico-de-testes-em-cypress-para-componentes-e-e2e-em-aplicacoes-react/feed/ 0