r/graphic_design - How to design an amazing creative professional business card

How to design an amazing creative professional business card…

r/graphic_design - How to design an amazing creative professional business card

In the age of social media and email, does the humble business card still count for something? You might think you can do without one for networking and sales, but you’d be wrong.

When you hand a person your professional and modern business card, you build trust and keep the conversation going long after it finishes. Science explains human beings are tactile creatures who learn by touch and interaction, and the business card is a tangible way to build relationships.

As far as brand collateral goes, business cards provide great value for money. Getting your business cards designed and printed is low cost, and their small size means their portable and lightweight.

The graphic design of business cards is evolving too, with designers working in features like play to differentiate brands, industries, and businesses. As a designer, you have the power to help your clients make a great first impression and to do this, you need to be prepared to break some rules.

In this article, we run through five tips you need to remember to create the perfect business card design. Plus, look out for the bonus 5-step business card infographic to show you how to get there!

1. Understand the fundamentals of design

r/graphic_design - How to design an amazing creative professional business card

Before you apply your knowledge of the fundamentals of design, you need to nail the basics. Ensure you get all the contact information your clients needs for their business card:

As for the elements and principles of design are concerned, you need to strike the right balance with all the information given. The visual and text hierarchy plays an important role in creating a successful business card. Hot tip: Think about where the eye must land first. The following design strikes the balance, creating harmony between text and visual hierarchies.

2. Create visually striking images

r/graphic_design - How to design an amazing creative professional business card

Use strong visual imagery to grab attention and make your business card memorable. For a double-sided business card, use side 1 for contact information. For side 2, have to inject some fun and play into your design.

Ideas for Side 2: Feature the company’s logo, include a thought-provoking image or quote. Our tip? Impress your client with a cool custom illustration.

3. Don’t forget type and color

r/graphic_design - How to design an amazing creative professional business card
r/graphic_design - How to design an amazing creative professional business card

Use strong visual imagery to grab attention and make your business card memorable. For a double-sided business card, use side 1 for contact information. For side 2, have to inject some fun and play into your design.

Ideas for Side 2: Feature the company’s logo, include a thought-provoking image or quote. Our tip? Impress your client with a cool custom illustration.

4. Choice of materials and card stock matter

r/graphic_design - How to design an amazing creative professional business card

Think about the material you will be designing on; shape and the form are important in the design process as well as the thickness of the card (card stock) that will feature your design.

Do consider special finishes, which include cutouts, presses, emboss/deboss, and note that these finishes are dependent on your client’s print budget.

The secret here is not to go overboard and include all the bells and whistles but rather think of how the physical attributes of the card will make your brand stronger. We recommend you pick 1 or 2 special elements that can work together to reinforce your brand. Less is more!

During the design planning stage, take into account paper choices, colors and optional extras like embossing or gold leafing. If you choose to step away from the traditional rectangle shape, which can be a great way to differentiate yourself, keep in mind the practicality of storing the card – will your client carry their cards in a special holder or their wallet.

Keep in mind that the more you customize the materials (size, texture, etc) the more expensive production becomes. Also when changing dimensions, for printers it’s technically easier and probably cheaper to reduce the card size than to go up in size.

5. Print with bleed

r/graphic_design - How to design an amazing creative professional business card

Don’t forget to bleed. Let’s be honest printing is never 100% perfect, this is why bleed is crucially important for creating business cards.

Bleed is printing that goes beyond the edge of your design. Usually, printers require a 3mm bleed. Make sure it is the same color as your background, so the edge of your business cards can be perfect. Place all contact information in the ‘safe area’ (the center of the card) to avoid it being cut during the printing process.

You don’t need to showcase the bleed when presenting your design to your client, however, the final file needs to have bled.

do you need the business card design then contact

Source link

Demo app: request form

E2E Testing with React, Jest, and the TestProject

With a long list of end-to-end (e2e) test frameworks available to choose from, it’s hard to know which one you should be using. Cypress and Selenium are leading the market as the most widely used options, but there’s also Appium for mobile app testing, Puppeteer for automating tasks in Chrome, and Protractor for Angular and AngularJS applications, just to name a few.

Recently a newcomer has joined the pack: TestProject, a free, open-source test automation platform for e2e testing that helps simplify web, mobile, and API testing. The TestProject SDK has language support for Java, C#, Python, and, most recently, JavaScript.

In this article we’ll show how we can use the TestProject JavaScript OpenSDK to test a React app with Jest as our test framework.

Ready to get started?

App Overview

To begin, let’s take a look at the demo app that we’ll be testing. This app is relatively straightforward: just a simple request form in which a user can enter their first name, last name, and email address.

Demo app: request form

Demo app: request form

If the form is submitted without being properly filled out, error messages are shown below each invalid input.

Demo app: invalid input

Demo app: invalid input

Upon successful form submission, the app shows some confirmation text.

Demo app: filling out the form

Demo app: filling out the form

Demo app: confirmation page

Demo app: confirmation page

Simple enough, right? If you’d like to see the demo in action, you can find the demo app hosted here or view the source code on GitHub.

Now, let’s look at how the app was made.

Creating the React App

As noted above, this app is written in React. To simplify the boilerplate code and dev tooling, I used the create-react-app tool to bootstrap the app.

npx create-react-app testproject-demo

With the skeleton app generated, I then removed the default app content and wrote a simple form component in a file called RequestForm.js. Here’s the request form code reproduced in full:

import React, { useState } from 'react'
import './RequestForm.css'

export const RequestForm = () => {
  const [firstName, setFirstName] = useState('')
  const [lastName, setLastName] = useState('')
  const [email, setEmail] = useState('')

  const handleFirstNameChange = e => {

  const handleLastNameChange = e => {

  const handleEmailChange = e => {

  const [firstNameError, setFirstNameError] = useState('')
  const [lastNameError, setLastNameError] = useState('')
  const [emailError, setEmailError] = useState('')

  const [submitted, setSubmitted] = useState(false)

  const handleSubmit = e => {

    setFirstNameError(firstName ? '' : 'First Name field is required')
    setLastNameError(lastName ? '' : 'Last Name field is required')
    setEmailError(email ? '' : 'Email field is required')

    if (firstName && lastName && email) {

  return submitted ? (
    <p id="submissionConfirmationText">
      Thank you! We will be in touch with you shortly.
  ) : (
    <form className="requestForm" onSubmit={handleSubmit}>
      <div className={`formGroup${firstNameError ? ' error' : ''}`}>
        <label htmlFor="firstName">First Name</label>
      {firstNameError && (
        <p className="errorMessage" id="firstNameError">
      <div className={`formGroup${lastNameError ? ' error' : ''}`}>
        <label htmlFor="lastName">Last Name</label>
      {lastNameError && (
        <p className="errorMessage" id="lastNameError">
      <div className={`formGroup${emailError ? ' error' : ''}`}>
        <label htmlFor="email">Email</label>
      {emailError && (
        <p className="errorMessage" id="emailError">
      <button type="submit" id="requestDemo">
        Request Demo

As you can see, we have a function component that displays three inputs for the user’s first name, last name, and email address. There is a “Request Demo” submit button at the bottom of the form. When the form is submitted, error messages are shown if there are any invalid inputs, and a confirmation message is shown if the form is submitted successfully.

That’s really all there is to the app. Now, on to the fun part. How can we configure our end-to-end tests with TestProject?

Getting Started with TestProject

To begin, we’ll need to first create a free TestProject account. After that, we can download the TestProject agent. There are options to either download the agent for desktop or for Docker. Which one you choose is up to you, but I chose to download the desktop app for Mac. You then need to register your agent to link your agent to your TestProject account.

Next, we’ll generate a developer token to use in our project. Once we have a developer token, we’ll create an .env file in the root directory of our project and add the following line of code to store our token in the TP_DEV_TOKEN environment variable:


You’ll note that we tell Git in our .gitignore file to ignore our .envfile so that our token or other environment secrets don’t get committed into our version control and accidentally shared with others.

Finally, we’ll need to install a couple npm packages as devDependencies to use the TestProject JavaScript OpenSDK in our app:

yarn add --dev @tpio/javascript-opensdk selenium-webdriver

With that, we’ve laid most of the groundwork to begin using TestProject with our e2e tests.

Configuring Jest

Next up, we need to configure Jest. Since we used create-react-app to bootstrap our app, our project uses react-scripts to run Jest and React Testing Library with some default configuration options. However, it’d be nice if we could configure Jest and add a few more npm scripts to be able to run unit tests and e2e tests separately.

To do this, I added the following npm scripts to the “scripts” section of my package.json file. Each one contains some specific Jest CLI configuration options:

"scripts": {
  ...other scripts here
  "start": "react-scripts start",
  "test:e2e": "wait-on http://localhost:3000/testproject-demo/build/ && react-scripts test --testPathPattern="(\.|/)e2e\.(test|spec)\.[jt]sx?$" --testTimeout=30000 --runInBand --watchAll=false",
  "test:e2e:ci": "run-p start test:e2e",
  "test:e2e:watch": "wait-on http://localhost:3000/testproject-demo/build/ && react-scripts test --testPathPattern="(\.|/)e2e\.(test|spec)\.[jt]sx?$" --testTimeout=30000 --runInBand",
  "test:unit": "react-scripts test --testPathPattern="(\.|/)unit.(test|spec)\.[jt]sx?$" --watchAll=false",
  "test:unit:coverage": "react-scripts test --testPathPattern="(\.|/)unit.(test|spec)\.[jt]sx?$" --watchAll=false --coverage",
  "test:unit:watch": "react-scripts test --testPathPattern="(\.|/)unit.(test|spec)\.[jt]sx?$""

That’s a lot to take in! Let’s break down each of these commands while highlighting some of the key pieces of this code.

First, we see the start script. That one is easy enough: it runs our app locally in development mode. This is important because e2e tests require the app to be running in order to work properly.

Next, we see the test:e2e script. This command waits for the app to be running locally on port 3000 before attempting to run any tests. It then uses the react-scripts test command to run our app’s tests but with several Jest CLI configuration options applied. The testPathPattern option tells Jest to only run our tests that end in e2e.test.js (and a few other variations). The testTimeout option increases Jest’s default timeout of 5 seconds per test to 30 seconds per test since e2e tests take a little longer to run than simple unit tests. The runInBand option tells Jest to run our test files serially instead of in parallel since we only have one TestProject agent installed on our machine. And finally, the watchAll=false option makes it so that the tests do not run in “watch” mode, which is the default setting for Jest with react-scripts. Whew, that was a lot!

The third script is test:e2e:ci. This command is a combination of the start and test:e2e commands to help simplify the testing process. In order to use the original test:e2e command, we first must be running the app locally. So we’d need to first run yarn start and then run yarn test:e2e. That’s not a huge deal, but now we have an even simpler process in which we can just run yarn test:e2e:ci to both start the app and run the e2e tests.

The fourth script, test:e2e:watch, is very similar to the test:e2e script but runs the tests in “watch” mode in case you want your tests to be continuously running in the background as you make changes to your app.

The last three scripts are for running unit tests. The test:unit script runs the unit tests with Jest and React Testing Library and only looks for tests that end in unit.test.js (and a few other variations). The test:unit:coverage script runs those same unit tests but also includes a test coverage report. And finally, the test:unit:watch script runs the unit tests in watch mode.

This may seem like a lot of information to take in, but the takeaway here is that we’ve now created several helpful npm scripts that allow us to easily run our unit and e2e tests with short and simple commands. All of the hard configuration work is out of the way, so now we can focus on writing the actual tests.

Writing Tests with the JavaScript OpenSDK

We now have Jest and TestProject configured for our project, so we’re ready to write our first e2e test. End-to-end tests typically focus on critical workflows of the app represented by user journeys.

For our request form, I can think of two important user journeys: when a user tries to submit an invalid form and when a user successfully submits a properly filled out form. Let’s write an e2e test for each workflow.

Our complete App.e2e.test.js file looks like this:

import { By } from 'selenium-webdriver'
import { Builder } from '@tpio/javascript-opensdk'

describe('App', () => {
  const testUrl = 'http://localhost:3000/testproject-demo/build/'

  let driver

  beforeEach(async () => {
    driver = await new Builder()
      .withProjectName('TestProject Demo')
      .withJobName('Request Form')

  afterEach(async () => {
    await driver.quit()

  it('allows the user to submit the form when filled out properly', async () => {
    await driver.get(testUrl)
    await driver.findElement(By.css('#firstName')).sendKeys('John')
    await driver.findElement(By.css('#lastName')).sendKeys('Doe')
    await driver.findElement(By.css('#email')).sendKeys('john.doe@email.com')
    await driver.findElement(By.css('#requestDemo')).click()

    await driver

  it('prevents the user from submitting the form when not filled out properly', async () => {
    await driver.get(testUrl)
    await driver.findElement(By.css('#requestDemo')).click()

    await driver.findElement(By.css('#firstNameError')).isDisplayed()
    await driver.findElement(By.css('#lastNameError')).isDisplayed()
    await driver.findElement(By.css('#emailError')).isDisplayed()

In our first test, we ensure that a user can successfully submit the form. We navigate to our app’s url, use the sendKeysmethod to enter text into the three input fields, and then click the submit button. We then wait for the confirmation text to appear on the screen to validate that our submission was successful.

You’ll note that all of the selectors look just like normal Selenium selectors. You will typically find elements using CSS selectors or using the XPath selector.

In our second test, we ensure that a user is prevented from submitting the form when there are invalid inputs on the page. We first navigate to our app’s url and then immediately click the submit button without filling out any of the input fields. We then verify that the three error messages are displayed on the screen.

You’ll also note that we’ve extracted out some of the shared test setup and teardown into the beforeEach and afterEach blocks. In the beforeEach block, we create our web driver for Chrome. In the afterEach block, we quit the driver.

Running Our E2E Tests

Here’s the moment of truth: Let’s try running our end-to-end tests. In our terminal, we’ll run yarn test:e2e:ci to start the app and run the e2e tests. And… the two tests pass! You should see the app open on the Chrome browser, see the steps for each test be executed, and then see the test results back in the terminal:

Running our e2e tests in the terminal

Running our e2e tests in the terminal

TestProject even provides its own free, built-in report dashboards as well as local HTML and PDF reports so that you can see the test results within the browser. This is perfect when viewing tests that are run as part of a CI pipeline. Here is my report after running the test suite twice:

TestProject report dashboard

TestProject report dashboard


Well, we did it! We successfully wrote and ran end-to-end tests using React, Jest, and the TestProject JavaScript OpenSDK. Mission accomplished.

The exciting thing is that this is just the tip of the iceberg. TestProject is full of other hidden gems like the ability to write tests directly within the browser using a GUI, a plethora of add-ons for commonly needed test actions, and integrations with apps like Slack for sending test report notifications.

Who knows what the future will hold for the world of end-to-end test automation, but TestProject is certainly a platform worth keeping your eye on.

Source link

r/webdev - eMarket Online Store - OpenSource Engine (v. 1.0 beta 1)

eMarket Online Store – OpenSource Engine (v. 1.0 beta 1) : w…

r/webdev - eMarket Online Store - OpenSource Engine (v. 1.0 beta 1)

Hello. In January 2021, I already presented the alpha release of our eMarket online store engine. Now we want to present a beta release.

At first glance, there are not many innovations, but all of them are of great importance.

– Moving from Bootstrap 3 to Bootstrap 5.
– Vanilla JS. This is a lot of work. We’ve replaced all third party JS apps with vanilla ones. Also, all our code is written in Vanilla. This offers great opportunities.
– Made structural changes
– Added SMS providers


– Multilingual
– Multicurrency
– Manufacturers
– Taxes
– Currencies
– Weight
– Length
– Vendor codes
– Units
– Order statuses
– Countries
– Regions
– Zones (for shipping, taxes and etc)
– Discounts
– Stikers (+ Gift and etc)
– Specifications
– Multilingual slideshow
– Modules (shipping, payment, sales, providers)
– Directory management through the context menu
– Logs
– Images by category
– Template builder
– Ajax fileuploads
– Friendly interface
– And much more

Criticism is welcome. But please give me a discount on the fact that this is still a Beta version. A lot of functionality will be added to the full release.

GitHub – https://github.com/musicman3/eMarket

ADMIN PANEL DEMO (http://demo.emarketforum.com/controller/admin/)

pass: 1234567


CATALOG DEMO (http://demo.emarketforum.com)

pass: 1234567

Source link

r/webdev - A Link Element Above the <HEAD> Section

A Link Element Above the Section : webdev


I have encountered an example that people put a link element to the above of the head section. Below, you can see an image that describes the situation.

r/webdev - A Link Element Above the <HEAD> Section

For HTML 4, this is wrong, but I am not sure about HTML 5. And, I believe that still, Browser will read the <head> section first, not this link. Do you have any idea or suggestion for these types of situations?

Source link

Software Outsourcing

Pros and Cons of Outsourcing Software Development

If you notice the trend of outsourcing software development these days, you must know the fact that Vietnam is becoming the new powerhouse of skilled technical workers. They have a broad knowledge base to complete tasks as data mining, analysis, and innovation.

As a result, a productive yet cheap workforce is one of the reasons why many businesses are considering outsourcing their software. And before making any decision, let’s see how outsourcing benefits you and what all the bad sides are when it comes to this activity.

The Pros

1. Outsourcing Software Development Makes Your Business Profitable

Let’s look at an example of an American company outsourcing its product to India. In 2018, a U.S. firm had to pay around $61/hour to hire a senior software developer. Instead of that huge amount of salary, the hourly rate of an Indian senior developer was only $26 at that time.

As stated above, outsourcing software development will maximize your profit. Firstly, thanks to outsourcing, companies save themselves a whole lot of money by hiring low-paid workers from other countries rather than employing high-paid local software engineers.

a. First

Sometimes your project won’t last long enough that you have to form a whole new team of software development, any permanent hire would be a waste of money and effort. There are not always problems with your system to employ permanent personnel.

Software Outsourcing

On the other hand, when it comes to a freelancer or a temporary outsourcing software development team, welfare, insurance, and bonuses are no more an expensive problem.

b. Second

If you are having your own software, it’s necessary to maintain this product frequently, and the cost for hiring a full-time IT support staff must be higher than a freelancing software engineer to fix technical issues.

c. Third

If a typical outsourcing team includes 5 members then even a simple calculation could reveal that your company will save about $234.000/year when signing an outsourcing contract with an Indian firm regarding salary.

2. Productivity Is Increased

It’s crucial that you have to outsource your product to a trustful and high-skilled software development company since this deal is not a cheap game that everyone can afford. Thanks to the valuable experience of these members through many projects, they are able to analyze your ideas, requirements.

However, let’s assume that you have partnered with an experienced vendor like Designveloper. At the same time, they can craft numerous useful insights into your requirements: risks, red flags, undeliverable functions, etc. Also, you will receive a lot of brilliant recommendations from them in terms of technical and business.

Using an outsourcing software development service means that you don’t have to spend time onboarding your employees which is likely to take 2 to 3 weeks. By outsourcing your product to an experienced team, your project will probably start earlier, and of course, your product will be launched sooner.

3. Get More Resources to Dedicate to Developing Your Core Product

In terms of capital, as stated in the first part of this article, you don’t have to spend too much on employing and operating a big IT team to deliver your product. This action will release capital for investment in your core business. And providing that your company is just established.

pro of software outsourcing

Outsourcing helps to avoid large expenditures in the early stage of the business.

Ultimately, outsourcing software development is a great approach to develop your dream product. However, businesses also need to watch out for some cons of outsourcing.

The Cons

1. Hidden Costs

You cannot execute any business without expecting hidden costs. The same story goes for outsourcing. If a company is not familiar with outsourcing activities, then this issue will likely happen during the process.

a. Traveling

Most of the time, to make sure your outsourcing partner is a skillful and suitable one for the product, an executive has to go aboard to double-check on it or to learn about the working model. It could make you spend a huge amount of green notes as well as your time when it comes to outsourcing software development.

b. Additional Works

Outsourcing management fees, legal documents, and management are some of the other hidden costs when outsourcing a software product. If you do not handle the issue correctly, then the cost-effectiveness of outsourcing is a big zero.

New functions bumped into the process, bugs, red flags needed solving are some of the most common issues. Whether the pricing model is a fixed price or an hourly rate, you have to pay a lot more to fix them.

2. Communication Issue in Outsourcing Software Development

The reason for this problem is various. One way or another, these things will drown your project to death even when it has not started yet. Let us list out some of them and our solutions for you.

a. Lack of Control Over the Quality

When a low-quality product is launched, companies have to pay a lot more to fix it, worse, their reputation might be affected as well. The solution is that you have to follow their process closely so that issues could be pointed out and adjusted earlier. One more thing a businessman should keep in mind is that choosing an outsourcing company that uses frameworks like Scrum will benefit your product.

outsourcing development software

b. Lack of An Effective Communicating Solution

Both of common concerns in the past. Nowadays, it’s hard to imagine there is a software company that has problems with using English on a daily basis. In addition, there are also numerous apps designated to optimize communication internal and external such as Slack, Skype, Google Hangout, etc.

c. Lack of Authenticity and Trust

The issue comes when one party lacks information or misunderstands the other. In this case, a business should reduce communication via emails or other types of text tools. Video calls will help you go through every important and sophisticated point without hassle.

What to Avoid?

Avoiding these pitfalls will boost the effectiveness of your outsourced product.

  • Being reluctant to the latest technology.
  • Demanding an unreasonable deadline.
  • Not hiring an in-house technical expert.
  • Providing unclear requirements and vision.
  • Choosing a vendor based on their quota.

In sum, outsourcing software development is not a one-for-all solution for developing a product, but it’s the most effective one when you lack resources but want to make money from a product faster.

Source link

r/webdev - I have created a game engine for the browser. What do you think about this?

I have created a game engine for the browser. What do you th…

I haven’t done web development for a long time. And I kept it for myself as a hobby. But, once I made a small game engine. Since I wanted to make my fallout 2 in the browser. As a result, it was a little delayed. I wondered what the performance would be and so on.

r/webdev - I have created a game engine for the browser. What do you think about this?

This is how it all started roughly

r/webdev - I have created a game engine for the browser. What do you think about this?

I wanted to see how the A* Algorithm would work with many characters at the same time

As a result, with this engine, you can make an isometric RPG, strategy or quest. Such games came out at the end of the 20th century. Fallout, Diablo and Arcanum.

r/webdev - I have created a game engine for the browser. What do you think about this?

Lots of shadows from different sources. Distance also counts

r/webdev - I have created a game engine for the browser. What do you think about this?

I almost broke my computer just to make some transparent gradients. It was almost impossible

I had never made any engines and had no idea where to start. Step by step, function by function, it turned out like this. Taking a closer look, I began to understand why some CSS properties, Requestanimationframe, and so on were generally needed. I screwed on the A* Algorithm (Finding the Shortest Path) and something started to work out. Then I decided to add shadows and filters to make it cooler than in those old games)

r/webdev - I have created a game engine for the browser. What do you think about this?

Something like a level

r/webdev - I have created a game engine for the browser. What do you think about this?

The same, but added some filters

I was also interested to see what the load on the browser would be. What is the CPU load and what properties load the GPU. How many characters my engine could handle.

So look. If something is interesting, then write and ask questions. I will answer with pleasure. Since, while I made this engine, I was going through all the CSS inside and out.

The video can be viewed on the links:

Images and materials in the video and in the engine are used for entertainment purposes only and not for commercial purposes. I respect everyone who made them.

Source link

r/webdev - I started working on a web-based, native-feel Plex client UI overhaul. Would anyone like to team up on such a project?

I started working on a web-based, native-feel Plex client UI…

After numerous experiments toying with “live” CSS injection to Plex’s official web client, I decided to imagine the principle taken further and actually designed some key screens.

I reworked every UI component of the web client while remaining extremely close structure-wise to let the door open to any technical approach.

With OS-synced light/dark mode working so well with CSS now, it could be a packaged webapp with OS-specific HTML/CSS injection (not ideal as it would require “visual maintenance”, but I’d be up for the task) or something more in depth using the API? Maybe a mixed approach?

I lack any concrete backend competence and I’m slow at everything structural—I clearly can’t achieve this alone ; however I have a lot of experience writing OS-like, pixel-perfect CSS.

This would be a dream project. I’d love to hear your thoughts and ideas!

More screeshots at 1:1 scale here >

r/webdev - I started working on a web-based, native-feel Plex client UI overhaul. Would anyone like to team up on such a project?

Light mode on macOS: Play screen

r/webdev - I started working on a web-based, native-feel Plex client UI overhaul. Would anyone like to team up on such a project?

Light mode on macOS: Collection screen, scrolled

r/webdev - I started working on a web-based, native-feel Plex client UI overhaul. Would anyone like to team up on such a project?

Light mode on macOS: Editing a collection

r/webdev - I started working on a web-based, native-feel Plex client UI overhaul. Would anyone like to team up on such a project?

Dark mode on macOS: Library screen on collections tab, scrolled, libraries dropdown

r/webdev - I started working on a web-based, native-feel Plex client UI overhaul. Would anyone like to team up on such a project?

Light mode on Windows: Home screen

r/webdev - I started working on a web-based, native-feel Plex client UI overhaul. Would anyone like to team up on such a project?

Dark mode on Windows: Collection screen

Source link

r/webdev - [News] VSCode extension "Blockman" to Highlight nested code blocks with boxes

[News] VSCode extension “Blockman” to Highlight nested code …

Check out my VSCode extension – Blockman, took me 6 months to build. Please help me promote/share/rate if you like it. You can customize block colors, depth, turn on/off focus, curly/square/round brackets, tags, python indentation and more…..


Supports Python, R, Go, PHP, JavaScript, JSX, TypeScript, TSX, C, C#, C++, Java, HTML, CSS and more…

This post in react.js community:


r/webdev - [News] VSCode extension "Blockman" to Highlight nested code blocks with boxes

Source link

Older Architecture vs. 3factor Architecture

Modern 3factor Apps with Event-Driven Programming

Before OOP languages, the programmer would control how the program is executed and that would be from the app’s main routine. In modern programming, that control is delegated to the external non-main loops, and the main routine becomes an event-loop that waits for events to occur and then executes it with the relevant event handler.

This new model of programming (it has been around since the 70s though) is called event-driven programming.

What Is Event-Driven Programming?

In event-driven programming, user actions and interactions are the triggers that initiate the next flow of events. Apps built in 2021 are generally made with the user at the center of the programmer’s thinking, and as such, are created to respond to any sort of user commands.

In this asynchronous programming model, as mentioned above, there’s usually an event-loop that looks out for new events as they come in. Once an event is initiated, an event handler is triggered at the specific time that the event is produced. 

These procedures that are triggered can be either stored routines or external programs. Thus, the control of the flow of the program execution is external, largely invisible to the programmer, and there’s no discernible flow of control.

What Are 3factor Apps?

3factor app is a modern artificial pattern for building modern full-stack applications. The 3factor architecture pattern is fully aligned with the event-driven programming paradigm, and uses the following 3 “factors”:

  1. Realtime GraphQL.
  2. Reliable Eventing.
  3. Asynchronous (Async) Serverless.

Here’s an example of a food ordering application that’s built in the traditional model vs the 3factor methodology:

Older Architecture vs. 3factor Architecture

The core of the whole model is that all the business logic is triggered by events.

1. Realtime GraphQL

The GraphQL layer allows flexible API access and is used for mutating and manipulating states while receiving real-time updates to state changes. This GraphQL layer should be:

  • Low-latency: The user should be able to get instant feedback from the application for any action.
  • Support subscriptions: Avoid continuous polling by being able to consume real-time information from the backend through GraphQL subscriptions.

The traditional model used REST APIs to interact with the backend, fetched related data via multiple calls, used tools like Swagger for API docs, required the setup of custom APIs for real-time (or polling). Meanwhile, 3factor uses GraphQL APIs for backend interaction, can fetch any kind of data in a single cell, auto-generate the entire API schema and related docs, and use native GraphQL subscriptions to consume info in real-time.

2. Reliable Eventing

From the example diagram discussed above, we can see that the business logic is invoked by events, thus leaving your API layer free from complex state management which can be delegated to specifically created business logic programs or functions.

It is recommended that the events be persisted for the sake of observability of the entire state change history. And the event system should also be:

  • Atomic: Any mutations to the state of the application should atomically create an event(s).
  • Reliable: Events should be delivered with an at-least-once guarantee.

In the 3factor model, on an API call, we can produce and persist event(s) that represent the action and the eventing is fundamentally asynchronous. But, the seamless error recovery handling is arguably the most beneficial advantage to making the application event-driven. In a traditional workflow, there needs to be some additional error recovery logic that has to be implemented in case of a crash, but there’s no need for such logic since the app is emitting atomic events that can be easily retried in the case of a crash.

3. Async Serverless

Since the main routine is just an event-loop made up of event handlers, the complex business logic can be in the event handling functions themselves where each function is small and cohesive and deals only with one event. These functions can be deployed using serverless backends and that will result in minimizing backend ops and is highly cost-effective when scaling.

These serverless functions imbibed with complex business logic should be:

  • Idempotent: Should be prepared for duplicate delivery of events.
  • Out of order: Sharks are known to eat the undersea copper wiring that powers a lot of the internet. That and more realistic issues may cause the events to be received out of order and hence the code should be able to process this without depending on an expected sequence of events.

The 3factor model allows us to write loosely coupled event handlers, lets us deploy on serverless platforms, doesn’t require us to manage the runtime (the platform does it), doesn’t require operational expertise, and is inherently auto-scaling.


The event-driven programming paradigm coupled with the 3factor app architecture pattern is the most modern way of building apps in 2021. There are arguments against event-driven programming such as only GUI apps will benefit and others don’t need it or it’s too complex for simple apps, but along with the 3factor methodology, it’s a powerful tool focused on speed, reliability, scalability and has the user in focus.

Further Reading:

  1. The 3factor app architecture is an implementation of the CQRS pattern in many ways.
  2. A complete step-by-step reference implementation for a 3factor app. 

Source link

Safari 15: New UI, Theme Colors, and... a CSS-Tricks Cameo!

Safari 15: New UI, Theme Colors, and… a CSS-Tricks Cameo!

There’s a 33-minute video (and resources) over on apple.com covering the upcoming Safari changes we saw in the WWDC keynote this year in much more detail. Look who’s got a little cameo in there:

Perhaps the most noticeable thing there in Safari 15 on iOS is URL bar at the bottom! Dave was speculating in our little Discord watch party that this probably fixes the weird issues with 100vh stuff on iOS. But I really just don’t know, we’ll have to see when it comes out and we can play with it. I’d guess the expectation is that, in order for us to do our own fixed-bottom-UI stuff, we’d be doing:

.bottom-nav { 
  position: fixed; /* maybe sticky is better if part of overall page layout? */
  bottom: 100vh; /* fallback? */
  bottom: calc(100vh - env(safe-area-inset-bottom)); /* new thing */

On desktop, the most noticeable visual feature is probably the theme-color meta tags.

This isn’t even a brand new Apple-only thing. This is the same <meta> tag that Chrome’s Android app has used since 2014, so you might already be sporting it on your own site. The addition is that it supports media queries.

<meta name="theme-color" 
      media="(prefers-color-scheme: light)">
<meta name="theme-color" 
      media="(prefers-color-scheme: dark)">

It’s great to see Safari get aspect-ratio and the new fancy color systems like lab() and lch() as well. Top-level await in JavaScript is great as it makes patterns like conditional imports easier.

I don’t think all this would satisfy Alex. We didn’t exactly get alternative browser engines on iOS or significant PWA enhancements (both of which would be really great to see). But I applaud it all—it’s good stuff. While I do think Google generally takes privacy more seriously than what general internet chatter would have to believe, it’s notable to compare each company’s newly-released features. If you’ll forgive a bit of cherry-picking, Google is working on FLoC, a technology very specifically designed to help targeted advertising. Apple is working on Private Relay, a technology very specifically to making web browsing untrackable.

Source link