ProjectX

Tame full-stack chaos with Temporal workflows and React wizardry, the ultimate event-driven architecture for your apps πŸ§™β€β™‚οΈβœ¨

I'm J.D. Nicholls πŸ‘‹

Digital nomad πŸŽ’ | Mentor πŸ‘¨β€πŸ« | Speaker πŸ—£οΈ |

Full-Stack Web3 Engineer (JS, Python, C#) πŸ‘¨β€πŸ’» |

Open Source Contributor 🍫 |

 

Creator of @proyecto26 πŸ§š

πŸ‘· Founder of MarketX πŸ€– + πŸ“‡ + β‚Ώ = πŸ›οΈ

MarkertX, the next generation of e-commerce powered by GenAI and 3D printing

To be Continued...

The next workflow activation has begun! πŸš€

Project Manager: β€œWe don’t need to worry about failures now, let’s focus on delivering value!” πŸ“ŠπŸ˜Ž

Problems when building distributed systems

- Reliability
- Fault-tolerant

- Replicated state machine

- Retry policies

 

There are tradeoffs between

Consistency & Availability

The β€œCAP” Theorem

(Strongly) Consistent, (Always) Available, Partition-tolerant

Replicate data

βž•

🟰

βž•

Niceee

May the Workflow be with you πŸ™

From chaos, order. From events, destiny.

But Why Temporal? πŸ€”

We live in a world of uncertainty, where events vanish like whispers in the wind πŸ’¨

In retries, we find strength. In workflows, we find order

Orders | Architecture before Temporal

Orders | Architecture after Temporal

When workflows run themselves, developers dream bigger.

10x+ improved reliability

β†’

βœ… Saved revenue

Simplify the coding

Enhanced visibility

into systems

Horizontal scale, even for monoliths

Temporal is a life-saver

β†’

βœ… 10x feature velocity

β†’

βœ… Easier compliance

β†’

βœ… Less optimization

time required

Learning by doing.

High level Architecture

Your first Workflow

export async function loginUserWorkflow(data: LoginWorkflowData) {
  const state: LoginWorkflowState = {   // Your workflow state
    codeStatus: LoginWorkflowCodeStatus.PENDING,
    status: LoginWorkflowStatus.PENDING,
  };
  // Attach queries, signals and updates
  setHandler(getLoginStateQuery, () => state);
  setHandler( verifyLoginCodeUpdate,
    async (code) => { } // Verify the code and update state
  );
  try {
    // Generate a hashed code and send an email
    const hashedCode = await sendLoginEmail(data.email);
    state.code = hashedCode;
    state.codeStatus = LoginWorkflowCodeStatus.SENT;
    // Wait for user to verify code (human in the loop)
    await condition(() => !!state.user, '10m') // wait 10 min max
    // Wait for all handlers to finish before checking the state
    await condition(allHandlersFinished);
    // Update workflow state
  } catch (error) {
    // Manage failure scenarios
  }
}

Only those who prove their identity shall pass πŸ§™β€β™‚οΈ

The state of the workflow as a "Source of truth"

The State of the Workflow is used to make decisions.

Truth is not in the event, but in the state it leaves behind

REPO / REACT / REMIXJS

TEMPORAL / NODEJS

NESTJS / NX / 🍭🍬🍫🍦

 

Of course Elon, Code here! πŸŽ

Resources

Keep Learning!

Join the Community! 🀝

Let’s keep in touch!

 

Β‘Gracias Totales!

 

ProjectX

By J.D Nicholls

ProjectX

Tame full-stack chaos with Temporal workflows and React wizardry, the ultimate event-driven architecture for your apps πŸ§™β€β™‚οΈβœ¨

  • 496