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! 🚀

Scrum Master: “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 🧙‍♂️✨

  • 228