Skip to main content

2 posts tagged with "week"

week tag description

View all tags

Lesson Learned Building an AI Chatbot

· 2 min read

A month ago, while building a resume coach AI chatbot using Lambda functions and deploying them on Vercel(a leading cloud platform for frontend developers), I repeatedly encountered timeout errors in the Vercel logs during testing. As I debugged the issue for sometime, I discovered that I was using response.json() instead of streaming the response, which was causing the timeout ⌛️errors on Vercel. Once I updated the Lambda functions to use streams, it started to work without issues.

💡 I had built the chatbot’s UI using React.

resume-coach

Why do we need to use streams in Lambda?

Streams are ideal for AI chatbots or any conversation based applications because they give good user experience. With streaming, users don’t have to wait for the entire response but they can receive the output incrementally, a better interactive experience for the user 🙂.

Based on my personal experience building APIs, I would suggest streaming for texts and json for any CRUD operations or business logic implementation.

Lambda /serverless function:

    // Request streamed response from AI model
const stream = AI.generateStream(userPrompt)

res.setHeader("Content-Type", "text/plain; charset=utf-8");
res.setHeader("Cache-Control", "no-cache");

// Return chunks immediately to frontend
for await (const chunk of stream) {
const text = chunk.text;
if (text) {
res.write(text);
}
}

res.end();

Frontend(React)

const res = await fetch("api/chat");

const reader = res.body.getReader();
const decoder = new TextDecoder();

let fullText = "";

while (true) {
const { value, done } = await reader.read();
if (done) break;

const chunk = decoder.decode(value);
fullText += chunk;
}

if (!res.ok) {
throw new Error(`Failed to get response: ${res.status}`);
}

💡 Vercel allows us to send data to the client(frontend) in chunks rather than waiting for the entire response to be generated.

What are you building using AI?

Have you faced any issue building using AI and how did you solve it?

Happy learning 🎉

If you have any queries or suggestions, please reach out to yoe.johnson@gmail.com

#ai #chatbot #resumebuilder #serverless #vercel #lessonlearned #frontend #developer #learning #node #react #lambda #ui #gemini #chat

4-Week Starter Course Plan

· 2 min read

What’s Next?​

Below is a 4-Week Starter Course Plan you can follow alongside this blog.


4-Week Frontend Starter Course Plan 🗓️​

Week 1: Web Foundations​

Focus: HTML, CSS, basics of the web

Learn:

  • How the internet works (browser, server, request/response)
  • HTML tags, forms, images, links
  • CSS basics: colors, fonts, spacing

Practice Projects:

  • Personal profile page
  • Simple contact form

Challenge:

Build a one-page website about yourself using only HTML & CSS.


Week 2: JavaScript Essentials​

Focus: Core JavaScript for frontend

Learn:

  • Variables, functions, loops
  • DOM manipulation
  • Events (click, input, submit)

Practice Projects:

  • Counter app
  • Show/hide password toggle

Challenge:

Create a small app that updates content dynamically without refreshing the page.


Week 3: Modern Frontend (React or Vue)​

Focus: Component-based development

Learn:

  • Components & props
  • State management
  • Conditional rendering

Practice Projects:

  • Todo list
  • Simple dashboard UI

Challenge:

Convert a static page into reusable components.


Week 4: Backend Basics with Node.js​

Focus: Full-stack fundamentals

Learn:

  • Node.js & Express
  • REST APIs
  • Connecting frontend to backend

Practice Projects:

  • Simple API
  • Fetch data from backend

Challenge:

Build a frontend that consumes your own backend API.


Bonus: Career Readiness​

  • Git & GitHub basics
  • Portfolio building
  • Resume & interview prep

Final Words 🌱​

You don’t need to know everything to start— you just need to start and keep going.

Consistency beats talent in software development.

Happy coding! 🎉

If you have any queries or suggestions, please reach out to yoe.johnson@gmail.com